Packer Components
Packer components build machine images (AMIs, VM images, container images) using HashiCorp Packer. They allow you to manage image builds with the same stack-based configuration approach used for Terraform and Helmfile.
Available Configuration Sections
Packer components support the common configuration sections:
vars- Variables passed to packer.
env- Environment variables during execution.
settings- Integrations and metadata.
metadata- Component behavior and inheritance.
command- Override packer binary.
hooks- Lifecycle event handlers.
Component Structure
A typical Packer component configuration:
components:
packer:
ami-ubuntu:
metadata:
component: ami-ubuntu
vars:
region: us-east-1
instance_type: t3.medium
source_ami_filter:
name: "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"
owner: "099720109477" # Canonical
ami_name_prefix: "acme-ubuntu"
env:
AWS_PROFILE: acme-prod