AWS Certified Database – Specialty — Question 178
A database specialist is creating an AWS CloudFormation stack. The database specialist wants to prevent accidental deletion of an Amazon RDS
ProductionDatabase resource in the stack.
Which solution will meet this requirement?
Answer options
- A. Create a stack policy to prevent updates. Include ג€Effectג€ : ג€ProductionDatabaseג€ and ג€Resourceג€ : ג€Denyג€ in the policy.
- B. Create an AWS CloudFormation stack in XML format. Set xAttribute as false.
- C. Create an RDS DB instance without the DeletionPolicy attribute. Disable termination protection.
- D. Create a stack policy to prevent updates. Include ג€Effectג€ : ג€Denyג€ and ג€Resourceג€ : ג€ProductionDatabaseג€ in the policy.
Correct answer: D
Explanation
Option D is correct because creating a stack policy that specifies 'Effect': 'Deny' and 'Resource': 'ProductionDatabase' effectively prevents any updates that could lead to accidental deletion. Option A is incorrect because the 'Effect' should be 'Deny', not 'ProductionDatabase'. Option B is not relevant as AWS CloudFormation does not use XML format, and option C does not provide adequate protection against deletion.