EC2 Image Builder create/mount new EBS volumes

0

I would like to use EC2 Image Builder to create a Linux AMI with different partitions then what the AMI has. To do this I would need the original AMI and 2 additional EBS volumes.

As I understand the process Image Builder takes the starting AMI you provided and creates an instance. It then will install SSM on it and even AWS CLI. At that point I am guessing I can run an AWS CLI command to create 2 new EBS volumes and attach them to the instance.

Does this sound like it would work???

질문됨 7달 전673회 조회
1개 답변
1
수락된 답변

Hi,

It is definitely possible to have additional EBS volumes mounted as different partitions to the EC2 instance for the AMIs built using Image Builder.

For this, you can follow these basic steps, by referring to the documentation [1]:

  1. Set up EC2 Image Builder in your AWS account.
  2. Define a recipe that specifies the customizations you want to make to the base AMI.
  3. In your recipe, specify additional EBS volumes you want to attach to the instance during the customization process.
  4. Create a component that defines how the EBS volumes should be attached and configured on the instance.
  5. Use EC2 Image Builder to build a custom image.

This will launch an EC2 instance based on the selected base AMI, apply your customizations (including attaching the specified EBS volumes), and create a new AMI from that instance.
In case, you face difficulties, refer to [2] and [3].

References:
[1] https://docs.aws.amazon.com/imagebuilder/latest/userguide/manage-resources.html
[2] https://stackoverflow.com/questions/66171575/mounting-an-additional-ebs-volume-to-ami-with-ec2-image-builder
[3] https://serverfault.com/questions/1062962/how-to-create-ec2-ami-images-with-multiple-nitro-based-volumes-attached-correctl

Please let me know if this helps.

Thanks,
Atul

profile picture
답변함 7달 전
profile picture
전문가
검토됨 2달 전
  • Strangely I had looked at those 3 articles just before posting. They pretty much decided on my corses of action.

  • Great! It should work perfectly fine then. Thanks

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인