1. First Go to I AM section click on Roles. Create role select Ec2 and next.
2 policies are required to create ec2 image builder.
3.Select EC2InstanceProfileForImageBuilder and AmazonSSMManagedInstanceCore(this policy allow system manager to perform actions on instances create ec2 builder.)
4. Click continue without adding tags then name the role and click create role. (amazonLinuxImagebuilderRole).
5. Now roles is Create lets navigate to ec2 image builder to create a image pipeline.
6. Create image pipeline(The image pipeline in Image Builder defines all aspects of the process to customize images. It consists of the image recipe, infrastructure configuration, distribution, and test settings.)
7. For this case we use Amazon Linux for image operation system. Lets choose the image for latest version.
8. You can create component to add to image recipe.
9. For this example we gona use 2 build component(docker-ce-linux, Version: 1.0.0) (amazon-corretto-8-jre, Version: 1.0.0)
10. Test case select (simple-boot-test-linux | Version 1.0.0)
11. Give Name to pipeline - Ec2ImagebuiderPipeLine
12. Select Iam role which we created earlier to associate to instance profile.
13. Select Schedule builder, Schedule the pipeline weekly every monday 12 o'clock. (optional)If you want you can select SNS services for reciving notification regarding piplines.
14. Provide name of AMI.(AmazonLinuxImage). review your setting and create pipeline. After this the pipeline has been created.
15. You needs executes the pipline manually by clicking on action and run pipeline. Now you can see pipeline is executed.
16. Lets Look at ec2 console page
17. Building instance is started then refresh the page after this you Test Instance is instance started
18. Again refresh the page, In last both tested and terminated
19. Check if Image is avaivable or not.
20. Image can also be found in AMI page for future uses.
We provide best AWS training classes in Gurgaon and Delhi. For more information about the course please call at +91 7289908088