Preserving EBS Volumes on Termination | AWS SysOps Administrator - Associate Exam

Preserving EBS Volumes on Termination

Question

Your company has a set of EC2 Instances.

There is a requirement to ensure that all EBS volumes, both root and data, must be preserved even after the instance is terminated.

How can you achieve this?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: D.

The AWS Documentation mentions the following.

When an instance terminates, Amazon EC2 uses the value of the DeleteOnTermination attribute for each attached Amazon EBS volume to determine whether to preserve or delete the volume.

By default, the DeletionOnTermination attribute for the root volume of an instance is set to true.

Therefore, the default is to delete the root volume of an instance when the instance terminates.

Options A and C are incorrect since these are used for the EC2 Instance.

For more information on terminating instances, please refer to the below URL-

https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/terminating-instances.html
Volume Type (7) Device () ‘Snapshot (7) Size (GiB) @) Volume Type (7) lops @) pe Delete on Termination Encrypted (7)
Root Idevisdat ‘snap-02196F418507¢9598. {ro ] [General Purpose SSD (gp2) 1400/3000 N/A re Not Encrypted
EBS al [Idevisdb ¥ | [Search (case-insensit] fs ] [General Purpose SSD (gp2) 4100/3000 N/A a Not Encrypted

Add New Volume

To ensure that all EBS volumes, both root and data, are preserved even after the EC2 instance is terminated, we need to configure the appropriate settings for both the instance and its attached volumes.

Option A - Set the DisableApiTermination attribute on the EC2 Instance to True:

This option is incorrect, as setting the DisableApiTermination attribute to true will prevent the instance from being terminated, but it will not preserve the attached EBS volumes.

Option B - Set the DeletionOnTermination attribute for the volumes to True:

This option is incorrect, as setting the DeletionOnTermination attribute to true will result in the attached EBS volumes being deleted when the instance is terminated, which is the opposite of what we want.

Option C - Set the DisableApiTermination attribute on the EC2 Instance to False:

This option is incorrect, as setting the DisableApiTermination attribute to false will allow the instance to be terminated, but it will not preserve the attached EBS volumes.

Option D - Set the DeleteOnTermination attribute for the volumes to False:

This option is correct, as setting the DeleteOnTermination attribute to false for all attached EBS volumes will ensure that they are preserved even after the instance is terminated. This can be done during instance launch or through the EC2 console or CLI by modifying the volume's settings.

Therefore, the correct answer is D - Set the DeleteOnTermination attribute for the volumes to False.