Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I am trying to batch automate updating of secrets in a loop but based on:

https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_limits.html

UpdateSecret :Each supported Region: 50 per second

and:

https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_update-secret.html

We recommend you avoid calling PutSecretValue or UpdateSecret at a sustained rate of more than once every 10 minutes. When you call PutSecretValue or UpdateSecret to update the secret value, Secrets Manager creates a new version of the secret. Secrets Manager removes unlabeled versions when there are more than 100, but it does not remove versions created less than 24 hours ago. If you update the secret value more than once every 10 minutes, you create more versions than Secrets Manager removes, and you will reach the quota for secret versions.

It seems that in general you should avoid calling:

aws secretsmanager update-secret

in a loop - even with a sleep of a few seconds?

And regarding the multiple versions of a secret I only see two versions (AWSPREVIOUS and AWSCURRENT). But maybe the above is related to some versioning not exposed in the web console?

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

Yes — you can call aws secretsmanager update-secret in a loop, but the guidance you quoted is about a different risk than the per-second API limit.

The “50 per second” limit is a service/API throughput quota.

The “avoid more than once every 10 minutes” guidance is about version churn per secret when you update the secret value (SecretString/SecretBinary), because each value update creates a new version and Secrets Manager will not remove unlabeled versions created within the last 24 hours. If you update the same secret value too frequently, you can hit the per-secret version quota.

Key points:

If your loop updates MANY DIFFERENT secrets once each (or infrequently), that’s fine.
The 10-minute guidance is mainly about repeatedly updating the SAME secret’s value at high frequency.

A new version is created only when you update the secret value (SecretString/SecretBinary).
If you update only metadata (e.g., Description, tags), you are not creating a new value version.

Why you only see AWSCURRENT and AWSPREVIOUS:

Secrets Manager versions are identified by VersionIds.
Only some versions have staging labels (AWSCURRENT, AWSPREVIOUS, etc.).
You can still have many unlabeled versions that are not “promoted” to those labels.

To see all versions (including unlabeled), use:

aws secretsmanager list-secret-version-ids
--secret-id <SECRET_ARN_OR_NAME>

Practical recommendation for automation:

If you need to update secret values in bulk, do it, but avoid updating the same secret more often than the guidance (≈ once per 10 minutes) unless you are sure you won’t hit the version quota.

If you need frequent updates (every seconds/minutes) to the same value, Secrets Manager is the wrong storage.
Consider a different store (e.g., SSM Parameter Store for non-rotating config, DynamoDB, etc.) depending on your use case.

If you’re looping at scale, also add retry/backoff for throttling, but the “version quota” issue is per secret, not per region-wide TPS.

You must be logged in to vote
1 reply
@uldyssian-sh
Comment options

Thanks! If this helps, please consider marking it as “Helpful” or “Accepted” 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.