Skip to main content
EC2 Image Builder orchestrates AMI and container-image production from declared inputs. For AMIs, it launches temporary EC2 infrastructure, applies components, creates an image, tests it separately, and distributes the approved result. Updated October 9, 2026. Image Builder coordinates ordinary AWS resources; resulting AMIs and EBS snapshots belong to your account.

The configuration model

Components use AWS Task Orchestrator and Executor documents. Ordering matters because Image Builder applies components in recipe order. Recipes use semantic versions and cannot be overwritten. Wildcard references can resolve newer dependencies during later runs. Pin exact versions when auditability matters more than automatic updates. A versioned recipe is reproducible only when its base image, components, and external artifacts are also pinned.

The AMI build and test flow

  1. Image Builder resolves the recipe and configurations.
  2. It launches a temporary build instance from the base AMI.
  3. AWSTOE runs build components.
  4. Image Builder creates an intermediate AMI.
  5. If tests are enabled, it launches a separate instance from that AMI.
  6. Test components verify the image after boot.
  7. A successful image enters distribution.
  8. Temporary instances terminate; AMIs, snapshots, and logs remain.
Build and test instances are disposable execution hosts, not the final machines serving traffic. The separation catches failures that appear only after boot. Tests should verify service startup, package versions, permissions, networking assumptions, and health. Build instances have real network and IAM reach. Place them in deliberate subnets, restrict egress, and give the instance profile only required permissions.

Hardening without false certainty

Image Builder automates hardening but does not certify an AMI as universally safe. AWS-managed components can apply updates, custom components can enforce controls, and Amazon Inspector can scan supported images. Treat components as privileged code. Pin external artifacts by digest or verified version, validate signatures or checksums, remove transient credentials and caches, and never bake reusable secrets into the image. Hardening combines a trusted base, reviewed components, constrained permissions, explicit tests, findings, and controlled distribution.

Distribution and promotion

Distribution configurations can copy AMIs to Regions, grant launch permissions, set names, and update launch templates. Cross-Region copies create distinct AMIs and snapshots. Build once, retain the artifact, and promote the same output after validation. Rebuilding from moving inputs creates another artifact and should be treated as another release. Distribution copies an approved artifact; it does not make quotas or runtime dependencies identical across Regions.

Logging and failure evidence

Image Builder can send pipeline logs to CloudWatch Logs and component output to S3. EventBridge exposes state changes, and SNS can notify outcomes. A pipeline status is only a summary. Component logs and underlying EC2, Systems Manager, IAM, Inspector, S3, and ECR events explain failures. Set explicit retention. Output AMIs and snapshots do not disappear because a pipeline is disabled or deleted.

Cost boundaries

Image Builder itself has no additional service charge. Standard charges apply to temporary EC2 instances, EBS, snapshots, S3 logs, ECR, Inspector, and data transfer. Cross-Region copies multiply snapshot storage. A stopped pipeline costs nothing to orchestrate, but retained images, snapshots, logs, and layers continue accruing charges. Right-size builders, shorten builds, set log retention, remove superseded artifacts, and distribute only where needed.

Frequently asked questions

No. Image Builder produces new AMIs or container images. Replacing running instances is a separate deployment concern handled by an Auto Scaling group, launch template rollout, instance refresh, or another system that consumes the new image.
Not always. Recipes preserve declared configuration, but wildcard versions and external repositories can move. Pin exact components and artifacts, record resolved inputs, verify downloads, and retain the resulting AMI rather than rebuilding it for promotion.
Output AMIs, backing EBS snapshots, Regional copies, configured logs, and published container images remain. Temporary build and test instances terminate. Lifecycle automation must remove superseded artifacts without deleting versions still referenced by deployments.

Sources and further reading

Last modified on October 8, 2026