12.1 AWS Secrets Manager & Systems Manager Parameter Store

Key Takeaways

  • AWS Secrets Manager automates credential rotation using AWS Lambda across a deterministic 4-step lifecycle (createSecret, setSecret, testSecret, finishSecret), ensuring zero application downtime when implemented with alternating multi-user patterns.

  • Cross-account access to Secrets Manager secrets mandates a Customer Managed Key (CMK) because the default AWS-managed KMS key (aws/secretsmanager) cannot have its key policy modified to permit external account principals.

  • Cross-account secret retrieval requires three synchronized authorization policies: an IAM identity policy in the caller account, a resource-based secret policy on the secret, and a KMS key policy on the CMK granting kms:Decrypt and kms:GenerateDataKey.

  • Multi-Region replica secrets automatically synchronize primary secret value changes and metadata to read-only replicas in destination regions, using local regional KMS keys for low-latency retrieval and regional disaster recovery promotion.

  • Systems Manager Parameter Store manages hierarchical configurations across Standard and Advanced tiers, supporting parameter policies (Expiration, ExpirationNotification, NoChangeNotification), higher throughput, and SecureString KMS encryption at a lower cost structure than Secrets Manager.

Last updated: September 2026

12.1 AWS Secrets Manager & Systems Manager Parameter Store

Hardcoded credentials, static API tokens, and unencrypted configuration files embedded within source code or container images represent one of the most critical security vulnerabilities in modern cloud infrastructure. A compromised database password or third-party service credential can grant unauthorized actors immediate access to production data stores. To enforce least privilege, prevent credential leakage, and satisfy regulatory mandates like PCI DSS and SOC 2, organizations must decouple sensitive secrets and configuration variables from application code.

AWS delivers two core services for managing configuration parameters and confidential credentials: AWS Secrets Manager and AWS Systems Manager Parameter Store. While both services integrate natively with AWS Key Management Service (AWS KMS) for envelope encryption and AWS Identity and Access Management (IAM) for granular authorization, their operational architectures, rotation lifecycles, cross-account mechanics, and pricing models differ substantially.


AWS Secrets Manager Architecture & Secrets Lifecycle

AWS Secrets Manager is a purpose-built secrets management service designed to encrypt, store, retrieve, and automatically rotate credentials throughout their operational lifecycle. A secret in Secrets Manager can store arbitrary plaintext strings, structured JSON key-value pairs (commonly database host, port, username, and password), or binary data up to 64 KB in size.

Secret Versioning & Staging Labels

Secrets Manager uses an immutable versioning model. When a secret value is updated or rotated, Secrets Manager does not overwrite the existing value. Instead, it generates a new Version ID (a UUID) containing the updated secret string or binary payload. Secrets Manager organizes versions using Staging Labels (version stages):

  • AWSCURRENT: The active, production-ready version of the secret that client applications consume by default when requesting a secret value without specifying a version ID.
  • AWSPREVIOUS: The immediately preceding version of the secret. If an application encounters connection issues during a rotation event or an emergency rollback is required, the application can explicitly request AWSPREVIOUS.
  • AWSPENDING: The staging label assigned to a newly generated secret version while the automated rotation workflow validates and updates the target resource.
  • Custom Staging Labels: User-defined labels (e.g., STAGING, BLUE, GREEN) used in custom deployment pipelines or phased rollouts.
Important Versioning Rule: A single version can have multiple staging labels attached, but a specific staging label (such as AWSCURRENT) can point to only ONE version at any given time within a secret.

Automated Credential Rotation Architecture

One of Secrets Manager's most powerful enterprise security capabilities is automated, scheduled credential rotation without administrative intervention. Secrets Manager coordinates rotation by invoking an AWS Lambda rotation function using a deterministic 4-step rotation lifecycle.

Loading diagram...

The 4-Step Rotation Lifecycle

