amazon-ec2-image-builder

Creates and automates custom AMI and container image builds with EC2 Image Builder.

2.5k|282|Updated Apr 23, 2026
One-click install
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill amazon-ec2-image-builder
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: amazon-ec2-image-builder
Source: https://github.com/aws/agent-toolkit-for-aws/tree/main/skills/specialized-skills/ec2-skills/amazon-ec2-image-builder
Command: npx skills add https://github.com/aws/agent-toolkit-for-aws --skill amazon-ec2-image-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building and maintaining custom AMIs and container images manually is error-prone and hard to keep patched. This Skill guides AI agents through the full EC2 Image Builder workflow — IAM roles, components, recipes, pipelines, distribution, and troubleshooting — so image builds are automated, repeatable, and correctly configured.

Core Features & Use Cases

  • End-to-end image creation: Build Linux, Windows, and macOS AMIs or Docker container images to ECR, from the build IAM role through recipes and infrastructure configuration.
  • Golden AMI automation: Set up recurring scheduled pipelines that pick up base-image updates and patches, with launch template and SSM parameter distribution so Auto Scaling groups roll onto new AMIs automatically.
  • Build failure diagnosis: Troubleshoot failed builds using stage-aware failure mapping, CloudWatch log analysis, and live debugging on kept build instances.
  • Use Case: A platform team needs a hardened Amazon Linux 2023 golden AMI rebuilt weekly with the latest patches and published to a launch template. The Skill walks through creating the build role, recipe with Amazon-managed components, and a scheduled pipeline with distribution — no manual AMI updates needed.

Quick Start

Ask the agent to create an EC2 Image Builder pipeline that builds a patched Amazon Linux 2023 AMI every week and updates your launch template.

Frequently Asked Questions about amazon-ec2-image-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a custom AMI with EC2 Image Builder?▼

Create a build IAM role with the EC2InstanceProfileForImageBuilder and AmazonSSMManagedInstanceCore managed policies, choose components, create an image recipe with a parent image, then run create-image with an infrastructure configuration. For one-off builds no pipeline is needed.

How do I automate golden AMI patching with Image Builder?▼

Create an image pipeline with a cron schedule and the EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE start condition, using a wildcard x.x.x parent image reference. Each scheduled run picks up new base-image releases, and launch template distribution rolls Auto Scaling groups onto the new AMI.

Can EC2 Image Builder build Windows, macOS, or container images?▼

Yes. Windows uses ExecutePowerShell components and exit code 3010 for reboots, macOS requires an EC2 Mac Dedicated Host with tenancy host placement, and container images use a container recipe targeting an ECR repository with the ECR container builds managed policy on the build role.

Why did my Image Builder build fail and where are the logs?▼

Check image.state.reason from get-image to identify the failed stage. Component failures are only visible in the CloudWatch log group /aws/imagebuilder/<image-name>, which contains full command stdout and stderr from the build.

Why does my scheduled Image Builder pipeline never run?▼

Pipelines only run at cron times, and the dependency-updates start condition requires update-detectable references like wildcard x.x.x versions or readable ssm: parameters. A recipe pinned to a hardcoded AMI ID never registers an update, so the pipeline skips every scheduled run.

When should I not use EC2 Image Builder?▼

Image Builder is not for launching instances from existing AMIs, AMI lifecycle or retirement management, or VM/ISO image import and export. Those tasks belong to general EC2 fleet management or the AWS documentation directly.