skip to content

Secrets Manager & Parameter Store

AWS gives me two places to keep configuration secrets, and the interview question is always which one and why: Secrets Manager buys managed rotation and cross-account sharing, Parameter Store is cheaper for plain config with SecureString when needed.

part ofAWSoverview, primer and where to startread it →
on this pageshow

questions

5

Your service on AWS needs one database password plus about forty non-secret configuration values. Would you put them in AWS Secrets Manager or in SSM Parameter Store, and what concretely drives that decision?

level: middleimportance: must knowfreq 76%

answer

  1. both encrypt; only one rotates
  2. per-secret monthly charge versus free tier
  3. resource policy on the value itself
  4. hierarchy paths and GetParametersByPath
  5. 4 KB standard tier, 40 TPS default

basics

~20 s

Secrets Manager buys managed rotation, a resource policy on the secret for cross-account reads, and cross-Region replication, and charges per secret per month. SSM Parameter Store is free at standard tier and fits plain config, with SecureString when a value must be encrypted.

solid answer

~50 s

I would put the forty configuration values in **SSM Parameter Store** as `String` parameters under a hierarchy like `/myapp/prod/`, and the database password in **Secrets Manager** — or in Parameter Store as a `SecureString` if nothing needs to rotate it. The decision is not "is it a secret": both stores encrypt with KMS, both are IAM-controlled, both are read over an API. It is about the three things Secrets Manager adds and bills for: scheduled rotation driven by a rotation function, a resource-based policy attached to the secret so another account can read it directly, and cross-Region replication. If a value needs none of those, Parameter Store does the same job for no per-parameter charge at standard tier. The counter-pressure is cost and scale: Secrets Manager bills roughly $0.40 per secret per month, so a few hundred values there is real money, while Parameter Store's standard tier caps values at 4 KB and has a low default request rate you can throttle against.

code

bash · 6 lines
bash
aws ssm put-parameter --name /myapp/prod/db/host --type String --value db.internal
aws ssm put-parameter --name /myapp/prod/db/password --type SecureString --value 'hunter2'
aws ssm get-parameters-by-path --path /myapp/prod/ --recursive --with-decryption

aws secretsmanager create-secret --name /myapp/prod/db/master --secret-string '{"username":"app","password":"hunter2"}'
aws secretsmanager get-secret-value --secret-id /myapp/prod/db/master --query SecretString --output text

go deeper

for a junior

Know that both services exist, that Parameter Store paths look like /app/env/key, and that a SecureString parameter is encrypted while a String is not. Say plainly that credentials are read at runtime, never committed.

for a middle

Be ready to name the concrete capabilities Secrets Manager adds — rotation, a resource policy on the secret, cross-Region replication — and to contrast them with Parameter Store's free standard tier, hierarchy reads and 4 KB limit.

for a senior

Show the cost and blast-radius reasoning: which values justify a per-secret monthly charge, how you scope IAM by path prefix versus secret ARN, and how you avoid throttling the shared Parameter Store request rate from a large fleet.

for a principal

Own the estate-wide policy: one convention for naming and environment separation, a rule for what is allowed to live only in Parameter Store, how cross-account and multi-Region access is granted, and what the bill looks like at ten times today's service count.

