Xoxoftware - XOXO Creative Studio | Web & Mobile App Development | Fred Cheung | Hong Kong
AWSSecurity

AWS Secrets Manager

Managed secrets storage — automatic rotation, RDS integration, cross-account sharing, and comparison with SSM Parameter Store.

Overview

AWS Secrets Manager is a managed service for storing, retrieving, and automatically rotating secrets — database credentials, API keys, OAuth tokens, and other sensitive data.

Secrets Manager integrates natively with Amazon RDS, Redshift, and DocumentDB for automatic credential rotation without application downtime. All secrets are encrypted with KMS.


Core Concepts

ConceptDescription
SecretA stored value (string or binary) containing credentials or other sensitive data
Secret VersionEach rotation creates a new version; supports staging labels (AWSCURRENT, AWSPREVIOUS)
RotationAutomatic periodic update of a secret's value using a Lambda function
Rotation LambdaA Lambda function that generates new credentials and updates the target service
Staging LabelTags identifying the current, previous, and pending versions of a secret
Resource PolicyControls cross-account access to a secret (similar to S3 bucket policies)

How Rotation Works

1. Secrets Manager invokes rotation Lambda (createSecret)
2. Lambda generates new credentials on the target (e.g., RDS)
3. Lambda stores new credentials as AWSPENDING version
4. Lambda tests the new credentials (testSecret)
5. Lambda promotes AWSPENDING → AWSCURRENT (finishSecret)
6. Previous AWSCURRENT → AWSPREVIOUS
  • Rotation interval: configurable (e.g., every 30, 60, or 90 days)
  • RDS, Redshift, DocumentDB: AWS provides pre-built rotation Lambda templates
  • Custom secrets: write a custom Lambda function

SAA/SAP Tip: For "automatically rotate database credentials," the answer is Secrets Manager — not SSM Parameter Store. Only Secrets Manager provides built-in rotation with Lambda integration.


Secrets Manager vs SSM Parameter Store

FeatureSecrets ManagerSSM Parameter Store
Primary purposeSecrets with rotationConfiguration and secrets (no rotation)
Automatic rotationYes (built-in Lambda integration)No (manual rotation via Lambda possible)
RDS integrationNative rotation templatesNo built-in integration
Cross-account sharingYes (resource policy)No native cross-account support
EncryptionAlways encrypted (KMS required)Optional (SecureString uses KMS)
Cost$0.40/secret/month + $0.05 per 10K callsFree (standard) / $0.05 per 10K advanced
Max value size64 KB4 KB (standard) / 8 KB (advanced)
VersioningAutomatic with staging labelsLabel-based (manual)

Exam Trap: SSM Parameter Store SecureString parameters can store secrets, but they lack automatic rotation and native RDS integration. When the question mentions "rotation," always choose Secrets Manager.


Common Use Cases

  • Database credentials — Store and rotate RDS/Aurora/Redshift passwords automatically.
  • API keys — Centrally manage third-party API keys with encryption and access control.
  • Cross-account secret sharing — Resource policies allow other accounts to retrieve secrets without copying them.
  • Application configuration — Store sensitive config values retrieved via SDK at runtime.
  • CI/CD pipelines — Inject credentials into CodeBuild or Lambda without hardcoding.

SAA/SAP Exam Tips

SAA/SAP Tip: For "store and rotate database credentials with minimal operational effort," the answer is Secrets Manager with native RDS rotation. No custom Lambda is needed for supported databases (RDS, Redshift, DocumentDB).

Exam Trap: Secrets Manager charges per secret per month ($0.40). For application configurations that are not sensitive (e.g., feature flags, endpoint URLs), use SSM Parameter Store (free tier available) instead.


Cross-Cloud Equivalents

ProviderService / SolutionNotes
AWSAWS Secrets ManagerBaseline
AzureAzure Key Vault (Secrets)Combined key + secret management
GCPGoogle Secret ManagerSimilar API-based secret storage
On-PremisesHashiCorp Vault, CyberArkEnterprise secrets management platforms

Pricing Model

DimensionUnitNotes
Secret storage$0.40/secret/monthBilled per secret regardless of size
API calls$0.05 per 10,000GetSecretValue, PutSecretValue, etc.
RotationLambda pricingStandard Lambda invocation costs apply

Built by Fred Cheung @CookedRicer · Powered by Fumadocs & Github Copilot

On this page