
Push To Registry
This configures Packer to push build metadata to HCP Packer's registry so you can track which image versions exist and promote them through channels like production or staging. The actual setup is a single hcp_packer_registry block in your build with bucket_name, labels, and descriptions. The real value shows up in Terraform where you query by channel name instead of hardcoding AMI IDs, which means your infrastructure code stays stable while images get updated. Authentication needs a service principal with four environment variables. One thing to watch: bucket_name must stay consistent across builds or you'll fragment your registry into multiple buckets accidentally.
- skills.sh installs
- 3.1K
- GitHub stars
- 924
- last updated
- Aug 21, 2026
Install
$ npx -y skills add hashicorp/agent-skills --skill push-to-registry --agent claude-codeInstalls into .claude/skills of the current project.
Files
Push to HCP Packer Registry
Configure Packer templates to push build metadata to HCP Packer registry.
Reference: HCP Packer Registry
Note: HCP Packer is free for basic use. Builds push metadata only (not actual images), adding minimal overhead (<1 minute).
Basic Registry Configuration
packer {
required_version = ">= 1.7.7"
}
variable "image_name" {
type = string
default = "web-server"
}
locals {
timestamp = regex_replace(timestamp(), "[- TZ:]", "")
}
source "amazon-ebs" "ubuntu" {
region = "us-west-2"
instance_type = "t3.micro"
source_ami_filter {
filters = {
name = "ubuntu/images/*ubuntu-jammy-22.04-amd64-server-*"
}
most_recent = true
owners = ["099720109477"]
}
ssh_username = "ubuntu"
ami_name = "${var.image_name}-${local.timestamp}"
}
build {
sources = ["source.amazon-ebs.ubuntu"]
hcp_packer_registry {
bucket_name = var.image_name
description = "Ubuntu 22.04 base image for web servers"
bucket_labels = {
"os" = "ubuntu"
"team" = "platform"
}
Sponsors
Details
- Repository
- github.com/hashicorp/agent-skills
- Categories
- DevOps & CI/CD, AI & Agent Building, Release Management
- First seen
- Apr 16, 2026
More from hashicorp/agent-skills
All 16- Azure Image Builder2.8K
- Windows Builder2.8K
- Terraform Style Guide13.2K
- Terraform Test9.2K
- Refactor Module6.6K
- Terraform Stacks5.8K
- Terraform Search Import5.1K
- Provider Resources4.2K
- New Terraform Provider4K
- Provider Actions4K
- Run Acceptance Tests3.8K
- Azure Verified Modules3.4K
- Provider Test Patterns3.4K
- Provider Docs3.3K
- Aws Ami Builder3.3K