I was banging my head against the wall (not quite literally, but it was close) trying to come up with a S3 lifecycle configuration from scratch. I needed a JSON file that I can run in a bash script, so I can apply the lifecycle rules to a few dozen S3 buckets. Obviously, trying to create one from scratch wasn’t the wisest choice in my part. As it turns out, you can setup a temporary bucket and use the console to recreate the lifecycle, then export the lifecycle JSON file. Duh! Genius! Here’s the command to export the lifecycle configuration.
AWS recently released a new S3 feature called Intelligent-Tiering. It’s designed to optimize storage costs automatically when data access patterns change, without performance impact or operational overhead. S3 Intelligent-Tiering delivers automatic cost savings by moving data between two access tiers, frequent access and infrequent access, when access patterns change. To activate, all you need to do create or edit your current S3 lifecycle.
If you have a ton of EC2 instances, one way to get results quickly is to run to use AWS CLI such as “describe-instances.” Here’s an example on how to get a list of instances with a tag name equal to some value. In addition, you limit the display only results you want displayed.