AWS Compute Blog
Streamlining AMI creation with EC2 Image Builder components in AWS Marketplace
This post is written by Smriti Ohri, Senior Product Manager, EC2 and Omar Chehab, Senior Product Manager, AWS Marketplace.
At re:Invent 2024, Amazon Web Services (AWS) announced the availability of third-party EC2 Image Builder components in AWS Marketplace. EC2 Image Builder is a fully managed service that streamlines the customization, testing, distribution, and lifecycle management of images. You can use this new feature to procure third-party components from AWS Marketplace directly on the EC2 Image Builder console and in the AWS Marketplace website. You can add multiple of these components to create your golden images.
A golden image is a customized and pre-configured Amazon Machine Image (AMI) needed for launching Amazon Elastic Compute Cloud (Amazon EC2) instances. It includes a standardized set of software, configurations, and security settings that meet an organization’s specific requirements, promoting consistency and efficiency across all EC2 instances.
EC2 Image Builder provides Amazon managed components, and you can build your own components that help when building custom images. However, you may need third-party software to build your golden images. Procuring this software can be time-consuming and necessitates custom setup. This integration aims to address these challenges by providing the ability to add third-party software from AWS Marketplace directly while creating golden images using EC2 Image Builder. While creating the image, you can customize your image recipe to use the latest version of components published in AWS Marketplace and make sure that you always remain up to date.
This post shows you how to find, subscribe to, and incorporate components from AWS Marketplace using the EC2 Image Builder console.
Prerequisites
You must have access to subscribe to a product in AWS Marketplace. Check AWS Marketplace subscription permissions.
Solution overview
Three high-level steps are involved in using the third-party component from AWS Marketplace in EC2 Image Builder:
- Discover and subscribe to the third-party component on the EC2 Image Builder console.
- Build the golden image with the third-party component.
- Launch the EC2 instance using the golden image.
Solution walkthrough: Streamlining AMI creation with EC2 Image builder components in AWS Marketplace
To perform the solution, go through the steps in the following sections.
Discover and subscribe to a component by Cribl
To discover and subscribe to the component, follow these steps:
- On the EC2 Image Builder console, in the navigation pane, choose Discover products. On the Components tab, you can view the list of available AWS Marketplace image products and the associated components. As shown in the following screenshot, choose View subscription options, which shows the different pricing offered.
Figure 1: Discover components on EC2 Image Builder console
- To subscribe to the product, from the dropdown menu choose the available offers and choose Subscribe, as shown in the following screenshot. You can now start using the associated component in your image recipe.
Figure 2: Subscribe to the product that has the component
Build the golden image with the third-party component
To use the component, you can either subscribe to it first, or you can create the pipeline and subscribe to the component later based on your preference. For this walkthrough, I already subscribed to the component. The following section shows how to create a pipeline to build a custom AMI using the component to which I subscribed. You can follow a similar process to install other components to create your golden AMIs. The high-level steps are:
- Create the recipe.
- Create the pipeline.
To create the recipe, follow these steps:
- On the EC2 Image Builder console, choose Image recipes and Create image recipe. A recipe has a base image and the components that you want to install on it.
For this example, Amazon Linux was chosen as the base image operating system and “Amazon Linux 2023 x86” as the image name.
- In the Build components section, choose Add build components and, from the dropdown, choose AWS Marketplace. Search for the component to which you subscribed and choose Add to recipe, as shown in the following screenshot.
You can choose to use the latest version or a specific version of the component. For this walkthrough, the latest available version was selected.
Figure 3: Create recipe and add components from AWS Marketplace
To create the pipeline, an automation configuration (where you define the infrastructure configuration), image workflows, and distribution configuration, follow these steps:
- On the EC2 Image Builder console, choose Image pipelines and Create image pipeline. Provide the name of the pipeline and choose a Build schedule. You can also enable scanning, which scans your AMIs for Common Vulnerabilities and Exposures (CVEs) using Amazon Inspector.
For more information, refer to Amazon Inspector integration in Image Builder in the EC2 Image Builder User Guide. For this example, image scanning is enabled and the option to manually trigger the pipeline was selected.
Figure 4: Create the pipeline with the recipe and other configurations
- Choose the recipe you created with third-party components from AWS Marketplace.
- Choose the image workflows for the image creation process and define infrastructure configurations for creating the image.
You can choose Dedicated Host, Dedicated Instance, or Shared Tenancy. By default, it uses Shared Tenancy. For this example, the default configuration was selected. I chose the c5.large instance type since that is the supported instance type for this component.
Figure 5: Select the supported instance type in the infrastructure configurations
- Provide the distribution configuration details to share or copy the output image to other accounts and in other AWS Regions.
To allow these accounts to use any component from AWS Marketplace, you must share license entitlements with these accounts using AWS License Manager. Instructions for sharing license entitlements are outside the scope of this post. To learn more, refer to Associating licenses with AMI based products using AWS License Manager.
- Choose the pipeline that you created and choose Run pipeline. After a while, the image is created and ready to use.
Run the EC2 instance using the golden image
Create an EC2 instance with the output golden image. You can also view the product code stamped on the AMIs, as shown in the following figure.
Figure 6: View the output image to check the product code
Conclusion
This feature helps you save time and automate the process of using the latest versions of the software. With this integration, you get a diverse set of software components from verified sellers in AWS Marketplace to address the monitoring, security, governance, and compliance needs of your organization. You can learn more about these components in the documentation. Visit AWS Marketplace to view all supported EC2 Image Builder components.
If you’re an AWS Partner, then you can publish your software as components in AWS Marketplace to cater to your customers. To learn more about onboarding your software to AWS Marketplace, visit this blog post. You can reach out to aws-mp-ec2-ib@amazon.com if you have questions about this new feature or the publishing process.
Start building your custom AMIs using components from Marketplace today.