AWS EC2 Image Builder

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Search for a command to run...

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
What is AWS AMI? AWS AMI stands for Amazon Machine Image. It is a pre-configured virtual machine image used to create virtual servers (instances) in the Amazon Elastic Compute Cloud (EC2). It includes the necessary information to launch an EC2 instan...
The git log command is used to view the commit history of a Git repository. You can customize the output format to show specific details in a more readable or structured way. Below are some useful variations and formatting options for git log: To sh...

Overview This article will teach us how to: Install Ubuntu Server 24.04 on a laptop from scratch Install Ubuntu server by using Vagrant tool with ISO image Prerequisites: A laptop without any OS installed; A virtualization software Virtualbox t...

The /etc/passwd and /etc/shadow files are the backbone of Linux user management. Together, they store user account information and handle authentication securely. This article provides a hands-on guide to understanding these files, their structure, a...

In Linux, links are powerful tools that allow you to create references to files and directories. There are two main types of links: hard links and soft links (also known as symbolic links or symlinks). Understanding the differences between these two ...

A hostname is a human-friendly name given to a computer. It is a unique identifier that allows us to identify the machine in various network communications, making it easier to locate and manage devices. Type: hostname To see where it is stored, typ...

EC2 Image Builder is a fully-managed AWS service that makes it easy to build, customize and deploy OS images (AMIs) without writing scripts. It is a really useful tool that helps us to automate the process of building and updating AMIs, reducing the manual steps and potential for errors.

Pipelines: A pipeline in Image Builder defines the steps required to produce an image. A pipeline is composed of a source image, an infrastructure configuration, a build and test recipe, and an output AMI.
Recipes: These define the components and the tests that are applied to the source image. A recipe contains a list of components and the order in which they should be applied.
Components: These are sets of instructions that modify the source image. Examples include updating software or installing new tools.
Infrastructure Configuration: Specifies instance types, IAM roles, and other configurations needed during the build and test processes.
Automated Testing: After building an image, you can validate it with automated tests. This ensures that the image meets your requirements before it's used.
Distribution Settings: You can specify where the final AMI is distributed. This could be across multiple AWS regions or accounts.
Security: EC2 Image Builder can automatically ensure your images comply with specified AWS Identity and Access Management (IAM) policies, AWS Key Management Service (KMS) keys, and Amazon S3 bucket locations.
Integrations: EC2 Image Builder is integrated with AWS services like AWS Organizations, AWS Systems Manager, and AWS CloudFormation, among others.
Golden Images: You can use Image Builder to maintain "golden images" — these are standard, pre-configured images that serve as a baseline for launching EC2 instances.
Improve IT productivity:
Image Builder significantly reduces the effort of keeping images up-to-date and secure by providing a simple graphical interface, built-in automation, and AWS-provided security settings. With Image Builder, there are no manual steps for updating an image nor do you have to build your own automation pipeline. Not having to write and maintain automation code frees up resources and saves IT time.
Produce secure and up-to-date images:
EC2 Image Builder allows you to create images with only the essential components, reducing your exposure to security vulnerabilities. You can also apply AWS-provided or custom security policies to your images to meet applicable internal or industry-specific compliance criteria.
Simple image management for both AWS and on-premises:
EC2 Image Builder, in conjunction with AWS VM Import/Export (VMIE), allows you to create and maintain images for Amazon EC2 (AMI) as well as on-premises Microsoft Hyper-V (VHDX), VMware vSphere (VMDK), and Open Virtualization Format (OVF) virtual machines.
Built-in support for validation:
EC2 Image Builder allows you to easily validate your images for functionality, application compatibility, and security compliance with AWS-provided tests, AWS Inspector, and your own tests before using them in production. Doing so reduces errors found in images normally caused by insufficient testing that can lead to downtime. The deployment of AMIs to AWS regions can be made to depend on tests passing.
Centralized Policy Enforcement:
EC2 Image Builder enables version control for easy revision management. It integrates with AWS Resource Access Manager and AWS Organizations to enable sharing of automation scripts, recipes, and images across AWS accounts.
Integrated AWS Marketplace - new:
You can now subscribe to an image product from AWS Marketplace directly from the Image Builder console Image products. You can then use the subscribed AWS Marketplace image as the base image in an Image Builder recipe. The integrated Subscriptions tab shows all of the AWS Marketplace images that you currently subscribe to so that you can review and manage your subscriptions in one place. We also support automated image version upgrades in Image Builder based on the upgrades in your AWS Marketplace image.
In this hands-on lab, we will practice how to create an EC2 Image Builder.
Access EC2 Image Builder:
In the navigation pane, click on Image Builder under the "Images" section.

Create an Image Pipeline:
Click on "Create image pipeline". Enter a name for the pipeline and optionally, provide a description.


The recipe defines the components that get applied to the base images to create the desired configuration for the output image. After a recipe has been created, it cannot be modified. A new version must be created in order to change components.


Choose a Source Image: You can select an existing AWS-provided image or use one of your own AMIs. If required, specify an image version or use the latest one.




Specify the IAM role. Create an IAM role using the following policies: "AmazonSSMManagedInstanceCore" and "EC2InstanceProfileForImageBuilder" and name it "EC2ImageBuilderRole"


Choose an instance type that will be used to build the image.
Configure other settings like VPC, security groups, and subnets if necessary.