When Secrets Manager initiates rotation (either via a scheduled cron interval or on-demand via the RotateSecret API), it invokes the configured Lambda function four sequential times, passing the SecretId, ClientRequestToken (which becomes the new VersionId), and the operational Step:

  1. createSecret:
    • The Lambda function checks whether a version with the ClientRequestToken already exists in Secrets Manager.
    • If not, the function generates a cryptographically secure random password and stores it in Secrets Manager by calling PutSecretValue with the staging label AWSPENDING. If createSecret fails and retries, idempotency ensures it does not overwrite an existing pending version.
  2. setSecret:
    • The Lambda function connects to the target service or database and updates the user's password to match the AWSPENDING credential.
    • In single-user rotation, it connects using the current credentials and alters its own password. In multi-user rotation, it connects using an administrative superuser secret to alter the target application user's password.
  3. testSecret:
    • The Lambda function attempts to establish a real connection and execute a test query (e.g., SELECT 1) against the target database using the AWSPENDING credentials.
    • This verification step confirms that the database accepted the password change and that network connectivity, authentication plugins, and user permissions remain intact.
  4. finishSecret:
    • The Lambda function calls UpdateSecretVersionStage to move the AWSCURRENT staging label from the old version to the newly verified AWSPENDING version.
    • Secrets Manager automatically assigns AWSPREVIOUS to the older version and removes AWSPENDING. The rotation is complete.

Single-User vs. Multi-User (Alternating) Rotation Strategies

Choosing the proper rotation strategy is critical for preventing application downtime during password changes:

Rotation ModelArchitectural MechanicsDowntime & Availability CharacteristicsBest Suited Use Case
Single-User RotationRotates credentials for a single database user account. During setSecret, the password on the database is updated before client applications retrieve the new secret from Secrets Manager.Potential brief downtime: Existing connection pools may fail or new application threads may be rejected between the execution of setSecret and the client's cache refresh.Non-critical workloads, development/testing environments, or applications capable of immediate retry with cache eviction.
Multi-User (Alternating) RotationUses two distinct database users (e.g., app_user_a and app_user_b) alongside a separate master administrator secret. The master secret provides administrative access to update the alternating users.Zero downtime: While app_user_a is active and handling live traffic under AWSCURRENT, app_user_b has its password rotated and tested. Once app_user_b is verified, finishSecret flips AWSCURRENT to point to app_user_b. Applications transition gracefully.Mission-critical production databases, high-throughput microservices, financial transaction systems.

Native Database Rotation

Secrets Manager provides native, pre-configured Lambda rotation templates for Amazon RDS (MySQL, PostgreSQL, MariaDB, Oracle, SQL Server), Amazon Aurora, Amazon DocumentDB, and Amazon Redshift. When configured via the AWS Management Console or AWS CloudFormation, Secrets Manager automatically creates the Lambda function inside the target database's private VPC subnets and configures required security group rules.

Client-Side Caching SDKs

Calling GetSecretValue on every microservice request or web transaction introduces substantial API latency, exhausts Secrets Manager service quotas, and generates unnecessary API billing costs. AWS provides open-source Secrets Manager caching clients (for example Java, Python, .NET, Go, and Rust) and the Secrets Manager Agent, a local HTTP caching service for any language:

  • Secrets are retrieved once and cached in application memory; the caching clients refresh each secret after a configurable interval (default 1 hour).
  • The Secrets Manager JDBC driver wraps database connections: if authentication fails because the password was rotated, it refreshes the secret and retries the connection. Plain caching clients don't retry on their own, so applications should refresh the cached secret when a login fails.

Cross-Account Secret Access & KMS Cryptographic Requirements

In multi-account enterprise landing zones, centralized shared services or database accounts frequently host secrets that must be accessed by application workloads running in spoke member accounts. Establishing cross-account access requires precise coordination of IAM policies and KMS key policies.

Loading diagram...

The AWS-Managed KMS Key Limitation

Critical Exam Rule: Cross-account access to a secret encrypted with the default AWS-managed KMS key (aws/secretsmanager) is impossible. The key policy of an AWS-managed key is maintained strictly by AWS and cannot be edited to add external AWS account principals. To share a secret across accounts, you must encrypt the secret using a Customer Managed Key (CMK).

The Three Policy Checkpoints

