Certopolis

AWS Certified Solutions Architect – Associate

Secrets Manager vs Parameter Store: rotation, cost and limits

Use Secrets Manager for credentials and other secrets that need automatic rotation, replication to other Regions or cross-account access. It is billed per secret per month and per API call. Use Parameter Store for configuration such as endpoint URLs and AMI IDs. It has no credential rotation, and its standard tier has no additional charge.

What each one is for

AWS positions Parameter Store for static configuration and key-value data: approved AMI IDs, environment variables, endpoint URLs, resource identifiers and tuning values. Secrets Manager is for database credentials, API keys, OAuth tokens and other secrets that need rotation, cross-account access or detailed audit logging.

Parameter Store has three types. String is plain text. StringList is a comma-separated list, such as subnet-123abc,subnet-456def. SecureString is encrypted with AWS KMS. Even for SecureString, AWS recommends Secrets Manager for credentials, because Parameter Store has no rotation.

Parameter Store tiers

Standard is the default. It allows 10,000 parameters per account and Region, values up to 4 KB, no parameter policies, no sharing with other accounts, and no additional charge.

Advanced allows 100,000 parameters, values up to 8 KB, parameter policies such as expiration and expiration notifications, and sharing with other accounts. It is charged. You can change a standard parameter to advanced, but not back. To return to standard, delete the parameter and create it again.

Parameter Store keeps the last 100 versions of each parameter and supports hierarchies such as /dev/webserver/linux/approved-ami.

Secrets Manager rotation and replication

Secrets Manager rotates in two main ways. Managed rotation needs no Lambda function, and is offered by Amazon RDS, Aurora and DocumentDB for master user credentials and by Amazon Redshift for admin passwords. Other secrets rotate with a Lambda function, which is billed at Lambda rates. A rotation schedule can be as frequent as every four hours.

You can replicate a secret to other Regions so applications there read it locally. The replica's ARN matches the primary except for the Region. When rotation is on for the primary, the new value propagates to every replica, so you do not configure rotation on each replica. A replica can use a KMS key in its own Region.

Cross-account access to a secret

Reading a secret from another account needs three things: a resource policy on the secret that allows the caller, a key policy statement on the secret's KMS key that allows kms:Decrypt, and an identity policy in the caller's account that allows secretsmanager:GetSecretValue and kms:Decrypt.

The AWS managed key aws/secretsmanager cannot be used for cross-account access. The secret must be encrypted with a customer managed key that you create.

Where the exam catches people

  • Believing a SecureString parameter rotates itself: Parameter Store has no credential rotation.
  • Believing a secret encrypted with aws/secretsmanager can be shared with another account: cross-account access needs a customer managed KMS key.
  • Believing each replica secret needs its own rotation: rotation runs on the primary and the new value propagates to the replicas.
  • Believing every Secrets Manager rotation needs a Lambda function you write: managed rotation covers RDS, Aurora and DocumentDB master user credentials and Redshift admin passwords.
  • Believing an advanced parameter can be moved back to standard: it cannot, and you must delete and recreate it.

Written from Amazon Web Services's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. An application runs in three Regions and reads one database credential. Security requires the credential to rotate automatically, and the application teams require a local read in each Region with no cross-Region call. Nobody wants to operate rotation code in three places. Which solution meets these requirements?

    Right. In the game that’s Renown for your Design Secure Architectures building.

    Not that one: D is right. In the game your Design Secure Architectures building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    With "the ARN for a replicated secret... the same as the primary secret except for the Region." Rotation stays in one place: "if you turn on rotation for your primary secret, Secrets Manager rotates the secret in the primary Region, and the new secret value propagates to all of the associated replica secrets. You don't have to manage rotation individually for all of the replica secrets." And the rotation itself need not be code the team owns - for most managed secrets "you use managed rotation, where the service configures and manages rotation for you. Managed rotation doesn't use a Lambda function."

    Written from docs.aws.amazon.com/secretsmanager/latest/userguide/replicate-secrets.html

  2. A role in a second account must read one database credential held in Secrets Manager in the first account. The secret is currently encrypted with the AWS managed key for Secrets Manager, and a resource policy naming the role has been attached, but every GetSecretValue call still fails. Which solution meets these requirements?

    Right. In the game that’s Renown for your Design Secure Architectures building.

    Not that one: C is right. In the game your Design Secure Architectures building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The identity is the second: the documented sequence is a resource policy on the secret in Account1, a statement in the KMS key policy in Account1 allowing kms:Decrypt and kms:DescribeKey, and "an identity policy to the identity in Account2" allowing secretsmanager:GetSecretValue and kms:Decrypt on the two ARNs.

    Written from docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples_cross.html

  3. A deployment reads three values from Parameter Store: a list of subnet IDs, an endpoint URL, and an account identifier that a compliance rule says must not be readable in plaintext by anyone browsing the console. Which solution meets these requirements?

    Right. In the game that’s Renown for your Design Secure Architectures building.

    Not that one: B is right. In the game your Design Secure Architectures building would lose a little Renown, and this question would come back later.