AWS AMIs with Packer
Builds Amazon Machine Images with Packer's amazon-ebs builder from a ready HCL template, with source filters, multi-region copies, credentials and fixes for common build errors. Use when creating a custom AMI for EC2.
aws-ami-builder- Author
- HashiCorp
- Source
- hashicorp/agent-skills/plugins/packer/skills/aws-ami-builder @ 5e30fa5
- License
- MPL-2.0
About this skill
What it does
The skill is a short reference for building Amazon Machine Images with Packer's amazon-ebs builder. Its core is one complete HCL template: a packer block requiring the Amazon plugin ~> 1.3, a region variable, a timestamp local that keeps AMI names unique, a source "amazon-ebs" that picks the latest Ubuntu 22.04 image from Canonical's owner ID on a t3.micro, tags, and a build block with a shell provisioner that updates packages.
It adds a source filter for Amazon Linux 2023, copying the finished image to other regions with ami_regions, the order in which Packer finds AWS credentials (environment variables, ~/.aws/credentials, an instance profile on EC2), and the commands packer init, packer validate and packer build. Three common failures get a fix each: SSH timeouts (security group port 22, a subnet with internet access), an AMI name that already exists, and a root volume too small for the source image (launch_block_device_mappings). A note warns that builds cost money for EC2, EBS and data transfer and take 10 to 30 minutes. The folder holds only SKILL.md.
When to use it, and when not
Use it for a first Packer template for a Linux AMI, or when a build fails with one of the three errors above. You need the Packer CLI and AWS credentials that may launch instances.
The skill stops at the basics: no encryption settings, IAM permissions for Packer, Ansible provisioners or clean-up of old AMIs. Windows images, Azure images and the HCP Packer registry have their own skills in HashiCorp's packer plugin (windows-builder, azure-image-builder, push-to-registry), which our catalog does not list.
How to run it
We do not copy this skill: its files are under MPL-2.0, a file-level copyleft licence outside the set we copy under. Install it from HashiCorp's repository with the button to the source: one skill via npx skills add hashicorp/agent-skills/plugins/packer/skills/aws-ami-builder, or the whole packer plugin with four skills via claude plugin marketplace add hashicorp/agent-skills, then claude plugin install packer@hashicorp. In Codex: codex plugin marketplace add hashicorp/agent-skills, then install packer from /plugins and start a new session. In Claude Code, the plugin's skill may appear as /packer:aws-ami-builder.
- Claude Code:
/aws-ami-builder, or ask for the skill by name. - Codex:
$aws-ami-builder. - Cursor: type
/in the Agent chat and pickaws-ami-builder.
Example: /aws-ami-builder Write a Packer template for an Amazon Linux 2023 AMI with nginx installed, copied to eu-west-1.
How it differs from similar skills
The catalog has nothing else for Packer or virtual machine images. The nearest skills build containers: Dockerfile build strategies and Dockerfile review deal with multi-stage builds, layer caching and non-root users in Docker images, not machine images.
Install
This skill is not copied to the catalog: its licence allows a copy only under the same licence, and the catalog does not copy under such licences. Install it from the author's repository.
Connect through AnyModel API
This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.
AnyModel