For a workload in Account A (111122223333) to read a secret in Account B (444455556666), three synchronized policies must explicitly permit the transaction:

  1. IAM Identity Policy (Account A): Attached to the calling IAM role, granting permissions to read the external secret and decrypt using the external KMS key:
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowReadExternalSecret",
          "Effect": "Allow",
          "Action": "secretsmanager:GetSecretValue",
          "Resource": "arn:aws:secretsmanager:us-east-1:444455556666:secret:ProdDBSecret-a1b2c3"
        },
        {
          "Sid": "AllowDecryptWithExternalKMS",
          "Effect": "Allow",
          "Action": "kms:Decrypt",
          "Resource": "arn:aws:kms:us-east-1:444455556666:key/12345678-1234-1234-1234-123456789012"
        }
      ]
    }
    
  2. Secret Resource-Based Policy (Account B): Attached directly to the secret in Secrets Manager, granting access to the principal in Account A:
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowCrossAccountAccess",
          "Effect": "Allow",
          "Principal": {
            "AWS": "arn:aws:iam::111122223333:role/MicroserviceRole"
          },
          "Action": "secretsmanager:GetSecretValue",
          "Resource": "*"
        }
      ]
    }
    
  3. KMS Key Policy (Account B): Attached to the Customer Managed Key encrypting the secret, permitting the external IAM role to decrypt:
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AllowExternalRoleToDecrypt",
          "Effect": "Allow",
          "Principal": {
            "AWS": "arn:aws:iam::111122223333:role/MicroserviceRole"
          },
          "Action": [
            "kms:Decrypt",
            "kms:DescribeKey"
          ],
          "Resource": "*"
        }
      ]
    }
    

Multi-Region Secret Replication

For globally distributed applications and multi-region disaster recovery (DR) architectures, Secrets Manager provides Multi-Region Secret Replication:

  • Primary vs. Replica Secrets: A secret is designated as the primary secret in a source region (e.g., us-east-1). Administrators configure replication to one or more destination regions (e.g., us-west-2, eu-west-1).
  • Regional KMS Encryption: Replica secrets are encrypted using a KMS key in the replica's destination region. This can be an AWS-managed key for Secrets Manager in that region or a destination-region Customer Managed Key. Secrets Manager also supports AWS KMS Multi-Region Keys.
  • Automated Synchronization: Whenever the primary secret's value, staging labels, tags, or metadata are modified, Secrets Manager automatically replicates the changes to all replica regions asynchronously within seconds.
  • Read-Only Replicas: Replicas are read-only. Applications in destination regions execute GetSecretValue against their local regional endpoint, achieving single-digit millisecond latency and avoiding cross-region network dependencies.
  • Disaster Recovery Promotion: If the primary region suffers an outage, an administrator or automated failover script can invoke secretsmanager:PromoteSecret on a replica secret. This detaches the replica from the primary, converting it into an independent, fully writable primary secret capable of managing its own rotation and replicas.

Systems Manager Parameter Store Architecture

AWS Systems Manager Parameter Store provides centralized, secure, hierarchical storage for configuration parameters, license codes, environment flags, and secrets. Parameter Store supports three core data types:

  1. String: Plaintext configuration data (e.g., AMI IDs, URLs, logging levels).
  2. StringList: Comma-separated strings (e.g., subnet IDs subnet-1234,subnet-5678).
  3. SecureString: Sensitive data encrypted at rest using AWS KMS envelope encryption.

Parameter Tiers: Standard vs. Advanced

Parameter Store offers two parameter tiers that govern capacity, features, and cost:

Capability / FeatureStandard ParametersAdvanced Parameters
Storage CostFree (No storage charge)$0.05 per parameter per month
Maximum Parameter Size4 KB8 KB
Maximum Total ParametersUp to 10,000 per account & regionUp to 100,000 per account & region
Parameter PoliciesNot supportedSupported (Expiration, ExpirationNotification, NoChangeNotification)
API Throughput OptionsStandard (up to 40 TPS default)Higher throughput (up to 10,000 TPS, billed at $0.05 per 10,000 requests)
Version HistoryTracks up to 100 versionsTracks up to 100 versions

