A developer is managing an application stack using AWS CloudFormation. The stack contains an Amazon RDS DB instance and an Amazon EC2 instance within an Amazon VPC. The developer has two new requirements:
1. Securely store the database credentials and ensure they are rotated automatically every days.
2. Detect any manual configuration changes made directly to the EC2 security group and restore the security group to the state defined in the CloudFormation template.
Which combination of actions should the developer take to meet these requirements? (Select TWO.)
- Store the database credentials in AWS Secrets Manager, configure automatic rotation, and reference the secret in the CloudFormation template using a dynamic reference.Cevap
- Perform drift detection on the CloudFormation stack, review the drifted resources, and manually edit the security group in the Amazon VPC console to match the template configuration.Cevap
- CStore the database credentials in AWS Systems Manager Parameter Store as a SecureString parameter, configure the built-in Parameter Store rotation schedule, and reference it in the template using a dynamic reference.
- DUse the CloudFormation console to run drift detection, select the drifted security group, and click the Reconcile Drift button to automatically overwrite the live resource configurations with the template state.
- EInitiate a stack update using a modified template to trigger a rollback, then use the ContinueUpdateRollback API while the stack is in the ROLLBACK_IN_PROGRESS state to force the security group back to its original state.
Cevap
Store the database credentials in AWS Secrets Manager with automatic rotation, reference it via dynamic references, perform drift detection, and manually revert the out-of-band security group changes.
The correct combination is to store the credentials in AWS Secrets Manager and use dynamic references, which supports the -day rotation requirement, and to use drift detection to identify out-of-band changes, followed by manual remediation to revert the security group to the configuration defined in the template.
Adım Adım Çözüm
Anahtar Kavram
AWS CloudFormation Drift Detection and secrets management integration