Operational Excellence and Automation

A CloudFormation stack sets a Lambda environment variable using a Secrets Manager dynamic reference, but the function continues using an old password after secret rotation. The function must obtain current credentials without stack updates; which change should the architect make?

Show the answer

Correct answerC. Retrieve the secret at runtime with a rotation-aware cache and scoped IAM permissions.

AWhy not this: NoEcho masks parameter display; it does not refresh an environment variable after the underlying credential changes.

BWhy not this: Deployment-time resolution still leaves a stored value that does not refresh automatically when credentials rotate.

CWhy this is right: Runtime retrieval and cache refresh obtain current credentials independently of CloudFormation updates.

DWhy not this: An unversioned reference selects the current version during resolution, but rotation does not trigger another CloudFormation resolution.

Runtime retrieval with an appropriately refreshed cache lets the function obtain rotated credentials without a deployment. An unversioned dynamic reference selects the current secret when CloudFormation resolves it, but rotation alone does not update an existing environment variable.