Advanced Parameter Lifecycle Policies

Advanced parameters allow administrators to attach automated lifecycle policies to enforce operational governance:

  • Expiration Policy: Automatically deletes a parameter at a specified ISO-8601 timestamp. Ideal for temporary access tokens, ephemeral credentials, or trial license keys.
  • ExpirationNotification Policy: Emits an Amazon EventBridge event a specified number of days or hours before the parameter's expiration timestamp, allowing security teams to initiate automated renewal workflows.
  • NoChangeNotification Policy: Emits an EventBridge event if a parameter has not been updated within a specified duration (e.g., 90 days). This alerts administrators that a static credential or configuration has become stale and requires manual review.

Parameter Store Cross-Account Limitations

Parameter Store has narrower cross-account options than Secrets Manager:

  • Standard parameters can't be shared. An application in Account A must assume an IAM role in Account B that has ssm:GetParameter (and kms:Decrypt for SecureString values).
  • Advanced parameters can be shared with other accounts or an organization through AWS Resource Access Manager (RAM). Consumers get read-only access and must reference the parameter by its full ARN. A shared SecureString parameter must be encrypted with a customer managed KMS key whose key policy lets the consumer accounts decrypt.

Secrets Manager vs. Parameter Store: Decision Matrix

When designing cloud architectures, security engineers must evaluate trade-offs between Secrets Manager and Parameter Store across multiple operational criteria:

Architectural RequirementAWS Secrets ManagerSystems Manager Parameter Store
Primary PurposeSecrets management and automated credential rotation.Hierarchical configuration management and basic secret storage.
Native Automated RotationYes: Built-in 4-step Lambda rotation engine with native RDS, Aurora, DocumentDB, and Redshift templates.No: No native rotation engine. Rotation requires building custom EventBridge and Lambda orchestration.
Pricing Model$0.40 per secret per month + $0.05 per 10,000 API calls.Free for Standard parameters. $0.05 per Advanced parameter/month + $0.05 per 10,000 API calls for higher throughput.
Maximum Secret Size64 KB4 KB (Standard) or 8 KB (Advanced).
Cross-Account AccessSupported natively via resource-based secret policies + KMS key policies.Advanced parameters can be shared read-only through AWS RAM (SecureString needs a customer managed key); otherwise use cross-account role assumption.
Multi-Region ReplicationNative: Automatic multi-region replication and one-click DR promotion.Manual: Requires custom pipelines or CloudFormation StackSets to synchronize parameters across regions.
Client SDK CachingCaching clients (Java, Python, .NET, Go, Rust), the JDBC driver, and the Secrets Manager Agent.AWS AppConfig agent or custom application-level caching logic.
Lifecycle PoliciesRotation schedules and version staging labels.Expiration, ExpirationNotification, and NoChangeNotification policies.

Specialty Exam Pitfalls & Architectural Traps

  1. The AWS-Managed KMS Key Cross-Account Trap: Attempting to share a secret across AWS accounts while encrypting the secret with the default aws/secretsmanager key. The caller role will receive an AccessDeniedException on the KMS decrypt step because AWS-managed key policies cannot be modified to include cross-account principals. Always provision a Customer Managed Key (CMK) for cross-account secrets.
  2. The Lambda Rotation VPC Isolation Trap: Deploying a Lambda rotation function inside a private VPC subnet to access an internal RDS instance, but failing to provide the Lambda function with access to Secrets Manager. Because Secrets Manager is a public AWS service, the Lambda function must either have outbound internet access via a NAT Gateway or, preferably, route through an AWS Secrets Manager VPC Interface Endpoint (com.amazonaws.<region>.secretsmanager) located within the VPC.
  3. Out-of-Band Password Desynchronization: Manually changing a database master password in the Amazon RDS console or database CLI without updating Secrets Manager. When the automated rotation function subsequently executes setSecret, it attempts to authenticate using the old password stored in Secrets Manager, resulting in authentication failures and a broken rotation state.
  4. Overlooking Parameter Store Throughput Limits: Relying on standard Parameter Store throughput (40 TPS) in high-volume containerized microservice architectures. When hundreds of container tasks boot concurrently and call ssm:GetParameter, Parameter Store throttles requests with ThrottlingException. For high-concurrency environments, you must either enable Higher Throughput (up to 10,000 TPS) or deploy client-side caching.
