A developer is deploying a multi-tier application using an AWS CloudFormation template. The template defines an Amazon RDS DBInstance that contains critical production data. To ensure data safety and prevent downtime, the developer must meet two requirements:
1. Prevent the database instance from being deleted when the CloudFormation stack is deleted.
2. Prevent the database instance from being accidentally updated or replaced during stack updates, while still allowing other stack resources to be updated.
Which combination of actions should the developer take to meet these requirements? (Select TWO.)
- Set the DeletionPolicy attribute of the DBInstance resource to Retain in the CloudFormation template.Cevap
- Define a Stack Policy containing an explicit Deny statement for Update actions on the DBInstance resource.Cevap
- CSet the UpdateReplacePolicy attribute of the DBInstance resource to Delete in the template.
- DManually enable deletion protection on the RDS DBInstance using the AWS Console, then run drift detection to update the stack state.
- EStore the database configuration parameters in Systems Manager Parameter Store and set a CloudFormation stack policy to restrict access to the parameter path.
Cevap
The developer should set the DeletionPolicy attribute of the DBInstance resource to Retain in the CloudFormation template, and define a Stack Policy containing an explicit Deny statement for Update actions on the DBInstance resource.
To satisfy the requirements, the developer must configure both DeletionPolicy and a Stack Policy. Setting the DeletionPolicy to Retain ensures that the RDS DBInstance is kept when the stack is deleted. Applying a Stack Policy with an explicit Deny for Update actions on the DBInstance resource prevents it from being modified or replaced during stack updates, while still allowing other stack resources to be updated.
Adım Adım Çözüm
Anahtar Kavram
AWS CloudFormation Resource Lifecycle Protection
Tahmini Süre:1m 30s