## Two stores, one decision AWS ships two general-purpose places to keep configuration and credentials: **AWS Secrets Manager** and **AWS Systems Manager Parameter Store** (usually just "SSM Parameter Store"). They overlap heavily, which is exactly why the choice is an interview staple. Both are regional, both are fronted by IAM, both can encrypt a value with a KMS key, and both are read at runtime through an API call rather than being baked into an image. So the useful framing is not "which one is for secrets". It is: *what does Secrets Manager add on top of a key/value store, and is this particular value worth paying for it?* ## What Secrets Manager adds **Managed rotation.** A secret can carry a rotation schedule (`RotationRules`) and a rotation Lambda function. Secrets Manager invokes that function on schedule, and for common targets — RDS, Aurora, DocumentDB, Redshift — AWS supplies the rotation logic so you configure rather than write it. Parameter Store has no rotation concept at all; you would build the scheduler, the new-credential handoff and the rollback yourself. **A resource-based policy on the value itself.** You can attach a policy to a secret that names a principal in another account, which together with an allow in that account's role makes a cross-account read work. Parameter Store parameters do not carry their own resource policy, so cross-account access is normally done the long way round: the consumer assumes a role in the owning account and reads from there. One caveat that catches people: a cross-account secret must be encrypted with a **customer managed** KMS key, because the key policy of an AWS-managed key cannot be edited to allow the foreign principal. **Cross-Region replication.** Secrets Manager can maintain read replicas of a secret in other Regions and keep them in sync, which matters for multi-Region active/active services and for disaster recovery. In Parameter Store you copy values yourself. **A recovery window on delete.** Deleting a secret schedules it for deletion 7–30 days out (default 30) unless you pass `ForceDeleteWithoutRecovery`. That has saved more than one production outage. A deleted parameter is simply gone. ## What Parameter Store gives you **Price.** Standard-tier parameters and standard throughput carry no charge. That single fact decides most real estates: a service with dozens or hundreds of settings does not want a per-item monthly bill. **Hierarchies.** Parameter names are paths — `/myapp/prod/db/host` — and `GetParametersByPath` fetches a whole subtree in one call, recursively if you ask. That maps naturally onto per-environment configuration, and it makes IAM easy: a policy on `arn:aws:ssm:...:parameter/myapp/prod/*` scopes a role to one environment. **Three types.** `String` and `StringList` are stored in the clear; `SecureString` is encrypted with a KMS key, and reading the plaintext requires `WithDecryption` plus `kms:Decrypt` on that key. So Parameter Store can hold secrets perfectly well — it just will not rotate them for you. **Tiers.** Standard tier: values up to 4 KB and a five-figure cap on parameters per account per Region, free. Advanced tier: values up to 8 KB, a much higher cap, parameter policies (expiration and notification), and a per-parameter monthly charge. The tier is per parameter, so you can keep almost everything standard and promote the few oversized ones. ## The traps **Throughput.** Parameter Store's default steady-state request rate is low — 40 transactions per second across the account/Region at the time of writing — and shared by everything. A fleet of containers that reads its config on every request will throttle. Higher throughput is an opt-in, paid service setting; caching in the process is the cheaper fix. ```bash aws ssm put-parameter --name /myapp/prod/db/host --type String --value db.internal aws ssm get-parameters-by-path --path /myapp/prod/ --recursive --with-decryption ``` **Size.** Neither store is a config file service. A Secrets Manager secret value tops out at 64 KB; a standard parameter at 4 KB. A large JSON blob belongs in S3 with the credentials to read it in one of these stores. **The bridge.** Parameter Store can read a Secrets Manager secret through the reserved path `/aws/reference/secretsmanager/<secret-name>`, so code that already speaks one API can consume the other. Useful when a platform (an older deployment tool, for instance) only knows how to read parameters. ## How the choice usually lands Configuration — hostnames, feature flags, bucket names, tuning knobs — goes in Parameter Store as `String` under a per-environment path. Credentials that a managed rotation exists for, or that another account must read, or that must survive a Region loss, go in Secrets Manager. Everything in between is a cost call, and "it's a password, therefore Secrets Manager" is the answer that gets pushed back on: say what capability you are buying.

  • You have 500 values and only three of them ever rotate. How would you lay that out?
    Put the 497 in Parameter Store under a per-environment hierarchy such as `/myapp/prod/`, read with `GetParametersByPath` at startup, and keep the three rotating credentials in Secrets Manager. That keeps the per-secret monthly charge to three items while still getting managed rotation where it earns its price. Scope IAM by path prefix for the parameters and by secret ARN for the three.
  • Does putting a value in Secrets Manager instead of Parameter Store make it more secure?
    Not by itself. Both encrypt at rest with KMS, both are gated by IAM, and both hand the plaintext to whatever principal is allowed to read it. Secrets Manager changes the *lifecycle* — rotation, replication, a delete recovery window, a resource policy — not the strength of the protection. A `SecureString` parameter with a tight IAM policy is not weaker than a loosely scoped secret.
  • Can code that only knows the Parameter Store API read a Secrets Manager secret?
    Yes. `GetParameter` accepts the reserved path `/aws/reference/secretsmanager/<secret-name>`, and Parameter Store fetches the secret on your behalf. The caller still needs `secretsmanager:GetSecretValue` on the secret and `kms:Decrypt` on its key — the bridge changes the API surface, not the authorization.

saying these in an interview costs you the question

  • Claiming Parameter Store cannot store secrets at all
  • Choosing Secrets Manager for everything regardless of cost
  • Thinking Secrets Manager encrypts and Parameter Store does not
  • Assuming Parameter Store rotates values automatically
  • Ignoring the default request-rate limit and caching nothing

context

open as a page

In AWS SSM Parameter Store, what does storing a value as a SecureString change compared with a String parameter, and what does a caller need in order to get the plaintext back?

level: juniorimportance: should knowfreq 58%

basics

~20 s

A SecureString parameter is encrypted with a KMS key instead of being stored in the clear. Reading the plaintext needs two things: the GetParameter call must ask for decryption via WithDecryption, and the caller's IAM policy must allow kms:Decrypt on the key as well as ssm:GetParameter.

open as a page

A Lambda function calls GetSecretValue against AWS Secrets Manager at the top of every invocation. What goes wrong as traffic grows, and how do you fix it without pinning a stale credential forever?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Every invocation pays a network round trip and a KMS decrypt, the API calls are billed per request, and at high concurrency the account starts getting throttled. Cache the value per execution environment with a bounded lifetime, and refetch on an authentication failure so rotation still lands.

open as a page

Explain how rotation works in AWS Secrets Manager: what the AWSCURRENT, AWSPENDING and AWSPREVIOUS staging labels are for, and what the rotation function is expected to do at each of its four steps.

level: seniorimportance: should knowfreq 48%

basics

~20 s

Secrets Manager versions a secret and moves staging labels between versions. AWSCURRENT is what readers get by default, AWSPENDING is the candidate being rotated in, AWSPREVIOUS is the last good one. The rotation function runs createSecret, setSecret, testSecret and finishSecret.

open as a page

In an ECS task definition, what is the difference between putting a value in a container's `environment` list and its `secrets` list, and what happens to an already-running task when the referenced secret is rotated?

level: middleimportance: nice to knowfreq 34%

basics

~20 s

An environment entry stores the literal value in the task definition, visible to anyone who can describe it. A secrets entry stores only an ARN, and the agent resolves it at task start using the task execution role. Rotation does not reach running tasks; they keep the value injected at launch.

open as a page