A development team uses AWS CloudFormation to manage a serverless application consisting of Amazon DynamoDB tables and AWS Lambda functions. The application requires a database API key that must be rotated every 30 days. Additionally, a developer recently modified the read capacity units of one of the DynamoDB tables directly in the AWS Management Console to handle a temporary traffic spike. The team now needs to perform a stack update to deploy new application logic while addressing both the rotation requirement and the manual configuration changes.
Which of the following actions should the team take to meet these requirements? (Select TWO.)
- Store the database API key in AWS Secrets Manager, configure automatic rotation for the secret, and reference the secret in the CloudFormation template using a dynamic reference.Answer
- BStore the database API key in AWS Systems Manager Parameter Store as a SecureString parameter, and configure automatic rotation directly within the Parameter Store console.
- Perform drift detection on the CloudFormation stack, identify the modified DynamoDB read capacity properties, and update the CloudFormation template or the resource to resolve the drift before updating the stack.Answer
- DExecute the stack update using the AWS CLI with the --force-update-stack option to automatically overwrite any manual out-of-band resource modifications.
- EStore the database API key as a secure parameter in Systems Manager Parameter Store, and use the ssm-secure dynamic reference in the template to trigger automatic rotation every 30 days.
Answer
Store the database API key in AWS Secrets Manager with automatic rotation enabled, reference it via a dynamic reference in the template, and run drift detection to identify and reconcile the manual DynamoDB configurations before updating the stack.
Storing the API key in AWS Secrets Manager is correct because Secrets Manager natively supports automatic rotation of secrets and allows safe retrieval via dynamic references in CloudFormation templates. Performing drift detection on the stack is correct because it identifies manual out-of-band changes, allowing the developer to align the template or resource state before applying the stack update, preventing update failures.
Step-by-Step Solution
Key Concept
Managing secrets with rotation and handling resource drift in AWS CloudFormation.