aws-ami-builder
Build Amazon Machine Images (AMIs) with Packer using the amazon-ebs builder. Use when creating custom AMIs for EC2 instances.
By hashicorp · 2,805 installs
npx skills add hashicorp/agent-skills --skill aws-ami-builder
Source repository · Upstream listing
AWS AMI Builder
Build Amazon Machine Images (AMIs) using Packer's amazon ebs builder.
Reference: [Amazon EBS Builder](https://developer.hashicorp.com/packer/integrations/hashicorp/amazon/latest/components/builder/ebs)
Note: Building AMIs incurs AWS costs (EC2 instances, EBS storage, data transfer). Builds typically take 10 30 minutes depending on provisioning complexity.
Basic AMI Template
Common Source AMI Filters
Ubuntu 22.04 LTS
Amazon Linux 2023
Multi Region AMI
Authentication
Packer uses AWS credential resolution:
1. Environment variables: AWS ACCESS KEY ID , AWS SECRET ACCESS KEY
2. AWS credentials file: ~/.aws/credentials
3. IAM instance profile (when running on EC2)
Build Commands
Common Issues
SSH Timeout
Ensure security group allows SSH (port 22)
Verify subnet has internet access
AMI Already Exists
AMI names must be unique
Use timestamp in name: my app ${local.timestamp}
Volume Size Too Small
Check source AMI's volume size
Set launch block device mappings.volume size accordingly
References
[Amazon EBS Builder](https://developer.hashicorp.com/packer/integrations/hashicorp/amazon/latest/components/builder/ebs)
[AWS AMI Documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html)