Codepit The toolbox

Custom AWS machine images, built with Packer

Claude writes Packer templates that build Amazon Machine Images with the amazon-ebs builder: start from a base image, provision it, and copy the result to other regions if you want.

Scan checks all of hashicorp/agent-skills on your computer, before anything installs.

Codepit runs on your computer. Open this page there to scan it before installing.

An open manual with a honey ribbon

What you get

A working template plus ready-made base image filters and fixes for the usual build errors.

  • Ubuntu 22.04 LTS
  • Amazon Linux 2023
  • Multi-region copies
  • SSH timeouts
  • Duplicate AMI names
  • Volume size

When it kicks in

  • Custom AMIs
  • EC2 base images
  • Multi-region images

It kicks in when you're creating a custom AMI for EC2 instances.

Before you start

  • Packer. packer init fetches the Amazon plugin the template asks for.
  • AWS credentials Packer can find: environment variables, ~/.aws/credentials or an EC2 instance profile.

Try saying

>Build an Ubuntu AMI with our packages, copied to us-east-1 and eu-west-1

Claude writes a template with an amazon-ebs source, a shell provisioner, a timestamped AMI name and ami_regions, and gives you the packer init, packer validate and packer build commands.

Worth knowing

A build launches real EC2 instances and uses EBS storage and data transfer in your AWS account, so it costs money. Builds usually take 10 to 30 minutes.

Comes with the Packer bundle

This skill ships in HashiCorp's Packer plugin, so you get its other three skills too.

  • azure-image-builder
  • windows-builder
  • push-to-registry
Read the author's full guide SKILL.md