Loading diagram...
Secrets Manager 4-Step Rotation Lifecycle vs Cross-Account Architectural Flow
Test Your Knowledge

A security engineer is troubleshooting cross-account access to an AWS Secrets Manager secret. The secret resides in Account A (444455556666) and must be read by an Amazon ECS task role in Account B (111122223333). The engineer has attached an IAM policy to the ECS task role in Account B granting secretsmanager:GetSecretValue and kms:Decrypt on the respective resource ARNs, and configured a resource-based policy on the secret in Account A permitting the ECS task role. However, the ECS task receives an AccessDeniedException during secret retrieval. What is the root cause of this failure?

A

Secrets Manager does not support cross-account resource-based policies, requiring the ECS task to use STS AssumeRole instead.

B

The secret in Account A is encrypted using the default AWS-managed key aws/secretsmanager, which does not allow cross-account key policy modification.

C

Account B must be an administrative member of the same AWS Organizations hierarchy as Account A to read cross-account secrets.

D

The ECS task role must be granted secretsmanager:DescribeSecret permissions in the secret's resource-based policy.

Test Your Knowledge

A financial payment gateway requires automated credential rotation for its Amazon Aurora PostgreSQL database every 30 days. The application processes continuous financial transactions and cannot tolerate connection drops, transient authentication errors, or retry timeouts during rotation events. Which rotation design satisfies this requirement with zero application downtime?

A

Configure single-user rotation in Secrets Manager with a 30-day schedule and configure application connection pools to retry database connections with exponential backoff.

B

Deploy a custom Systems Manager Parameter Store workflow with an EventBridge cron rule that updates a SecureString parameter and forces an Aurora cluster restart.

C

Use Secrets Manager single-user rotation and configure the Lambda rotation function's setSecret step to delay updating PostgreSQL until 03:00 UTC maintenance windows.

D

Configure Secrets Manager alternating multi-user rotation using two distinct database accounts and a master administrative secret, allowing the inactive user to be rotated and tested before flipping AWSCURRENT.

Test Your Knowledge

An enterprise security architect needs to store third-party API credentials that expire precisely at midnight on the last day of each quarter. The solution must automatically delete the credential at that exact timestamp, emit an alert notification to the security team 5 days prior to expiration, and minimize ongoing storage costs. Which implementation achieves this goal?

A

Store the credential in Systems Manager Parameter Store as an Advanced parameter using an Expiration policy set to the quarter-end timestamp and an ExpirationNotification policy set to 120 hours.

B

Store the credential in AWS Secrets Manager and configure a scheduled CloudWatch metric alarm with a Lambda function to call DeleteSecret 5 days before quarter-end.

C

Store the credential in Systems Manager Parameter Store as a Standard parameter and create an Amazon EventBridge rule that queries the parameter version every 24 hours.

D

Store the credential in an Amazon S3 bucket with S3 Lifecycle expiration rules configured for 90 days and an S3 Event Notification sent to Amazon SNS.

Test Your Knowledge

A security engineer deploys an AWS Lambda rotation function to rotate credentials for an Amazon RDS MySQL instance residing inside private subnets of a VPC. The Lambda function is configured to run inside the same private subnets and security groups as the database. During rotation execution, the Lambda function times out during the createSecret step. What configuration resolves this issue?

A

Assign an Elastic IP address directly to the Lambda function's elastic network interface in the private subnet.

B

Add an inbound security group rule on the RDS MySQL instance permitting TCP port 3306 from the Lambda function.

C

Deploy an AWS Secrets Manager VPC Interface Endpoint (com.amazonaws.<region>.secretsmanager) in the VPC and ensure DNS resolution is enabled.

D

Modify the Lambda function execution role to grant rds:ModifyDBInstance permissions.

Sections you finish are checked off in the contents.