0

Is there any way that we can create AWS AMI from the set of defined steps/instructions like Dockerfile?

I usually create the AMI from the running EC2 instance. The problem is that anything inside that AMI is quite hidden. It's hard to tell the team how the AMI was built and what libs and/or programs have been installed on the AMI. We have to maintain a separate document to describe what has been done on the AMI. And the changes between each AMI version are also not transparent. We have to document everything to achieve that.

I wouldn't have to write the AMI document if it can be done like in the Dockerfile. It's self-documented for developers about that image.

Turbo
  • 548
  • 5
  • 13
  • packer, usually – anthony sottile Aug 28 '21 at 02:53
  • or, use an infrastructure as code platform like [teraform](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ami) or [pulumi](https://www.pulumi.com/docs/reference/pkg/aws/ec2/ami/) – Michael Delgado Aug 28 '21 at 05:15
  • @MichaelDelgado Thank you for pointing me out. I just realized that this can also achieve using Cloudformation as well. https://stackoverflow.com/questions/21431450/create-ami-image-as-part-of-a-cloudformation-stack – Turbo Aug 28 '21 at 05:44
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Aug 31 '21 at 10:57

1 Answers1

0

Putting the "user data" of Ec2 in Cloudformation doesn't quite the right solution for me. It's still rerun the process every time I launch the EC2 instance.

I just came across one service called "Image builder" which is exactly what I want. It also provides a way that we can test the image as well. https://aws.amazon.com/image-builder/

Turbo
  • 548
  • 5
  • 13