EC2 Skills
Skill 75 of 128
Creates and automates custom image builds with EC2 Image Builder - Linux, Windows, and macOS AMIs, and container images to ECR.
4 minutes · 900 words · 7 sections
Install
npx skills add aws/agent-toolkit-for-aws --skill amazon-ec2-image-buildernpx skills add aws/agent-toolkit-for-aws/plugin marketplace add aws/agent-toolkit-for-awsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
Domain expertise for building custom AMIs and container images with EC2 Image Builder — from the build IAM role through recipes, pipelines, distribution, and troubleshooting.
Works best with the AWS MCP server (opens in a new tab) — recommended for sandboxed execution and audit logging. All guidance also works with standard AWS CLI access.
This skill can be loaded two ways, and they resolve the skill’s own bundled files from different places. Determine how the skill was loaded before reading a reference or running a script:
retrieve_skill tool: The skill is not
installed on the local filesystem. You MUST fetch each reference or script
via retrieve_skill with the file parameter (e.g.
file="references/creating-images.md"), and use the returned content.
Do NOT file_read these paths locally — they do not exist on disk..kiro/skills/amazon-ec2-image-builder/ or
~/.claude/skills/amazon-ec2-image-builder/): Read files from the local
skill directory using relative paths.This distinction applies only to the skill’s own packaged files. User data and
session artifacts are always read from and written to the user’s working
directory. Never fetch or write user data through retrieve_skill.
Ask this before creating anything — it changes what you build.
| The user wants | Do this |
|---|---|
| One custom AMI, once | Follow creating-images.md (opens in a new tab) through step 7a: create-image with a recipe and infrastructure configuration — no pipeline needed. |
| A golden AMI that stays current (scheduled rebuilds that pick up base-image updates and patches) | An image pipeline: follow creating-images.md (opens in a new tab) — the schedule is part of the create-image-pipeline call (step 7b). |
| Use this skill | When the request is about |
|---|---|
| launching-ec2-instance-with-best-practices | Launching instances from an AMI the user already has |
| setting-up-ec2-instance-profiles | Instance profiles in general (not the build IAM role this skill creates) |
| aws-compute | AMI sharing, retiring, and lifecycle management; general EC2 fleet questions |
Not covered here: AMI lifecycle/retirement (route via the table above) and VM/ISO image import and export (follow the AWS documentation directly).
Read the matching reference before answering. The exact commands, failure fixes, and platform requirements live in the references — answering Image Builder questions from general knowledge is how agents get the details subtly wrong.
| User need | Read |
|---|---|
| Create an image or pipeline end to end: role, components, recipe, infrastructure, schedules, patching, scanning, chaining | creating-images.md (opens in a new tab) |
Get the output AMI where it’s needed: launch templates, SSM parameters (the service-linked role writes only under /imagebuilder/), other Regions | distribution-options.md (opens in a new tab) |
| A build failed, hangs, or an Image Builder API call errors | troubleshooting.md (opens in a new tab) |
| Windows (exit-3010 reboots), macOS (Mac Dedicated Hosts required), container images to ECR (extra build-role policy) | other-image-types.md (opens in a new tab) |
| Custom image workflows (advanced — always require an execution role) | custom-workflows.md (opens in a new tab) |
Reference files carry specific ARNs, Amazon-managed resource names, and service defaults — when precision matters, confirm against the AWS documentation.
--filters "name=name,values=Amazon Linux 2023 x86". Unquoted spaces are a CLI parse error.x.x.x wildcard, or an ssm: parameter reference where no managed image exists. Never list versions and sort them as strings — the list is not semver-ordered./aws/imagebuilder/<image-name> (on by default; also in the S3 logs if configured) — never in the API state. See troubleshooting.md (opens in a new tab).194 (Linux) or 3010 (Windows). The build re-runs that same step after the reboot — not the next step — so guard it with a marker file. A plain reboot command fails the step.get-image/get-image-pipeline, say you can’t find it and check the Region and credentials in use — then keep troubleshooting from the user’s description; a failed lookup is not proof the resource doesn’t exist.launchTemplateConfigurations, ssmParameterConfigurations) — never add Lambda glue or manual launch-template versions for AMI propagation.instanceMetadataOptions httpTokens=required), and at least two instance types in the infrastructure configuration. S3 build logging is opt-in — CloudWatch logging is on regardless.aws imagebuilder list-components --owner Amazon) before writing component YAML. Common needs (AWS CLI, OS updates, CloudWatch agent, STIG hardening) are already covered.The defaults above are the security posture: IMDSv2 required on build instances, no inbound security-group rules, least-privilege build IAM role (two managed policies for AMI builds plus only the scoped grants a workflow needs), no secrets in components or logs, and log buckets with Block Public Access. Build logs capture full command output that can carry sensitive material; CloudWatch Logs encrypts them at rest by default, and associating a customer-managed KMS key with each /aws/imagebuilder/... log group (aws logs associate-kms-key) is recommended. For auditing and operational visibility, enable CloudTrail in the account so Image Builder API calls are recorded, and configure EventBridge rules or CloudWatch alarms on build failures (source aws.imagebuilder, detail-type EC2 Image Builder Image State Change) so misconfigurations and unauthorized changes surface promptly. Per-build notifications are covered by the SNS topic option (creating-images.md step 6) — prefer a customer-managed key on that topic too. Deviations from these should be explicit user decisions. Reference: EC2 Image Builder security best practices (opens in a new tab).
Creates and automates custom image builds with EC2 Image Builder - Linux, Windows, and macOS AMIs, and container images to ECR. Covers the build IAM role, Amazon-managed and custom components, image recipes, infrastructure and distribution configuration (launch templates, SSM parameters, other Regions), one-off builds, recurring scheduled pipelines for golden AMI automation and OS patching, custom image workflows, and diagnosing failed builds. Applies when creating, automating, or scheduling AMI or container image builds with Image Builder, or when debugging a failed build. Not for launching instances from existing AMIs, AMI lifecycle/retirement, or general EC2 fleet management.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 22 September 2026.SKILL.md, not by matching a directory convention. 19 distinct layouts observed: plugins/aws-agents-for-devsecops/skills/*/SKILL.md, plugins/aws-agents/skills/*/SKILL.md, plugins/aws-core/skills/*/SKILL.md, skills/core-skills/*/SKILL.md, skills/specialized-skills/analytics-skills/*/SKILL.md, skills/specialized-skills/database-skills/*/SKILL.md, skills/specialized-skills/ec2-skills/*/SKILL.md, skills/specialized-skills/end-user-computing-skills/*/SKILL.md, skills/specialized-skills/messaging-and-streaming-skills/*/SKILL.md, skills/specialized-skills/migration-and-modernization-skills/*/SKILL.md, skills/specialized-skills/networking-and-content-delivery-skills/*/SKILL.md, skills/specialized-skills/operations-skills/*/SKILL.md, skills/specialized-skills/quantum-computing-skills/*/SKILL.md, skills/specialized-skills/resilience-skills/*/SKILL.md, skills/specialized-skills/security-and-identity-skills/*/SKILL.md, skills/specialized-skills/serverless-skills/*/SKILL.md, skills/specialized-skills/storage-skills/*/SKILL.md, skills/specialized-skills/system-table-skills/*/SKILL.md, skills/specialized-skills/web-and-mobile-development/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Amazon Web Services, declaring 4 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./aws/agent-toolkit-for-aws.md, and each skill at its own .md URL.5 files · 49 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 75.
Documentation the agent loads on demand, rather than up front.