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

How to Speedup your WordPress site with Amazon CloudFront.

Introduction A WordPress performance is quite excellent . The number of WordPress plugins to handle performance is such evidence. But the easiest way to improve your user experience is to accelerate the entire WordPress website using CloudFront. This will help you not only improve site response time reduces the necessary infrastructure, reducing the load on the Web server, so you can reduce the total cost of the infrastructure works WordPress. CloudFront is actually a site can greatly help your site to respond to unexpected load when gained popularity. Today this post is to clarify the method of providing a reasonable standard configuration on the WordPress website or blog. How does CloudFront help? Amazon CloudFront is to improve the user's experience accessing the Web site in several ways: 1.  Anycast DNS is to ensure that customers are routed to the nearest edge location. 2.  The cached content is available to users at the edge position (i

Linux System : Free Employee Monitoring with Automatic Screenshots

Introduction :   A utomatic screen-shots  of Linux system directly import  on your web server with Linux samba server service and scrot command. 1)  Setup web panel UI on your web server :   Get web panel PHP/HTML code from Github URL: https://github.com/raj412/Employee-Monitoring-for-Linux-System It’s work in Linux server LAMP environment(no need database for this configuration ) Defult login username password is admin/1234. You can change username/passwrod from login.php file in line number #6 Login Page : Dashboard : Screenshot Page : 2)  Samba server configuration on web server : I.  Install Samba on your server where you setup Linux screenshot log system web panel. sudo apt-get update sudo apt-get install samba II.  Set a password for your user in Samba sudo smbpasswd -a <user_name> III.  Share gallery-images folder from you web panel. This is my web panel gallery-images p

How to control high traffic load on Apache servers : optimization performance of APACHE2 & PHP-FPM

Everyone handle high traffic loads  on Apache server. During down-time they forget to check server memory . Apache not used lot of memory  still server not responding. All time we restart Apache service and all things will start working good. I also faced same issue numerous time and all-time  used same solution : Restart Apache. After lots of research and reading found one solution. In this blog you see step-by-step guide to apache2 performance settings. System environment: Intel(R) Xeon(R) CPU 3.10GHz, 4 cores | 8GB RAM Ubuntu 16.04 Apache2 version using mpm_event PHP FPM (5.6,7.1) First,  Calculate process size : Download : python script file “ps_mem.py” from Github Open this and ps_mem.py file upload on you server :  https://github.com/raj412/ps_mem chmod a+x ps_mem.py sudo python ps_mem.py Output like this:  See here : 12 Apache processes, consuming a total of  35.7MiB, so each Apache process is using roughly 3MiB of RAM. The 42 php-fpm process u