Protecting Data on EBS Volumes from Accidental Terminations - Best Practices and Solutions

Preventing Accidental Terminations and Ensuring Data Integrity on AWS EBS Volumes

Prev Question Next Question

Question

You are working for a data management company which uses AWS platform to manage the data for various customers.

They are using AWS EBS backed EC2 instance with “Delete EBS volume on termination” checked.

EC2 instances are used to run datastreamingapplicationwhich generates logs and are stored on EBS volumes.

The log files are critical for auditing purposes.

How would you protect the data stored on EBS volumes from accidental terminations of EC2 instances?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer: B.

You can back up the data on your Amazon EBS volumes to Amazon S3 by taking point-in-time snapshots.

Snapshots are incremental backups, which means that only the blocks on the device that have changed after your most recent snapshot are saved.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-lifecycle.html
Deleting an Amazon EBS Volume

After you no longer need an Amazon EBS volume, you can delete it, After deletion, its data is gone and the volume can't be attached to any instance. However, before
deletion, you can store a snapshot of the volume, which you can use to re-create the volume later.

To delete a volume, it must be in the available state (not attached to an instance). For more information, see Detaching an Amazon EBS Volume from an Instance.

The correct answer is B. Setup a Data Lifecycle Manager policy scheduler to create EBS snapshots for your EBS volumes.

Explanation:

In this scenario, the customer is using AWS EBS-backed EC2 instances with the "Delete EBS volume on termination" option checked. This means that when an EC2 instance is terminated, the associated EBS volume will also be deleted. However, the log files generated by the data streaming application are critical for auditing purposes and must be protected from accidental terminations.

Option A suggests creating a daily EBS snapshot of every EBS volume automatically by AWS. While this would create a backup of the data, it is not a reliable solution to prevent accidental terminations. If an EC2 instance is terminated before the scheduled snapshot is taken, then the data would still be lost.

Option C suggests that when an EC2 instance is terminated, it automatically creates a snapshot of the associated EBS volume and then deletes the EBS volume. However, this is not true. When an EC2 instance is terminated, the associated EBS volume is deleted without creating a snapshot.

Option D suggests writing a custom script on the EC2 instance to back up the data onto AWS S3. While this would create a backup of the data, it is not a reliable solution to prevent accidental terminations. If the EC2 instance is terminated before the backup script can run, then the data would still be lost.

Option B suggests setting up a Data Lifecycle Manager policy scheduler to create EBS snapshots for the EBS volumes. This is the correct solution to protect the data stored on the EBS volumes from accidental terminations. Data Lifecycle Manager is a service that allows you to create automated policies to manage the lifecycle of your AWS resources. You can create a policy to take EBS snapshots of the EBS volumes at regular intervals and retain them for a specified period. This way, even if an EC2 instance is terminated, the data on the EBS volume is protected by the snapshot, which can be used to restore the data in case of accidental terminations.

Therefore, the correct answer is B. Setup a Data Lifecycle Manager policy scheduler to create EBS snapshots for your EBS volumes.