secrets-manager
Skill1.2k starsChanged 3 months agoMITView on GitHub
AWS Secrets Manager for secure secret storage and rotation. Use when storing credentials, configuring automatic rotation, managing secret versions, retrieving secrets in applications, or integrating with RDS.
1 other project uses a version of this.
Trending
More talk lately.thin dataabout the whole repository
Most recently taken up by
- JayRHa/AgentSkillstheir own version, first seen Jun 9, 2026
Who's talking about itsmostafa/aws-agent-skills
- @tom-doerr.bsky.social“https://github.com/itsmostafa/aws-agent-skills”Bluesky · Mar 19, 2026 · 1 likes
- ProSkillsMD/proskills“[Candidate] itsmostafa/aws-agent-skills/skills/api-gateway - api-gateway”GitHub · Oct 4, 2026
- sudosubin/agents.nix“claude-code-plugins.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15”GitHub · Oct 4, 2026
- sudosubin/agents.nix“claude-code-marketplaces.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15”GitHub · Sep 28, 2026
The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 6
Talked about on GitHub and Bluesky (6 times).
On GitHub · 5
- Oct 4, 2026[Candidate] itsmostafa/aws-agent-skills/skills/api-gateway - api-gateway — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 4, 2026claude-code-plugins.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15 — sudosubin/agents.nix0 reactions
- Oct 4, 2026claude-code-marketplaces.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15 — sudosubin/agents.nix0 reactions
- Sep 28, 2026agent-skills.github.itsmostafa.aws-agent-skills: init at 0-unstable-2026-09-15 — sudosubin/agents.nix0 reactions
- Apr 25, 2026Audit candidate: itsmostafa/aws-agent-skills — xiaolai/nlpm0 reactions · 102 comments
On Bluesky · 1
- Mar 19, 2026https://github.com/itsmostafa/aws-agent-skills — @tom-doerr.bsky.social1 likes and repost
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- JayRHa/AgentSkills★ 11same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- api-gatewaySkill
- bedrockSkill
- cloudformationSkill
- cloudwatchSkill
- cognitoSkill
- dynamodbSkill
- ec2Skill
- ecsSkill
- eksSkill
- eventbridgeSkill
- iamSkill
- lambdaSkill
- rdsSkill
- s3Skill
- snsSkill
- sqsSkill
- step-functionsSkill
The file
Files
AWS Secrets Manager
AWS Secrets Manager helps protect access to applications, services, and IT resources. Store, retrieve, and automatically rotate credentials, API keys, and other secrets.
Table of Contents
- Core Concepts
- Common Patterns
- CLI Reference
- Best Practices
- Troubleshooting
- References
Core Concepts
Secrets
Encrypted data stored in Secrets Manager. Can contain:
- Database credentials
- API keys
- OAuth tokens
- Any key-value pairs (up to 64 KB)
Versions
Each secret can have multiple versions:
- AWSCURRENT: Current active version
- AWSPENDING: Version being rotated to
- AWSPREVIOUS: Previous version
Rotation
Automatic credential rotation using Lambda functions. Built-in support for:
- Amazon RDS
- Amazon Redshift
- Amazon DocumentDB
- Custom secrets
Common Patterns
Create a Secret
AWS CLI:
# Create secret with JSON
aws secretsmanager create-secret \
--name prod/myapp/database \
--description "Production database credentials" \
--secret-string '{"username":"admin","password":"MySecurePassword123!","host":"mydb.cluster-xyz.us-east-1.rds.amazonaws.com","port":5432,"database":"myapp"}'
# Create secret with binary data
aws secretsmanager create-secret \
--name prod/myapp/certificate \
--secret-binary fileb://certificate.pemboto3:
import boto3
import json
secrets = boto3.client('secretsmanager')
response = secrets.create_secret(
Name='prod/myapp/database',
Description='Production database credentials',
SecretString=json.dumps({
'username': 'admin',
'password': 'MySecurePassword123!',
'host': 'mydb.cluster-xyz.us-east-1.rds.amazonaws.com',
'port': 5432,
'database': 'myapp'
}),
Tags=[
{'Key': 'Environment', 'Value': 'production'},
{'Key': 'Application', 'Value': 'myapp'}
]
)Retrieve a Secret
import boto3
import json
secrets = boto3.client('secretsmanager')
def get_secret(secret_name):
response = secrets.get_secret_value(SecretId=secret_name)
if 'SecretString' in response:
return json.loads(response['SecretString'])
else:
import base64
return base64.b64decode(response['SecretBinary'])
# Usage
credentials = get_secret('prod/myapp/database')
db_password = credentials['password']Caching Secrets
from aws_secretsmanager_caching import SecretCache, SecretCacheConfig
# Configure cache
cache_config = SecretCacheConfig(
max_cache_size=100,
secret_refresh_interval=3600,
secret_version_stage_refresh_interval=3600
)
cache = SecretCache(config=cache_config)
def get_cached_secret(secret_name):
secret = cache.get_secret_string(secret_name)
return json.loads(secret)Update a Secret
# Update secret value
aws secretsmanager update-secret \
--secret-id prod/myapp/database \
--secret-string '{"username":"admin","password":"NewPassword456!"}'
# Put new version with staging labels
aws secretsmanager put-secret-value \
--secret-id prod/myapp/database \
--secret-string '{"username":"admin","password":"NewPassword456!"}' \
--version-stages AWSCURRENTEnable Rotation for RDS
aws secretsmanager rotate-secret \
--secret-id prod/myapp/database \
--rotation-lambda-arn arn:aws:lambda:us-east-1:123456789012:function:SecretsManagerRDSPostgreSQLRotation \
--rotation-rules AutomaticallyAfterDays=30Create Secret with Rotation
# Use CloudFormation for RDS secret with rotation
aws cloudformation deploy \
--template-file rds-secret.yaml \
--stack-name rds-secret# rds-secret.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
DBSecret:
Type: AWS::SecretsManager::Secret
Properties:
Name: prod/myapp/database
GenerateSecretString:
SecretStringTemplate: '{"username": "admin"}'
GenerateStringKey: password
PasswordLength: 32
ExcludeCharacters: '"@/\'
DBSecretRotation:
Type: AWS::SecretsManager::RotationSchedule
Properties:
SecretId: !Ref DBSecret
RotationLambdaARN: !GetAtt RotationLambda.Arn
RotationRules:
AutomaticallyAfterDays: 30Use in Lambda with Extension
import json
import urllib.request
def handler(event, context):
# Use AWS Parameters and Secrets Lambda Extension
secrets_port = 2773
secret_name = 'prod/myapp/database'
url = f'http://localhost:{secrets_port}/secretsmanager/get?secretId={secret_name}'
headers = {'X-Aws-Parameters-Secrets-Token': os.environ['AWS_SESSION_TOKEN']}
request = urllib.request.Request(url, headers=headers)
response = urllib.request.urlopen(request)
secret = json.loads(response.read())['SecretString']
credentials = json.loads(secret)
return credentialsCLI Reference
Secret Management
| Command | Description |
aws secretsmanager create-secret | Create secret |
aws secretsmanager describe-secret | Get secret metadata |
aws secretsmanager get-secret-value | Retrieve secret value |
aws secretsmanager update-secret | Update secret |
aws secretsmanager delete-secret | Delete secret |
aws secretsmanager restore-secret | Restore deleted secret |
aws secretsmanager list-secrets | List secrets |
Versions
| Command | Description |
aws secretsmanager put-secret-value | Add new version |
aws secretsmanager list-secret-version-ids | List versions |
aws secretsmanager update-secret-version-stage | Move staging labels |
Rotation
| Command | Description |
aws secretsmanager rotate-secret | Configure/trigger rotation |
aws secretsmanager cancel-rotate-secret | Cancel rotation |
Best Practices
Secret Organization
- Use hierarchical names:
environment/application/secret-type - Tag secrets for organization and cost allocation
- Separate by environment (dev, staging, prod)
Security
- Use resource policies to control access
- Enable encryption with customer-managed KMS keys
- Rotate secrets regularly (30-90 days)
- Audit access with CloudTrail
- Use VPC endpoints for private access
Access Control
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret"
],
"Resource": "arn:aws:secretsmanager:us-east-1:123456789012:secret:prod/*",
"Condition": {
"StringEquals": {
"secretsmanager:ResourceTag/Environment": "production"
}
}
}
]
}Application Integration
- Cache secrets to reduce API calls
- Handle rotation gracefully (retry with new credentials)
- Use Lambda extension for faster access
- Never log secrets
Troubleshooting
AccessDeniedException
Causes:
- IAM policy missing
secretsmanager:GetSecretValue - Resource policy denying access
- KMS key policy missing permissions
Debug:
# Check secret resource policy
aws secretsmanager get-resource-policy --secret-id my-secret
# Check IAM permissions
aws iam simulate-principal-policy \
--policy-source-arn arn:aws:iam::123456789012:role/my-role \
--action-names secretsmanager:GetSecretValue \
--resource-arns arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secretRotation Failed
Debug:
# Check rotation status
aws secretsmanager describe-secret --secret-id my-secret
# Check Lambda logs
aws logs filter-log-events \
--log-group-name /aws/lambda/SecretsManagerRotation \
--filter-pattern "ERROR"Common causes:
- Lambda timeout (increase to 30+ seconds)
- Network connectivity (VPC configuration)
- Database connection issues
- Wrong secret format
Secret Not Found
# List secrets to find correct name
aws secretsmanager list-secrets \
--filters Key=name,Values=myapp
# Check if deleted (within recovery window)
aws secretsmanager list-secrets \
--include-planned-deletionReferences
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

