☁︎SAA-C03

Secrets

Secrets — Concept (Secrets Manager vs Parameter Store)

Why this group

Apps need passwords, API keys, DB credentials, certificates. Hardcoding or putting them in env vars/EC2 user-data is unsafe. AWS provides two services:

  • AWS Secrets Manager — purpose-built secret store with rotation.
  • AWS Systems Manager Parameter Store — general-purpose config & parameter store; can also hold secrets.

Comparison

Secrets ManagerParameter Store
EncryptionKMS by defaultOptional (SecureString uses KMS)
RotationBuilt-in automatic rotation (RDS, Aurora, Redshift, DocumentDB) via LambdaNone built-in (DIY)
VersioningYes (AWSCURRENT, AWSPENDING, AWSPREVIOUS)Yes (numeric versions)
Resource policiesYesLimited (advanced tier supports policies)
Cross-accountYes via resource policyLimited
Cost~$0.40 / secret / month + $0.05 / 10k API callsFree standard tier; advanced ~$0.05 / param / month
Sizeup to 64 KBStandard: 4 KB / Advanced: 8 KB
UseReal secrets (DB creds, API keys) needing rotationMostly non-secret config (env names, feature flags, AMI IDs, etc.)

Secrets Manager features

  • Automatic rotation via Lambda function (managed templates for RDS family).
  • Cross-region replication for DR (multi-region secrets).
  • Tight integration with RDS / Aurora / Redshift / DocumentDB / DMS.
  • IAM + resource policies + KMS for control.
  • CloudTrail logs every access.

Parameter Store features

  • Hierarchical parameter naming (/myapp/prod/db/password).
  • Standard (free, 4 KB) and Advanced (cost, 8 KB, policies, expiration, notifications).
  • Native integration in CloudFormation / CDK / SSM Documents / Lambda env via SSM extension.
  • Can reference Secrets Manager secrets transparently (/aws/reference/secretsmanager/MySecret).

Common use patterns

  • DB credentials with auto-rotation → Secrets Manager.
  • Feature flags / non-secret config → Parameter Store (Standard).
  • Public AMI IDs in CloudFormation → Parameter Store (free, cacheable).
  • Cross-account API key sharing → Secrets Manager + resource policy.

When to use vs alternatives

NeedUse
Auto-rotate DB passwordSecrets Manager
Free, simple configParameter Store
Hold a TLS certACM (or Secrets Manager)
Encryption keysKMS
Large opaque blobsS3 (with KMS)

Common exam scenarios

  1. "Auto-rotate RDS MySQL password every 30 days" → Secrets Manager with rotation Lambda.
  2. "Store DB endpoint and AMI ID for templates, free" → Parameter Store (Standard).
  3. "Share an API key with another account" → Secrets Manager with resource policy.
  4. "Multi-region active-active secret" → Secrets Manager replication.
  5. "Old workload uses env vars containing passwords" → migrate to Secrets Manager + IAM.

Exam tip

  • Rotation needed → Secrets Manager.
  • Free + non-secret config → Parameter Store.
  • Both can be encrypted with KMS and audited via CloudTrail.

References