Quickly Restoring Deleted Script in S3 Bucket: A Guide for AWS DevOps Engineers

Restoring Deleted Script in S3 Bucket

Prev Question Next Question

Question

You use CloudFormation templates to deploy web applications on EC2 instances.

During initialization, the applications download Bash scripts from an S3 bucket to install the necessary dependencies.

The S3 bucket has enabled versioning.

One day, the web applications failed to launch because a script in the S3 bucket has been mistakenly deleted by a new hire.

The script is very old and no one has a backup.

How would you quickly restore the script in the S3 bucket?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: C.

Option A is incorrect because with this method, you have to change all CloudFormation templates.

You can simply undelete the S3 object by removing the delete marker.

Option B is incorrect because similar as.

Option A, CloudFormation templates have to be modified.

You should restore the S3 object by deleting the delete marker.

Option C is CORRECT because by deleting the delete marker, the object is restored and EC2 instances can fetch the object successfully.

The following is an example of deleting the delete marker:

Option D is incorrect because if the S3 bucket has enabled versioning, all versions of objects remain in the bucket even if you delete them.

Reference:

https://docs.aws.amazon.com/AmazonS3/latest/user-guide/undelete-objects.html
Delete objects

A\ Deleting the specified objects can't be undone.

Learn more [4

Specified objects

Q 1

Name a Version ID Type Last modified Size

Delete eens
ttt.txt ciaetteteeeeiiats 0B
a marker ee

Permanently delete objects?

To confirm deletion, type permanently delete in the field.

The correct answer to the question is A. In the Amazon S3 console, select the deleted object, download the previous version of the object and upload the downloaded file to the S3 bucket with another name. Modify the CloudFormation templates to use the new file.

Explanation: Amazon S3 (Simple Storage Service) is a highly available and scalable object storage service provided by AWS (Amazon Web Services). It provides an easy-to-use web interface to store and retrieve any amount of data from anywhere on the web. Amazon S3 supports versioning, which means that it can store multiple versions of an object.

In this scenario, the web application is downloading Bash scripts from an S3 bucket during initialization to install the necessary dependencies. The S3 bucket has enabled versioning, which means that it can store multiple versions of an object. One day, a new hire mistakenly deleted an old Bash script, and there is no backup available.

To quickly restore the script in the S3 bucket, we need to download the previous version of the object and upload it to the S3 bucket with another name. Then we need to modify the CloudFormation templates to use the new file.

Option A is the correct answer because it describes the correct procedure to restore the deleted object. We can use the Amazon S3 console to select the deleted object and download the previous version of the object. Then, we need to upload the downloaded file to the S3 bucket with another name. Finally, we need to modify the CloudFormation templates to use the new file.

Option B is not correct because modifying the CloudFormation templates to use the previous version of the deleted object by adding the previous version is not the correct procedure. We need to download the previous version of the object and upload it to the S3 bucket with another name.

Option C is not correct because choosing the "List versions" switch and selecting the deleted script and undeleting it by deleting the delete marker is not the correct procedure. We need to download the previous version of the object and upload it to the S3 bucket with another name.

Option D is not correct because deleted objects can be recovered or restored in an S3 bucket that has enabled versioning. When a versioned object is deleted, it becomes a delete marker that appears as a new version of the object. We can use the Amazon S3 console to select the delete marker and delete it to restore the previous version of the object. However, in this scenario, there is no backup available for the deleted Bash script, so we need to download the previous version of the object and upload it to the S3 bucket with another name.