A developer is managing a web application infrastructure using AWS CloudFormation. The developer needs to configure the stack to retrieve a database password securely and ensure that the deployed infrastructure remains consistent with the template definition. Which two actions should the developer take to meet these requirements?
- Store the database password in AWS Secrets Manager and reference it in the CloudFormation template using a dynamic reference.Cevap
- Use CloudFormation stack updates to perform all infrastructure modifications, avoiding direct manual updates to the resources.Cevap
- CStore the database password in a plaintext parameters block within the CloudFormation template to avoid external service calls.
- DPerform manual adjustments directly on resources via the AWS CLI to test changes, assuming CloudFormation drift detection will automatically sync those changes to the template.
- EInitiate a stack update while the stack is currently in the ROLLBACK_IN_PROGRESS state to apply fixes immediately.
Cevap
Storing the database password in AWS Secrets Manager and referencing it dynamically, and using CloudFormation stack updates to perform all infrastructure modifications.
The correct actions are storing the database password in AWS Secrets Manager using dynamic references to prevent exposing credentials, and performing all changes via CloudFormation stack updates to avoid resource drift.
Adım Adım Çözüm
Anahtar Kavram
AWS CloudFormation best practices for resource consistency and secrets management