Search code examples
amazon-web-servicesamazon-ec2amazon-amiamazon-ebs

Reducing costs on AMI snapshots


I am starting with AWS EC2 and I wanted to be able to spawn EC2 instances on-demand with some scripts ready to run and the necessary packages installed. I know that maybe using containers would be a good option, but this is not possible for now.

I have created a Lambda that creates an EC2 instance from a custom AMI where everything is installed. However, I would like to keep the EBS snapshot consumption to a minimum (below the Free Tier 1GB-month limit, preferably).

Is it possible to shrink my AMI's snapshot below the default 8GB? I also thought I could back my AMI in S3 instead of EBS storage, but further Googling seems to have proven me wrong.

Any tips? Thanks!


Solution

  • AMIs can only be stored the way they are.

    Are there many? Do they differ? If they do not differ then use one AMI.

    If minor variations make a baseline ami and then use userdata for the variation