Security
A Lambda function retrieves the same API token from AWS Secrets Manager on every invocation, causing excessive API calls. The token can change, and updates must reach the function within five minutes. What should the developer do?
Show the answer
Correct answerD. Cache the secret locally with a refresh interval below five minutes.
AWhy not this: Embedding credentials in deployment artifacts exposes secrets and requires repeated deployments.
BWhy not this: Pinning a version prevents the application from automatically retrieving a newer current value.
CWhy not this: Rotating encryption key material does not refresh a token held by the application.
DWhy this is right: A cache with a bounded refresh interval reduces API calls while satisfying the update requirement.
A bounded secret cache reduces retrieval calls while allowing changed values to be fetched within the freshness requirement. KMS key rotation changes encryption key material, not the cached token or its refresh behavior.