Skip to main content

How To Create a Lifecycle Policy for an S3 Bucket?

Why need lifecycle policies?

You can use lifecycle policies to define actions you want Amazon S3 to take during an object's lifetime (for example, transition objects to another storage class, archive them, or delete them after a specified period of time).

You can define a lifecycle policy for all objects or a subset of objects in the bucket by using a shared prefix (that is, objects that have names that begin with a common string).

A versioning-enabled bucket can have many versions of the same object, one current version and zero or more noncurrent (previous) versions. Using a lifecycle policy, you can define actions specific to current and noncurrent object versions. 


To create a lifecycle policy

1. Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/

2. In the Bucket name list, choose the name of the bucket that you want to create a lifecycle policy for. 


3. Choose the Management tab, and then choose Add lifecycle rule.


4. In the Lifecycle rule dialog box, type a name for your rule to help identify the rule later. The name must be unique within the bucket. Configure the rule as follows:
  • To apply this lifecycle rule to all objects with a specified name prefix (that is, objects with names that begin with a common string), type a prefix in the box, choose the prefix from the drop-down list, and then press Enter. For more information about object name prefixes, see Object Keys in the Amazon Simple Storage Service Developer Guide. 

  • To apply this lifecycle rule to all objects with one or more object tags, type a tag in the box, choose the tag from the drop-down list, and then press Enter. Repeat the procedure to add another tag. You can combine a prefix and tags. For more information about object tags, see Object Tagging in the Amazon Simple Storage Service Developer Guide. 
  
  • To apply this lifecycle rule to all objects in the bucket, choose Next.
5. You configure lifecycle rules by defining rules to transition objects to the Standard-IA, One Zone-IA, and Glacier storage classes. For more information, see Storage Classes in the Amazon Simple Storage Service Developer Guide.

You can define transitions for current or previous object versions, or for both current and previous versions. Versioning enables you to keep multiple versions of an object in one bucket. For more information about versioning, see How Do I Enable or Suspend Versioning for an S3 Bucket?.

    a. Select Current version to define transitions that are applied to the current version of the object.

       Select Previous versions to define transitions that are applied to all previous versions of the object. 
   
    b. Choose Add transitions and specify one of the following transitions:
  • Choose Transition to Standard-IA after, and then type the number of days after the creation of an object that you want the transition to be applied (for example, 30 days).
  • Choose Transition to One Zone-IA after, and then type the number of days after the creation of an object that you want the transition to be applied (for example, 30 days).
  • Choose Transition to Glacier after, and then type the number of days after the creation of an object that you want the transition to be applied (for example, 100 days).
     Important
     Amazon S3 stores the archived objects in Glacier. However, these are Amazon S3 objects, and you can access them only by using the Amazon S3 console or the Amazon S3 API. You cannot access the archived objects through the Glacier console or the Glacier API. For more information, see Transitioning Objects: General Considerations.




6. When you are done configuring transitions, choose Next.

7. For this example, select both Current version and Previous versions

8. Select Expire current version of object, and then enter the number of days after object creation to delete the object (for example, 395 days). If you select this expire option, you cannot select the option to clean up expired delete markers.

9. Select Permanently delete previous versions, and then enter the number of days after an object becomes a previous version to permanently delete the object (for example, 465 days).

10. It is a recommended best practice to always select Clean up incomplete multipart uploads. For example, type 7 for the number of days after the multipart upload initiation date that you want to end and clean up any multipart uploads that have not completed. For more information about multipart uploads, see Multipart Upload Overview in the Amazon Simple Storage Service Developer Guide.

11. Choose Next.




12. For Review, verify the settings for your rule. If you need to make changes, choose Previous. Otherwise, choose Save.

13. If the rule does not contain any errors, it is listed on the Lifecycle page and is enabled.

 Thanks for being here : Need help for Create Lifecycle Policy.

Comments

Popular posts from this blog

Apt-fast for Increasing Download Speed while Installing and Updating Packages Ubuntu/Debian [Beginners Guide]

Have you ever experienced slow download speed when downloading or updating packages in Ubuntu even when your network connection is running fine? You encounter this issue especially when updating and installing packages for the first time after installing a new Ubuntu/Debian OS. However, there is a way to get around this by speeding up the download speed using apt-fast command in Linux. Apt-fast is a shell script wrapper for “apt-get” and “aptitude” that uses the power of either  axel  or  aria 2  download managers to accelerate the download process. It improves download performance by downloading packages simultaneously in parallel with multiple packages per connection. In this article, we will walk through some steps to install apt-fast in order to accelerate the update and downloading process in Ubuntu. We will use Ubuntu 18.04 LTS for describing the procedure mentioned in this article.   Step 1: Installing prerequisites We need to install...

How To Install PHP 7.4 and PHP 7.3 ON Ubuntu 18.04/19.04/16.04

How to Install PHP 7.4 / PHP 7.3 on Ubuntu?. This guide will help you Install PHP 7.4 / PHP 7.3 on Ubuntu 18 / Ubuntu 16 /  Ubuntu 19 . PHP is an open-source server-side scripting language which has been widely adopted for the creation of dynamic web pages. PHP is secure, fast, simple, efficient, flexible and a loosely typed scripting language. The PHP release 7.4.0 has been made available for the general public and for use in Production environments. How to install PHP 7.4 on Ubuntu 18.04 / Ubuntu 19.04 / Ubuntu 16.04 Step 1: Add PHP 7.4 PPA Repository We’ll add ppa:ondrej/php PPA repository which has the latest build packages of PHP. sudo apt-get update sudo apt -y install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update Step 2: Install PHP 7.4 on Ubuntu 18/ Ubuntu 19/ Ubuntu 16 Install PHP 7.4 on Ubuntu 18.04/19.04/16.04 using the command: sudo apt -y install php7.4 Check version inst...

What is a CDN ? How Does a content delivery network Work?

I ntroduction. Latest Web sites and applications often need to provide   amount of static content to end users. This content includes images, style sheets, JavaScript, and video. The increase in the number of static assets and the increase grows the bandwidth usage increases page load time decreased, depending on the size of the user's search experience, and reduce the usable capacity of the server. Dramatically improving performance, reducing the page load time   reduce the bandwidth and infrastructure costs, you can implement a content delivery network,  And  CDN cache these assets at a set of servers that are geographically distributed. What is a CDN? Content delivery network is a group of servers distributed geographically optimized to provide static content to end users. While this static content can be almost any type of data, CDNs are most commonly used to deliver web pages and related files, streaming video and audio, and large softwar...