AWS Developer DVA-C02 · Deployment · easy
An AWS CloudFormation stack provisions an Amazon RDS production database and an Amazon S3 audit bucket. If a junior engineer accidentally deletes the CloudFormation stack, the company wants the RDS database to have a final snapshot taken automatically before termination, and the S3 bucket to be kept intact without being deleted. Which DeletionPolicy values should be set on the RDS instance and the S3 bucket in the CloudFormation template?
Published · Last updated · checked before publication — how we verify questions
Options
Answer: B. Set DeletionPolicy: Snapshot on RDS and DeletionPolicy: Retain on S3
In CloudFormation, setting DeletionPolicy: Snapshot on resources that support snapshots (such as AWS::RDS::DBInstance, AWS::EC2::Volume, AWS::Redshift::Cluster) creates a final snapshot before deleting the resource, while setting DeletionPolicy: Retain preserves the resource (AWS::S3::Bucket) in your AWS account when the stack is deleted.
Why the other options are wrong
- A. Set DeletionPolicy: Delete on both the RDS instance and the S3 bucket — DeletionPolicy: Delete permanently destroys the RDS database (unless DeleteAutomatedBackups/snapshot is set) and fails or deletes the bucket.
- C. Set DeletionPolicy: Snapshot on S3 and DeletionPolicy: Delete on RDS — AWS::S3::Bucket does not support DeletionPolicy: Snapshot (only Delete, Retain, or RetainExceptOnCreate).
- D. Set UpdateReplacePolicy: Delete with no DeletionPolicy on either resource — Omitting DeletionPolicy defaults to Delete when the stack is deleted.
More Deployment questions
- A developer is writing a buildspec.yml file for AWS CodeBuild that compiles a Node.js TypeScript service, runs unit…
- You are deploying an application to Amazon EC2 instances using AWS CodeDeploy (in-place deployment). Inside the root…
- A serverless team uses AWS SAM (template.yaml) and AWS CodeDeploy to deploy a new version of an AWS Lambda function…
- An application runs on AWS Elastic Beanstalk across a fleet of 6 EC2 instances behind an Application Load Balancer…
- In an AWS CloudFormation template, Stack A (NetworkStack) creates a production VPC and wants to export the VpcId so…
AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.