hashicorp avatar

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-code

Installs 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
1rmyndharis avatarunity-developerrmyndharis/antigravity-skillsBuild Unity games with optimized C# scripts, efficient rendering, and proper asset management. Masters Unity 6 LTS, URP/HDRP pipelines, and cross-platform deplo3Kskills.sh installs
2nomadamas avatarcatchtable-snipernomadamas/k-skillMonitor Catchtable for open reservation slots and attempt booking using a logged-in Chrome session. 돌쇠에서는 공식 표면을 통한 후속 액션까지 진행한다.2.7Kskills.sh installs
3waynesutton avatarconvex-cron-jobswaynesutton/convexskillsScheduled function patterns for background tasks including interval scheduling, cron expressions, job monitoring, retry strategies, and best practices for long-2.6Kskills.sh installs
4conorluddy avatarios-simulator-skillconorluddy/ios-simulator-skill29 production-ready scripts for iOS app testing, building, and automation. Provides semantic UI navigation, build automation, accessibility testing, and simulat2.4Kskills.sh installs
5browserbase avatarcompany-researchbrowserbase/skillsCompany discovery and deep research skill. Researches a company's product and ICP, discovers target companies to sell to using Browserbase Search API, deeply re2.4Kskills.sh installs
6nvidia avataromniverse-cad-to-simreadynvidia/skillsCoordinate the end-to-end CAD/source-asset to SimReady workflow. Use for broad requests such as CAD to SimReady, source asset to simulation-ready USD, or prop p2.4Kskills.sh installs