AWS S3 Bucket Versioning and Lifecycle Policies

Configure S3 Lifecycle Policies for Cost Reduction

Question

You have an S3 bucket that has enabled versioning.

The S3 bucket is used to store testing files.

In order to reduce costs, you need to configure S3 lifecycle policies to transit both current and previous versions of objects from standard to One Zone-IA after 60 days.

How would you configure it?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: C.

Option A is incorrect because S3 does not transit all the versions of objects automatically.

Users need to decide whether to transit current versions or previous versions.

Option B is incorrect because, with the option, the objects will be deleted with a delete marker after 60 days, which is not as expected.

Option C is CORRECT because users need to add two lifecycle rule actions for the current and previous versions of objects.

Option D is incorrect because S3 lifecycle policies can work with an S3 bucket that has enabled versioning and modify the storage class for the previous versions of objects.

Reference:

https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html

The correct answer for this question is option C: Configure a lifecycle rule action to transit current versions of objects after 60 days. Configure another lifecycle rule action for the previous versions of objects after 60 days.

Explanation:

Amazon S3 provides a feature called S3 lifecycle policies that can automatically move objects between different storage classes or delete them after a specified period of time. With versioning enabled, S3 stores multiple versions of each object, which can result in increased storage costs over time. By configuring a lifecycle policy to transition objects from the standard storage class to the One Zone-IA storage class after 60 days, you can reduce storage costs while still retaining access to the objects.

Option A is incorrect because it only applies the lifecycle policy to the current version of objects, not previous versions. This means that previous versions would remain in the standard storage class, resulting in higher costs.

Option B is incorrect because it only applies a lifecycle policy to expire current versions of objects, and then applies another policy to change the storage class for previous versions. This would result in the loss of previous versions after 60 days, which is not desirable for a testing environment where historical versions may be needed.

Option D is incorrect because S3 lifecycle policies can transit previous versions of objects for versioning-enabled S3 buckets.

Therefore, option C is the correct answer because it applies a lifecycle policy to both current and previous versions of objects, ensuring that all versions are transitioned to the One Zone-IA storage class after 60 days.