[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-hashicorp-push-to-registry":3,"mdc-iwlhpm-key":37,"related-org-hashicorp-push-to-registry":1596,"related-repo-hashicorp-push-to-registry":1748},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":32,"sourceUrl":35,"mdContent":36},"push-to-registry","push Packer build metadata to HCP registry","Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"hashicorp","HashiCorp","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fhashicorp.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"HCP","hcp","tag",{"name":17,"slug":18,"type":15},"Governance","governance",{"name":20,"slug":21,"type":15},"Deployment","deployment",{"name":23,"slug":24,"type":15},"Packer","packer",728,"https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fagent-skills","2026-04-06T18:25:02.749563",null,104,[31],"doormat-managed",{"repoUrl":26,"stars":25,"forks":29,"topics":33,"description":34},[31],"A collection of Agent skills and Claude Code plugins for HashiCorp products.","https:\u002F\u002Fgithub.com\u002Fhashicorp\u002Fagent-skills\u002Ftree\u002FHEAD\u002Fpacker\u002Fhcp\u002Fskills\u002Fpush-to-registry","---\nname: push-to-registry\ndescription: Push Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version control and governance.\n---\n\n# Push to HCP Packer Registry\n\nConfigure Packer templates to push build metadata to HCP Packer registry.\n\n**Reference:** [HCP Packer Registry](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fhcp\u002Fdocs\u002Fpacker)\n\n> **Note:** HCP Packer is free for basic use. Builds push metadata only (not actual images), adding minimal overhead (\u003C1 minute).\n\n## Basic Registry Configuration\n\n```hcl\npacker {\n  required_version = \">= 1.7.7\"\n}\n\nvariable \"image_name\" {\n  type    = string\n  default = \"web-server\"\n}\n\nlocals {\n  timestamp = regex_replace(timestamp(), \"[- TZ:]\", \"\")\n}\n\nsource \"amazon-ebs\" \"ubuntu\" {\n  region        = \"us-west-2\"\n  instance_type = \"t3.micro\"\n\n  source_ami_filter {\n    filters = {\n      name = \"ubuntu\u002Fimages\u002F*ubuntu-jammy-22.04-amd64-server-*\"\n    }\n    most_recent = true\n    owners      = [\"099720109477\"]\n  }\n\n  ssh_username = \"ubuntu\"\n  ami_name     = \"${var.image_name}-${local.timestamp}\"\n}\n\nbuild {\n  sources = [\"source.amazon-ebs.ubuntu\"]\n\n  hcp_packer_registry {\n    bucket_name = var.image_name\n    description = \"Ubuntu 22.04 base image for web servers\"\n\n    bucket_labels = {\n      \"os\"   = \"ubuntu\"\n      \"team\" = \"platform\"\n    }\n\n    build_labels = {\n      \"build-time\" = local.timestamp\n    }\n  }\n\n  provisioner \"shell\" {\n    inline = [\n      \"sudo apt-get update\",\n      \"sudo apt-get upgrade -y\",\n    ]\n  }\n}\n```\n\n## Authentication\n\nSet environment variables before building:\n\n```bash\nexport HCP_CLIENT_ID=\"your-service-principal-client-id\"\nexport HCP_CLIENT_SECRET=\"your-service-principal-secret\"\nexport HCP_ORGANIZATION_ID=\"your-org-id\"\nexport HCP_PROJECT_ID=\"your-project-id\"\n\npacker build .\n```\n\n### Create HCP Service Principal\n\n1. Navigate to HCP → Access Control (IAM)\n2. Create Service Principal\n3. Grant \"Contributor\" role on project\n4. Generate client secret\n5. Save client ID and secret\n\n## Registry Configuration Options\n\n### bucket_name (required)\nThe image identifier. Must stay consistent across builds!\n\n```hcl\nbucket_name = \"web-server\"  # Keep this constant\n```\n\n### bucket_labels (optional)\nMetadata at bucket level. Updates with each build.\n\n```hcl\nbucket_labels = {\n  \"os\"        = \"ubuntu\"\n  \"team\"      = \"platform\"\n  \"component\" = \"web\"\n}\n```\n\n### build_labels (optional)\nMetadata for each iteration. Immutable after build completes.\n\n```hcl\nbuild_labels = {\n  \"build-time\" = local.timestamp\n  \"git-commit\" = var.git_commit\n}\n```\n\n## CI\u002FCD Integration\n\n### GitHub Actions\n\n```yaml\nname: Build and Push to HCP Packer\n\non:\n  push:\n    branches: [main]\n\nenv:\n  HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}\n  HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}\n  HCP_ORGANIZATION_ID: ${{ secrets.HCP_ORGANIZATION_ID }}\n  HCP_PROJECT_ID: ${{ secrets.HCP_PROJECT_ID }}\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: hashicorp\u002Fsetup-packer@main\n\n      - name: Build and push\n        run: |\n          packer init .\n          packer build \\\n            -var \"git_commit=${{ github.sha }}\" \\\n            .\n```\n\n## Querying in Terraform\n\n```hcl\ndata \"hcp_packer_artifact\" \"ubuntu\" {\n  bucket_name  = \"web-server\"\n  channel_name = \"production\"\n  platform     = \"aws\"\n  region       = \"us-west-2\"\n}\n\nresource \"aws_instance\" \"web\" {\n  ami           = data.hcp_packer_artifact.ubuntu.external_identifier\n  instance_type = \"t3.micro\"\n\n  tags = {\n    PackerBucket = data.hcp_packer_artifact.ubuntu.bucket_name\n  }\n}\n```\n\n## Common Issues\n\n**Authentication Failed**\n- Verify HCP_CLIENT_ID and HCP_CLIENT_SECRET\n- Ensure service principal has Contributor role\n- Check organization and project IDs\n\n**Bucket Name Mismatch**\n- Keep `bucket_name` consistent across builds\n- Don't include timestamps in bucket_name\n- Creates new bucket if name changes\n\n**Build Fails**\n- Packer fails immediately if can't push metadata\n- Prevents drift between artifacts and registry\n- Check network connectivity to HCP API\n\n## Best Practices\n\n- **Consistent bucket names** - Never change for same image type\n- **Meaningful labels** - Use for versions, teams, compliance\n- **CI\u002FCD automation** - Automate builds and registry pushes\n- **Immutable build labels** - Put changing data (git SHA, date) in build_labels\n\n## References\n\n- [HCP Packer Documentation](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fhcp\u002Fdocs\u002Fpacker)\n- [hcp_packer_registry Block](https:\u002F\u002Fdeveloper.hashicorp.com\u002Fpacker\u002Fdocs\u002Ftemplates\u002Fhcl_templates\u002Fblocks\u002Fbuild\u002Fhcp_packer_registry)\n- [HCP Terraform Provider](https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Fhcp\u002Flatest\u002Fdocs\u002Fdata-sources\u002Fpacker_artifact)\n",{"data":38,"body":39},{"name":4,"description":6},{"type":40,"children":41},"root",[42,51,57,77,91,98,573,579,584,742,749,779,785,791,796,810,816,821,867,873,878,916,922,928,1283,1289,1410,1416,1424,1443,1451,1477,1485,1503,1509,1552,1558,1590],{"type":43,"tag":44,"props":45,"children":47},"element","h1",{"id":46},"push-to-hcp-packer-registry",[48],{"type":49,"value":50},"text","Push to HCP Packer Registry",{"type":43,"tag":52,"props":53,"children":54},"p",{},[55],{"type":49,"value":56},"Configure Packer templates to push build metadata to HCP Packer registry.",{"type":43,"tag":52,"props":58,"children":59},{},[60,66,68],{"type":43,"tag":61,"props":62,"children":63},"strong",{},[64],{"type":49,"value":65},"Reference:",{"type":49,"value":67}," ",{"type":43,"tag":69,"props":70,"children":74},"a",{"href":71,"rel":72},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fhcp\u002Fdocs\u002Fpacker",[73],"nofollow",[75],{"type":49,"value":76},"HCP Packer Registry",{"type":43,"tag":78,"props":79,"children":80},"blockquote",{},[81],{"type":43,"tag":52,"props":82,"children":83},{},[84,89],{"type":43,"tag":61,"props":85,"children":86},{},[87],{"type":49,"value":88},"Note:",{"type":49,"value":90}," HCP Packer is free for basic use. Builds push metadata only (not actual images), adding minimal overhead (\u003C1 minute).",{"type":43,"tag":92,"props":93,"children":95},"h2",{"id":94},"basic-registry-configuration",[96],{"type":49,"value":97},"Basic Registry Configuration",{"type":43,"tag":99,"props":100,"children":105},"pre",{"className":101,"code":102,"language":103,"meta":104,"style":104},"language-hcl shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","packer {\n  required_version = \">= 1.7.7\"\n}\n\nvariable \"image_name\" {\n  type    = string\n  default = \"web-server\"\n}\n\nlocals {\n  timestamp = regex_replace(timestamp(), \"[- TZ:]\", \"\")\n}\n\nsource \"amazon-ebs\" \"ubuntu\" {\n  region        = \"us-west-2\"\n  instance_type = \"t3.micro\"\n\n  source_ami_filter {\n    filters = {\n      name = \"ubuntu\u002Fimages\u002F*ubuntu-jammy-22.04-amd64-server-*\"\n    }\n    most_recent = true\n    owners      = [\"099720109477\"]\n  }\n\n  ssh_username = \"ubuntu\"\n  ami_name     = \"${var.image_name}-${local.timestamp}\"\n}\n\nbuild {\n  sources = [\"source.amazon-ebs.ubuntu\"]\n\n  hcp_packer_registry {\n    bucket_name = var.image_name\n    description = \"Ubuntu 22.04 base image for web servers\"\n\n    bucket_labels = {\n      \"os\"   = \"ubuntu\"\n      \"team\" = \"platform\"\n    }\n\n    build_labels = {\n      \"build-time\" = local.timestamp\n    }\n  }\n\n  provisioner \"shell\" {\n    inline = [\n      \"sudo apt-get update\",\n      \"sudo apt-get upgrade -y\",\n    ]\n  }\n}\n","hcl","",[106],{"type":43,"tag":107,"props":108,"children":109},"code",{"__ignoreMap":104},[110,121,130,139,149,158,167,176,184,192,201,210,218,226,235,244,253,261,270,279,288,297,306,315,324,332,341,350,358,366,375,384,392,401,410,419,427,436,445,454,462,470,479,488,496,504,512,521,530,539,548,557,565],{"type":43,"tag":111,"props":112,"children":115},"span",{"class":113,"line":114},"line",1,[116],{"type":43,"tag":111,"props":117,"children":118},{},[119],{"type":49,"value":120},"packer {\n",{"type":43,"tag":111,"props":122,"children":124},{"class":113,"line":123},2,[125],{"type":43,"tag":111,"props":126,"children":127},{},[128],{"type":49,"value":129},"  required_version = \">= 1.7.7\"\n",{"type":43,"tag":111,"props":131,"children":133},{"class":113,"line":132},3,[134],{"type":43,"tag":111,"props":135,"children":136},{},[137],{"type":49,"value":138},"}\n",{"type":43,"tag":111,"props":140,"children":142},{"class":113,"line":141},4,[143],{"type":43,"tag":111,"props":144,"children":146},{"emptyLinePlaceholder":145},true,[147],{"type":49,"value":148},"\n",{"type":43,"tag":111,"props":150,"children":152},{"class":113,"line":151},5,[153],{"type":43,"tag":111,"props":154,"children":155},{},[156],{"type":49,"value":157},"variable \"image_name\" {\n",{"type":43,"tag":111,"props":159,"children":161},{"class":113,"line":160},6,[162],{"type":43,"tag":111,"props":163,"children":164},{},[165],{"type":49,"value":166},"  type    = string\n",{"type":43,"tag":111,"props":168,"children":170},{"class":113,"line":169},7,[171],{"type":43,"tag":111,"props":172,"children":173},{},[174],{"type":49,"value":175},"  default = \"web-server\"\n",{"type":43,"tag":111,"props":177,"children":179},{"class":113,"line":178},8,[180],{"type":43,"tag":111,"props":181,"children":182},{},[183],{"type":49,"value":138},{"type":43,"tag":111,"props":185,"children":187},{"class":113,"line":186},9,[188],{"type":43,"tag":111,"props":189,"children":190},{"emptyLinePlaceholder":145},[191],{"type":49,"value":148},{"type":43,"tag":111,"props":193,"children":195},{"class":113,"line":194},10,[196],{"type":43,"tag":111,"props":197,"children":198},{},[199],{"type":49,"value":200},"locals {\n",{"type":43,"tag":111,"props":202,"children":204},{"class":113,"line":203},11,[205],{"type":43,"tag":111,"props":206,"children":207},{},[208],{"type":49,"value":209},"  timestamp = regex_replace(timestamp(), \"[- TZ:]\", \"\")\n",{"type":43,"tag":111,"props":211,"children":213},{"class":113,"line":212},12,[214],{"type":43,"tag":111,"props":215,"children":216},{},[217],{"type":49,"value":138},{"type":43,"tag":111,"props":219,"children":221},{"class":113,"line":220},13,[222],{"type":43,"tag":111,"props":223,"children":224},{"emptyLinePlaceholder":145},[225],{"type":49,"value":148},{"type":43,"tag":111,"props":227,"children":229},{"class":113,"line":228},14,[230],{"type":43,"tag":111,"props":231,"children":232},{},[233],{"type":49,"value":234},"source \"amazon-ebs\" \"ubuntu\" {\n",{"type":43,"tag":111,"props":236,"children":238},{"class":113,"line":237},15,[239],{"type":43,"tag":111,"props":240,"children":241},{},[242],{"type":49,"value":243},"  region        = \"us-west-2\"\n",{"type":43,"tag":111,"props":245,"children":247},{"class":113,"line":246},16,[248],{"type":43,"tag":111,"props":249,"children":250},{},[251],{"type":49,"value":252},"  instance_type = \"t3.micro\"\n",{"type":43,"tag":111,"props":254,"children":256},{"class":113,"line":255},17,[257],{"type":43,"tag":111,"props":258,"children":259},{"emptyLinePlaceholder":145},[260],{"type":49,"value":148},{"type":43,"tag":111,"props":262,"children":264},{"class":113,"line":263},18,[265],{"type":43,"tag":111,"props":266,"children":267},{},[268],{"type":49,"value":269},"  source_ami_filter {\n",{"type":43,"tag":111,"props":271,"children":273},{"class":113,"line":272},19,[274],{"type":43,"tag":111,"props":275,"children":276},{},[277],{"type":49,"value":278},"    filters = {\n",{"type":43,"tag":111,"props":280,"children":282},{"class":113,"line":281},20,[283],{"type":43,"tag":111,"props":284,"children":285},{},[286],{"type":49,"value":287},"      name = \"ubuntu\u002Fimages\u002F*ubuntu-jammy-22.04-amd64-server-*\"\n",{"type":43,"tag":111,"props":289,"children":291},{"class":113,"line":290},21,[292],{"type":43,"tag":111,"props":293,"children":294},{},[295],{"type":49,"value":296},"    }\n",{"type":43,"tag":111,"props":298,"children":300},{"class":113,"line":299},22,[301],{"type":43,"tag":111,"props":302,"children":303},{},[304],{"type":49,"value":305},"    most_recent = true\n",{"type":43,"tag":111,"props":307,"children":309},{"class":113,"line":308},23,[310],{"type":43,"tag":111,"props":311,"children":312},{},[313],{"type":49,"value":314},"    owners      = [\"099720109477\"]\n",{"type":43,"tag":111,"props":316,"children":318},{"class":113,"line":317},24,[319],{"type":43,"tag":111,"props":320,"children":321},{},[322],{"type":49,"value":323},"  }\n",{"type":43,"tag":111,"props":325,"children":327},{"class":113,"line":326},25,[328],{"type":43,"tag":111,"props":329,"children":330},{"emptyLinePlaceholder":145},[331],{"type":49,"value":148},{"type":43,"tag":111,"props":333,"children":335},{"class":113,"line":334},26,[336],{"type":43,"tag":111,"props":337,"children":338},{},[339],{"type":49,"value":340},"  ssh_username = \"ubuntu\"\n",{"type":43,"tag":111,"props":342,"children":344},{"class":113,"line":343},27,[345],{"type":43,"tag":111,"props":346,"children":347},{},[348],{"type":49,"value":349},"  ami_name     = \"${var.image_name}-${local.timestamp}\"\n",{"type":43,"tag":111,"props":351,"children":353},{"class":113,"line":352},28,[354],{"type":43,"tag":111,"props":355,"children":356},{},[357],{"type":49,"value":138},{"type":43,"tag":111,"props":359,"children":361},{"class":113,"line":360},29,[362],{"type":43,"tag":111,"props":363,"children":364},{"emptyLinePlaceholder":145},[365],{"type":49,"value":148},{"type":43,"tag":111,"props":367,"children":369},{"class":113,"line":368},30,[370],{"type":43,"tag":111,"props":371,"children":372},{},[373],{"type":49,"value":374},"build {\n",{"type":43,"tag":111,"props":376,"children":378},{"class":113,"line":377},31,[379],{"type":43,"tag":111,"props":380,"children":381},{},[382],{"type":49,"value":383},"  sources = [\"source.amazon-ebs.ubuntu\"]\n",{"type":43,"tag":111,"props":385,"children":387},{"class":113,"line":386},32,[388],{"type":43,"tag":111,"props":389,"children":390},{"emptyLinePlaceholder":145},[391],{"type":49,"value":148},{"type":43,"tag":111,"props":393,"children":395},{"class":113,"line":394},33,[396],{"type":43,"tag":111,"props":397,"children":398},{},[399],{"type":49,"value":400},"  hcp_packer_registry {\n",{"type":43,"tag":111,"props":402,"children":404},{"class":113,"line":403},34,[405],{"type":43,"tag":111,"props":406,"children":407},{},[408],{"type":49,"value":409},"    bucket_name = var.image_name\n",{"type":43,"tag":111,"props":411,"children":413},{"class":113,"line":412},35,[414],{"type":43,"tag":111,"props":415,"children":416},{},[417],{"type":49,"value":418},"    description = \"Ubuntu 22.04 base image for web servers\"\n",{"type":43,"tag":111,"props":420,"children":422},{"class":113,"line":421},36,[423],{"type":43,"tag":111,"props":424,"children":425},{"emptyLinePlaceholder":145},[426],{"type":49,"value":148},{"type":43,"tag":111,"props":428,"children":430},{"class":113,"line":429},37,[431],{"type":43,"tag":111,"props":432,"children":433},{},[434],{"type":49,"value":435},"    bucket_labels = {\n",{"type":43,"tag":111,"props":437,"children":439},{"class":113,"line":438},38,[440],{"type":43,"tag":111,"props":441,"children":442},{},[443],{"type":49,"value":444},"      \"os\"   = \"ubuntu\"\n",{"type":43,"tag":111,"props":446,"children":448},{"class":113,"line":447},39,[449],{"type":43,"tag":111,"props":450,"children":451},{},[452],{"type":49,"value":453},"      \"team\" = \"platform\"\n",{"type":43,"tag":111,"props":455,"children":457},{"class":113,"line":456},40,[458],{"type":43,"tag":111,"props":459,"children":460},{},[461],{"type":49,"value":296},{"type":43,"tag":111,"props":463,"children":465},{"class":113,"line":464},41,[466],{"type":43,"tag":111,"props":467,"children":468},{"emptyLinePlaceholder":145},[469],{"type":49,"value":148},{"type":43,"tag":111,"props":471,"children":473},{"class":113,"line":472},42,[474],{"type":43,"tag":111,"props":475,"children":476},{},[477],{"type":49,"value":478},"    build_labels = {\n",{"type":43,"tag":111,"props":480,"children":482},{"class":113,"line":481},43,[483],{"type":43,"tag":111,"props":484,"children":485},{},[486],{"type":49,"value":487},"      \"build-time\" = local.timestamp\n",{"type":43,"tag":111,"props":489,"children":491},{"class":113,"line":490},44,[492],{"type":43,"tag":111,"props":493,"children":494},{},[495],{"type":49,"value":296},{"type":43,"tag":111,"props":497,"children":499},{"class":113,"line":498},45,[500],{"type":43,"tag":111,"props":501,"children":502},{},[503],{"type":49,"value":323},{"type":43,"tag":111,"props":505,"children":507},{"class":113,"line":506},46,[508],{"type":43,"tag":111,"props":509,"children":510},{"emptyLinePlaceholder":145},[511],{"type":49,"value":148},{"type":43,"tag":111,"props":513,"children":515},{"class":113,"line":514},47,[516],{"type":43,"tag":111,"props":517,"children":518},{},[519],{"type":49,"value":520},"  provisioner \"shell\" {\n",{"type":43,"tag":111,"props":522,"children":524},{"class":113,"line":523},48,[525],{"type":43,"tag":111,"props":526,"children":527},{},[528],{"type":49,"value":529},"    inline = [\n",{"type":43,"tag":111,"props":531,"children":533},{"class":113,"line":532},49,[534],{"type":43,"tag":111,"props":535,"children":536},{},[537],{"type":49,"value":538},"      \"sudo apt-get update\",\n",{"type":43,"tag":111,"props":540,"children":542},{"class":113,"line":541},50,[543],{"type":43,"tag":111,"props":544,"children":545},{},[546],{"type":49,"value":547},"      \"sudo apt-get upgrade -y\",\n",{"type":43,"tag":111,"props":549,"children":551},{"class":113,"line":550},51,[552],{"type":43,"tag":111,"props":553,"children":554},{},[555],{"type":49,"value":556},"    ]\n",{"type":43,"tag":111,"props":558,"children":560},{"class":113,"line":559},52,[561],{"type":43,"tag":111,"props":562,"children":563},{},[564],{"type":49,"value":323},{"type":43,"tag":111,"props":566,"children":568},{"class":113,"line":567},53,[569],{"type":43,"tag":111,"props":570,"children":571},{},[572],{"type":49,"value":138},{"type":43,"tag":92,"props":574,"children":576},{"id":575},"authentication",[577],{"type":49,"value":578},"Authentication",{"type":43,"tag":52,"props":580,"children":581},{},[582],{"type":49,"value":583},"Set environment variables before building:",{"type":43,"tag":99,"props":585,"children":589},{"className":586,"code":587,"language":588,"meta":104,"style":104},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export HCP_CLIENT_ID=\"your-service-principal-client-id\"\nexport HCP_CLIENT_SECRET=\"your-service-principal-secret\"\nexport HCP_ORGANIZATION_ID=\"your-org-id\"\nexport HCP_PROJECT_ID=\"your-project-id\"\n\npacker build .\n","bash",[590],{"type":43,"tag":107,"props":591,"children":592},{"__ignoreMap":104},[593,630,659,688,717,724],{"type":43,"tag":111,"props":594,"children":595},{"class":113,"line":114},[596,602,608,614,619,625],{"type":43,"tag":111,"props":597,"children":599},{"style":598},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[600],{"type":49,"value":601},"export",{"type":43,"tag":111,"props":603,"children":605},{"style":604},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[606],{"type":49,"value":607}," HCP_CLIENT_ID",{"type":43,"tag":111,"props":609,"children":611},{"style":610},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[612],{"type":49,"value":613},"=",{"type":43,"tag":111,"props":615,"children":616},{"style":610},[617],{"type":49,"value":618},"\"",{"type":43,"tag":111,"props":620,"children":622},{"style":621},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[623],{"type":49,"value":624},"your-service-principal-client-id",{"type":43,"tag":111,"props":626,"children":627},{"style":610},[628],{"type":49,"value":629},"\"\n",{"type":43,"tag":111,"props":631,"children":632},{"class":113,"line":123},[633,637,642,646,650,655],{"type":43,"tag":111,"props":634,"children":635},{"style":598},[636],{"type":49,"value":601},{"type":43,"tag":111,"props":638,"children":639},{"style":604},[640],{"type":49,"value":641}," HCP_CLIENT_SECRET",{"type":43,"tag":111,"props":643,"children":644},{"style":610},[645],{"type":49,"value":613},{"type":43,"tag":111,"props":647,"children":648},{"style":610},[649],{"type":49,"value":618},{"type":43,"tag":111,"props":651,"children":652},{"style":621},[653],{"type":49,"value":654},"your-service-principal-secret",{"type":43,"tag":111,"props":656,"children":657},{"style":610},[658],{"type":49,"value":629},{"type":43,"tag":111,"props":660,"children":661},{"class":113,"line":132},[662,666,671,675,679,684],{"type":43,"tag":111,"props":663,"children":664},{"style":598},[665],{"type":49,"value":601},{"type":43,"tag":111,"props":667,"children":668},{"style":604},[669],{"type":49,"value":670}," HCP_ORGANIZATION_ID",{"type":43,"tag":111,"props":672,"children":673},{"style":610},[674],{"type":49,"value":613},{"type":43,"tag":111,"props":676,"children":677},{"style":610},[678],{"type":49,"value":618},{"type":43,"tag":111,"props":680,"children":681},{"style":621},[682],{"type":49,"value":683},"your-org-id",{"type":43,"tag":111,"props":685,"children":686},{"style":610},[687],{"type":49,"value":629},{"type":43,"tag":111,"props":689,"children":690},{"class":113,"line":141},[691,695,700,704,708,713],{"type":43,"tag":111,"props":692,"children":693},{"style":598},[694],{"type":49,"value":601},{"type":43,"tag":111,"props":696,"children":697},{"style":604},[698],{"type":49,"value":699}," HCP_PROJECT_ID",{"type":43,"tag":111,"props":701,"children":702},{"style":610},[703],{"type":49,"value":613},{"type":43,"tag":111,"props":705,"children":706},{"style":610},[707],{"type":49,"value":618},{"type":43,"tag":111,"props":709,"children":710},{"style":621},[711],{"type":49,"value":712},"your-project-id",{"type":43,"tag":111,"props":714,"children":715},{"style":610},[716],{"type":49,"value":629},{"type":43,"tag":111,"props":718,"children":719},{"class":113,"line":151},[720],{"type":43,"tag":111,"props":721,"children":722},{"emptyLinePlaceholder":145},[723],{"type":49,"value":148},{"type":43,"tag":111,"props":725,"children":726},{"class":113,"line":160},[727,732,737],{"type":43,"tag":111,"props":728,"children":730},{"style":729},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[731],{"type":49,"value":24},{"type":43,"tag":111,"props":733,"children":734},{"style":621},[735],{"type":49,"value":736}," build",{"type":43,"tag":111,"props":738,"children":739},{"style":621},[740],{"type":49,"value":741}," .\n",{"type":43,"tag":743,"props":744,"children":746},"h3",{"id":745},"create-hcp-service-principal",[747],{"type":49,"value":748},"Create HCP Service Principal",{"type":43,"tag":750,"props":751,"children":752},"ol",{},[753,759,764,769,774],{"type":43,"tag":754,"props":755,"children":756},"li",{},[757],{"type":49,"value":758},"Navigate to HCP → Access Control (IAM)",{"type":43,"tag":754,"props":760,"children":761},{},[762],{"type":49,"value":763},"Create Service Principal",{"type":43,"tag":754,"props":765,"children":766},{},[767],{"type":49,"value":768},"Grant \"Contributor\" role on project",{"type":43,"tag":754,"props":770,"children":771},{},[772],{"type":49,"value":773},"Generate client secret",{"type":43,"tag":754,"props":775,"children":776},{},[777],{"type":49,"value":778},"Save client ID and secret",{"type":43,"tag":92,"props":780,"children":782},{"id":781},"registry-configuration-options",[783],{"type":49,"value":784},"Registry Configuration Options",{"type":43,"tag":743,"props":786,"children":788},{"id":787},"bucket_name-required",[789],{"type":49,"value":790},"bucket_name (required)",{"type":43,"tag":52,"props":792,"children":793},{},[794],{"type":49,"value":795},"The image identifier. Must stay consistent across builds!",{"type":43,"tag":99,"props":797,"children":799},{"className":101,"code":798,"language":103,"meta":104,"style":104},"bucket_name = \"web-server\"  # Keep this constant\n",[800],{"type":43,"tag":107,"props":801,"children":802},{"__ignoreMap":104},[803],{"type":43,"tag":111,"props":804,"children":805},{"class":113,"line":114},[806],{"type":43,"tag":111,"props":807,"children":808},{},[809],{"type":49,"value":798},{"type":43,"tag":743,"props":811,"children":813},{"id":812},"bucket_labels-optional",[814],{"type":49,"value":815},"bucket_labels (optional)",{"type":43,"tag":52,"props":817,"children":818},{},[819],{"type":49,"value":820},"Metadata at bucket level. Updates with each build.",{"type":43,"tag":99,"props":822,"children":824},{"className":101,"code":823,"language":103,"meta":104,"style":104},"bucket_labels = {\n  \"os\"        = \"ubuntu\"\n  \"team\"      = \"platform\"\n  \"component\" = \"web\"\n}\n",[825],{"type":43,"tag":107,"props":826,"children":827},{"__ignoreMap":104},[828,836,844,852,860],{"type":43,"tag":111,"props":829,"children":830},{"class":113,"line":114},[831],{"type":43,"tag":111,"props":832,"children":833},{},[834],{"type":49,"value":835},"bucket_labels = {\n",{"type":43,"tag":111,"props":837,"children":838},{"class":113,"line":123},[839],{"type":43,"tag":111,"props":840,"children":841},{},[842],{"type":49,"value":843},"  \"os\"        = \"ubuntu\"\n",{"type":43,"tag":111,"props":845,"children":846},{"class":113,"line":132},[847],{"type":43,"tag":111,"props":848,"children":849},{},[850],{"type":49,"value":851},"  \"team\"      = \"platform\"\n",{"type":43,"tag":111,"props":853,"children":854},{"class":113,"line":141},[855],{"type":43,"tag":111,"props":856,"children":857},{},[858],{"type":49,"value":859},"  \"component\" = \"web\"\n",{"type":43,"tag":111,"props":861,"children":862},{"class":113,"line":151},[863],{"type":43,"tag":111,"props":864,"children":865},{},[866],{"type":49,"value":138},{"type":43,"tag":743,"props":868,"children":870},{"id":869},"build_labels-optional",[871],{"type":49,"value":872},"build_labels (optional)",{"type":43,"tag":52,"props":874,"children":875},{},[876],{"type":49,"value":877},"Metadata for each iteration. Immutable after build completes.",{"type":43,"tag":99,"props":879,"children":881},{"className":101,"code":880,"language":103,"meta":104,"style":104},"build_labels = {\n  \"build-time\" = local.timestamp\n  \"git-commit\" = var.git_commit\n}\n",[882],{"type":43,"tag":107,"props":883,"children":884},{"__ignoreMap":104},[885,893,901,909],{"type":43,"tag":111,"props":886,"children":887},{"class":113,"line":114},[888],{"type":43,"tag":111,"props":889,"children":890},{},[891],{"type":49,"value":892},"build_labels = {\n",{"type":43,"tag":111,"props":894,"children":895},{"class":113,"line":123},[896],{"type":43,"tag":111,"props":897,"children":898},{},[899],{"type":49,"value":900},"  \"build-time\" = local.timestamp\n",{"type":43,"tag":111,"props":902,"children":903},{"class":113,"line":132},[904],{"type":43,"tag":111,"props":905,"children":906},{},[907],{"type":49,"value":908},"  \"git-commit\" = var.git_commit\n",{"type":43,"tag":111,"props":910,"children":911},{"class":113,"line":141},[912],{"type":43,"tag":111,"props":913,"children":914},{},[915],{"type":49,"value":138},{"type":43,"tag":92,"props":917,"children":919},{"id":918},"cicd-integration",[920],{"type":49,"value":921},"CI\u002FCD Integration",{"type":43,"tag":743,"props":923,"children":925},{"id":924},"github-actions",[926],{"type":49,"value":927},"GitHub Actions",{"type":43,"tag":99,"props":929,"children":933},{"className":930,"code":931,"language":932,"meta":104,"style":104},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","name: Build and Push to HCP Packer\n\non:\n  push:\n    branches: [main]\n\nenv:\n  HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}\n  HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}\n  HCP_ORGANIZATION_ID: ${{ secrets.HCP_ORGANIZATION_ID }}\n  HCP_PROJECT_ID: ${{ secrets.HCP_PROJECT_ID }}\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: hashicorp\u002Fsetup-packer@main\n\n      - name: Build and push\n        run: |\n          packer init .\n          packer build \\\n            -var \"git_commit=${{ github.sha }}\" \\\n            .\n","yaml",[934],{"type":43,"tag":107,"props":935,"children":936},{"__ignoreMap":104},[937,956,963,977,989,1016,1023,1035,1052,1069,1086,1103,1110,1122,1134,1151,1163,1185,1205,1212,1233,1251,1259,1267,1275],{"type":43,"tag":111,"props":938,"children":939},{"class":113,"line":114},[940,946,951],{"type":43,"tag":111,"props":941,"children":943},{"style":942},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[944],{"type":49,"value":945},"name",{"type":43,"tag":111,"props":947,"children":948},{"style":610},[949],{"type":49,"value":950},":",{"type":43,"tag":111,"props":952,"children":953},{"style":621},[954],{"type":49,"value":955}," Build and Push to HCP Packer\n",{"type":43,"tag":111,"props":957,"children":958},{"class":113,"line":123},[959],{"type":43,"tag":111,"props":960,"children":961},{"emptyLinePlaceholder":145},[962],{"type":49,"value":148},{"type":43,"tag":111,"props":964,"children":965},{"class":113,"line":132},[966,972],{"type":43,"tag":111,"props":967,"children":969},{"style":968},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[970],{"type":49,"value":971},"on",{"type":43,"tag":111,"props":973,"children":974},{"style":610},[975],{"type":49,"value":976},":\n",{"type":43,"tag":111,"props":978,"children":979},{"class":113,"line":141},[980,985],{"type":43,"tag":111,"props":981,"children":982},{"style":942},[983],{"type":49,"value":984},"  push",{"type":43,"tag":111,"props":986,"children":987},{"style":610},[988],{"type":49,"value":976},{"type":43,"tag":111,"props":990,"children":991},{"class":113,"line":151},[992,997,1001,1006,1011],{"type":43,"tag":111,"props":993,"children":994},{"style":942},[995],{"type":49,"value":996},"    branches",{"type":43,"tag":111,"props":998,"children":999},{"style":610},[1000],{"type":49,"value":950},{"type":43,"tag":111,"props":1002,"children":1003},{"style":610},[1004],{"type":49,"value":1005}," [",{"type":43,"tag":111,"props":1007,"children":1008},{"style":621},[1009],{"type":49,"value":1010},"main",{"type":43,"tag":111,"props":1012,"children":1013},{"style":610},[1014],{"type":49,"value":1015},"]\n",{"type":43,"tag":111,"props":1017,"children":1018},{"class":113,"line":160},[1019],{"type":43,"tag":111,"props":1020,"children":1021},{"emptyLinePlaceholder":145},[1022],{"type":49,"value":148},{"type":43,"tag":111,"props":1024,"children":1025},{"class":113,"line":169},[1026,1031],{"type":43,"tag":111,"props":1027,"children":1028},{"style":942},[1029],{"type":49,"value":1030},"env",{"type":43,"tag":111,"props":1032,"children":1033},{"style":610},[1034],{"type":49,"value":976},{"type":43,"tag":111,"props":1036,"children":1037},{"class":113,"line":178},[1038,1043,1047],{"type":43,"tag":111,"props":1039,"children":1040},{"style":942},[1041],{"type":49,"value":1042},"  HCP_CLIENT_ID",{"type":43,"tag":111,"props":1044,"children":1045},{"style":610},[1046],{"type":49,"value":950},{"type":43,"tag":111,"props":1048,"children":1049},{"style":621},[1050],{"type":49,"value":1051}," ${{ secrets.HCP_CLIENT_ID }}\n",{"type":43,"tag":111,"props":1053,"children":1054},{"class":113,"line":186},[1055,1060,1064],{"type":43,"tag":111,"props":1056,"children":1057},{"style":942},[1058],{"type":49,"value":1059},"  HCP_CLIENT_SECRET",{"type":43,"tag":111,"props":1061,"children":1062},{"style":610},[1063],{"type":49,"value":950},{"type":43,"tag":111,"props":1065,"children":1066},{"style":621},[1067],{"type":49,"value":1068}," ${{ secrets.HCP_CLIENT_SECRET }}\n",{"type":43,"tag":111,"props":1070,"children":1071},{"class":113,"line":194},[1072,1077,1081],{"type":43,"tag":111,"props":1073,"children":1074},{"style":942},[1075],{"type":49,"value":1076},"  HCP_ORGANIZATION_ID",{"type":43,"tag":111,"props":1078,"children":1079},{"style":610},[1080],{"type":49,"value":950},{"type":43,"tag":111,"props":1082,"children":1083},{"style":621},[1084],{"type":49,"value":1085}," ${{ secrets.HCP_ORGANIZATION_ID }}\n",{"type":43,"tag":111,"props":1087,"children":1088},{"class":113,"line":203},[1089,1094,1098],{"type":43,"tag":111,"props":1090,"children":1091},{"style":942},[1092],{"type":49,"value":1093},"  HCP_PROJECT_ID",{"type":43,"tag":111,"props":1095,"children":1096},{"style":610},[1097],{"type":49,"value":950},{"type":43,"tag":111,"props":1099,"children":1100},{"style":621},[1101],{"type":49,"value":1102}," ${{ secrets.HCP_PROJECT_ID }}\n",{"type":43,"tag":111,"props":1104,"children":1105},{"class":113,"line":212},[1106],{"type":43,"tag":111,"props":1107,"children":1108},{"emptyLinePlaceholder":145},[1109],{"type":49,"value":148},{"type":43,"tag":111,"props":1111,"children":1112},{"class":113,"line":220},[1113,1118],{"type":43,"tag":111,"props":1114,"children":1115},{"style":942},[1116],{"type":49,"value":1117},"jobs",{"type":43,"tag":111,"props":1119,"children":1120},{"style":610},[1121],{"type":49,"value":976},{"type":43,"tag":111,"props":1123,"children":1124},{"class":113,"line":228},[1125,1130],{"type":43,"tag":111,"props":1126,"children":1127},{"style":942},[1128],{"type":49,"value":1129},"  build",{"type":43,"tag":111,"props":1131,"children":1132},{"style":610},[1133],{"type":49,"value":976},{"type":43,"tag":111,"props":1135,"children":1136},{"class":113,"line":237},[1137,1142,1146],{"type":43,"tag":111,"props":1138,"children":1139},{"style":942},[1140],{"type":49,"value":1141},"    runs-on",{"type":43,"tag":111,"props":1143,"children":1144},{"style":610},[1145],{"type":49,"value":950},{"type":43,"tag":111,"props":1147,"children":1148},{"style":621},[1149],{"type":49,"value":1150}," ubuntu-latest\n",{"type":43,"tag":111,"props":1152,"children":1153},{"class":113,"line":246},[1154,1159],{"type":43,"tag":111,"props":1155,"children":1156},{"style":942},[1157],{"type":49,"value":1158},"    steps",{"type":43,"tag":111,"props":1160,"children":1161},{"style":610},[1162],{"type":49,"value":976},{"type":43,"tag":111,"props":1164,"children":1165},{"class":113,"line":255},[1166,1171,1176,1180],{"type":43,"tag":111,"props":1167,"children":1168},{"style":610},[1169],{"type":49,"value":1170},"      -",{"type":43,"tag":111,"props":1172,"children":1173},{"style":942},[1174],{"type":49,"value":1175}," uses",{"type":43,"tag":111,"props":1177,"children":1178},{"style":610},[1179],{"type":49,"value":950},{"type":43,"tag":111,"props":1181,"children":1182},{"style":621},[1183],{"type":49,"value":1184}," actions\u002Fcheckout@v4\n",{"type":43,"tag":111,"props":1186,"children":1187},{"class":113,"line":263},[1188,1192,1196,1200],{"type":43,"tag":111,"props":1189,"children":1190},{"style":610},[1191],{"type":49,"value":1170},{"type":43,"tag":111,"props":1193,"children":1194},{"style":942},[1195],{"type":49,"value":1175},{"type":43,"tag":111,"props":1197,"children":1198},{"style":610},[1199],{"type":49,"value":950},{"type":43,"tag":111,"props":1201,"children":1202},{"style":621},[1203],{"type":49,"value":1204}," hashicorp\u002Fsetup-packer@main\n",{"type":43,"tag":111,"props":1206,"children":1207},{"class":113,"line":272},[1208],{"type":43,"tag":111,"props":1209,"children":1210},{"emptyLinePlaceholder":145},[1211],{"type":49,"value":148},{"type":43,"tag":111,"props":1213,"children":1214},{"class":113,"line":281},[1215,1219,1224,1228],{"type":43,"tag":111,"props":1216,"children":1217},{"style":610},[1218],{"type":49,"value":1170},{"type":43,"tag":111,"props":1220,"children":1221},{"style":942},[1222],{"type":49,"value":1223}," name",{"type":43,"tag":111,"props":1225,"children":1226},{"style":610},[1227],{"type":49,"value":950},{"type":43,"tag":111,"props":1229,"children":1230},{"style":621},[1231],{"type":49,"value":1232}," Build and push\n",{"type":43,"tag":111,"props":1234,"children":1235},{"class":113,"line":290},[1236,1241,1245],{"type":43,"tag":111,"props":1237,"children":1238},{"style":942},[1239],{"type":49,"value":1240},"        run",{"type":43,"tag":111,"props":1242,"children":1243},{"style":610},[1244],{"type":49,"value":950},{"type":43,"tag":111,"props":1246,"children":1248},{"style":1247},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[1249],{"type":49,"value":1250}," |\n",{"type":43,"tag":111,"props":1252,"children":1253},{"class":113,"line":299},[1254],{"type":43,"tag":111,"props":1255,"children":1256},{"style":621},[1257],{"type":49,"value":1258},"          packer init .\n",{"type":43,"tag":111,"props":1260,"children":1261},{"class":113,"line":308},[1262],{"type":43,"tag":111,"props":1263,"children":1264},{"style":621},[1265],{"type":49,"value":1266},"          packer build \\\n",{"type":43,"tag":111,"props":1268,"children":1269},{"class":113,"line":317},[1270],{"type":43,"tag":111,"props":1271,"children":1272},{"style":621},[1273],{"type":49,"value":1274},"            -var \"git_commit=${{ github.sha }}\" \\\n",{"type":43,"tag":111,"props":1276,"children":1277},{"class":113,"line":326},[1278],{"type":43,"tag":111,"props":1279,"children":1280},{"style":621},[1281],{"type":49,"value":1282},"            .\n",{"type":43,"tag":92,"props":1284,"children":1286},{"id":1285},"querying-in-terraform",[1287],{"type":49,"value":1288},"Querying in Terraform",{"type":43,"tag":99,"props":1290,"children":1292},{"className":101,"code":1291,"language":103,"meta":104,"style":104},"data \"hcp_packer_artifact\" \"ubuntu\" {\n  bucket_name  = \"web-server\"\n  channel_name = \"production\"\n  platform     = \"aws\"\n  region       = \"us-west-2\"\n}\n\nresource \"aws_instance\" \"web\" {\n  ami           = data.hcp_packer_artifact.ubuntu.external_identifier\n  instance_type = \"t3.micro\"\n\n  tags = {\n    PackerBucket = data.hcp_packer_artifact.ubuntu.bucket_name\n  }\n}\n",[1293],{"type":43,"tag":107,"props":1294,"children":1295},{"__ignoreMap":104},[1296,1304,1312,1320,1328,1336,1343,1350,1358,1366,1373,1380,1388,1396,1403],{"type":43,"tag":111,"props":1297,"children":1298},{"class":113,"line":114},[1299],{"type":43,"tag":111,"props":1300,"children":1301},{},[1302],{"type":49,"value":1303},"data \"hcp_packer_artifact\" \"ubuntu\" {\n",{"type":43,"tag":111,"props":1305,"children":1306},{"class":113,"line":123},[1307],{"type":43,"tag":111,"props":1308,"children":1309},{},[1310],{"type":49,"value":1311},"  bucket_name  = \"web-server\"\n",{"type":43,"tag":111,"props":1313,"children":1314},{"class":113,"line":132},[1315],{"type":43,"tag":111,"props":1316,"children":1317},{},[1318],{"type":49,"value":1319},"  channel_name = \"production\"\n",{"type":43,"tag":111,"props":1321,"children":1322},{"class":113,"line":141},[1323],{"type":43,"tag":111,"props":1324,"children":1325},{},[1326],{"type":49,"value":1327},"  platform     = \"aws\"\n",{"type":43,"tag":111,"props":1329,"children":1330},{"class":113,"line":151},[1331],{"type":43,"tag":111,"props":1332,"children":1333},{},[1334],{"type":49,"value":1335},"  region       = \"us-west-2\"\n",{"type":43,"tag":111,"props":1337,"children":1338},{"class":113,"line":160},[1339],{"type":43,"tag":111,"props":1340,"children":1341},{},[1342],{"type":49,"value":138},{"type":43,"tag":111,"props":1344,"children":1345},{"class":113,"line":169},[1346],{"type":43,"tag":111,"props":1347,"children":1348},{"emptyLinePlaceholder":145},[1349],{"type":49,"value":148},{"type":43,"tag":111,"props":1351,"children":1352},{"class":113,"line":178},[1353],{"type":43,"tag":111,"props":1354,"children":1355},{},[1356],{"type":49,"value":1357},"resource \"aws_instance\" \"web\" {\n",{"type":43,"tag":111,"props":1359,"children":1360},{"class":113,"line":186},[1361],{"type":43,"tag":111,"props":1362,"children":1363},{},[1364],{"type":49,"value":1365},"  ami           = data.hcp_packer_artifact.ubuntu.external_identifier\n",{"type":43,"tag":111,"props":1367,"children":1368},{"class":113,"line":194},[1369],{"type":43,"tag":111,"props":1370,"children":1371},{},[1372],{"type":49,"value":252},{"type":43,"tag":111,"props":1374,"children":1375},{"class":113,"line":203},[1376],{"type":43,"tag":111,"props":1377,"children":1378},{"emptyLinePlaceholder":145},[1379],{"type":49,"value":148},{"type":43,"tag":111,"props":1381,"children":1382},{"class":113,"line":212},[1383],{"type":43,"tag":111,"props":1384,"children":1385},{},[1386],{"type":49,"value":1387},"  tags = {\n",{"type":43,"tag":111,"props":1389,"children":1390},{"class":113,"line":220},[1391],{"type":43,"tag":111,"props":1392,"children":1393},{},[1394],{"type":49,"value":1395},"    PackerBucket = data.hcp_packer_artifact.ubuntu.bucket_name\n",{"type":43,"tag":111,"props":1397,"children":1398},{"class":113,"line":228},[1399],{"type":43,"tag":111,"props":1400,"children":1401},{},[1402],{"type":49,"value":323},{"type":43,"tag":111,"props":1404,"children":1405},{"class":113,"line":237},[1406],{"type":43,"tag":111,"props":1407,"children":1408},{},[1409],{"type":49,"value":138},{"type":43,"tag":92,"props":1411,"children":1413},{"id":1412},"common-issues",[1414],{"type":49,"value":1415},"Common Issues",{"type":43,"tag":52,"props":1417,"children":1418},{},[1419],{"type":43,"tag":61,"props":1420,"children":1421},{},[1422],{"type":49,"value":1423},"Authentication Failed",{"type":43,"tag":1425,"props":1426,"children":1427},"ul",{},[1428,1433,1438],{"type":43,"tag":754,"props":1429,"children":1430},{},[1431],{"type":49,"value":1432},"Verify HCP_CLIENT_ID and HCP_CLIENT_SECRET",{"type":43,"tag":754,"props":1434,"children":1435},{},[1436],{"type":49,"value":1437},"Ensure service principal has Contributor role",{"type":43,"tag":754,"props":1439,"children":1440},{},[1441],{"type":49,"value":1442},"Check organization and project IDs",{"type":43,"tag":52,"props":1444,"children":1445},{},[1446],{"type":43,"tag":61,"props":1447,"children":1448},{},[1449],{"type":49,"value":1450},"Bucket Name Mismatch",{"type":43,"tag":1425,"props":1452,"children":1453},{},[1454,1467,1472],{"type":43,"tag":754,"props":1455,"children":1456},{},[1457,1459,1465],{"type":49,"value":1458},"Keep ",{"type":43,"tag":107,"props":1460,"children":1462},{"className":1461},[],[1463],{"type":49,"value":1464},"bucket_name",{"type":49,"value":1466}," consistent across builds",{"type":43,"tag":754,"props":1468,"children":1469},{},[1470],{"type":49,"value":1471},"Don't include timestamps in bucket_name",{"type":43,"tag":754,"props":1473,"children":1474},{},[1475],{"type":49,"value":1476},"Creates new bucket if name changes",{"type":43,"tag":52,"props":1478,"children":1479},{},[1480],{"type":43,"tag":61,"props":1481,"children":1482},{},[1483],{"type":49,"value":1484},"Build Fails",{"type":43,"tag":1425,"props":1486,"children":1487},{},[1488,1493,1498],{"type":43,"tag":754,"props":1489,"children":1490},{},[1491],{"type":49,"value":1492},"Packer fails immediately if can't push metadata",{"type":43,"tag":754,"props":1494,"children":1495},{},[1496],{"type":49,"value":1497},"Prevents drift between artifacts and registry",{"type":43,"tag":754,"props":1499,"children":1500},{},[1501],{"type":49,"value":1502},"Check network connectivity to HCP API",{"type":43,"tag":92,"props":1504,"children":1506},{"id":1505},"best-practices",[1507],{"type":49,"value":1508},"Best Practices",{"type":43,"tag":1425,"props":1510,"children":1511},{},[1512,1522,1532,1542],{"type":43,"tag":754,"props":1513,"children":1514},{},[1515,1520],{"type":43,"tag":61,"props":1516,"children":1517},{},[1518],{"type":49,"value":1519},"Consistent bucket names",{"type":49,"value":1521}," - Never change for same image type",{"type":43,"tag":754,"props":1523,"children":1524},{},[1525,1530],{"type":43,"tag":61,"props":1526,"children":1527},{},[1528],{"type":49,"value":1529},"Meaningful labels",{"type":49,"value":1531}," - Use for versions, teams, compliance",{"type":43,"tag":754,"props":1533,"children":1534},{},[1535,1540],{"type":43,"tag":61,"props":1536,"children":1537},{},[1538],{"type":49,"value":1539},"CI\u002FCD automation",{"type":49,"value":1541}," - Automate builds and registry pushes",{"type":43,"tag":754,"props":1543,"children":1544},{},[1545,1550],{"type":43,"tag":61,"props":1546,"children":1547},{},[1548],{"type":49,"value":1549},"Immutable build labels",{"type":49,"value":1551}," - Put changing data (git SHA, date) in build_labels",{"type":43,"tag":92,"props":1553,"children":1555},{"id":1554},"references",[1556],{"type":49,"value":1557},"References",{"type":43,"tag":1425,"props":1559,"children":1560},{},[1561,1570,1580],{"type":43,"tag":754,"props":1562,"children":1563},{},[1564],{"type":43,"tag":69,"props":1565,"children":1567},{"href":71,"rel":1566},[73],[1568],{"type":49,"value":1569},"HCP Packer Documentation",{"type":43,"tag":754,"props":1571,"children":1572},{},[1573],{"type":43,"tag":69,"props":1574,"children":1577},{"href":1575,"rel":1576},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fpacker\u002Fdocs\u002Ftemplates\u002Fhcl_templates\u002Fblocks\u002Fbuild\u002Fhcp_packer_registry",[73],[1578],{"type":49,"value":1579},"hcp_packer_registry Block",{"type":43,"tag":754,"props":1581,"children":1582},{},[1583],{"type":43,"tag":69,"props":1584,"children":1587},{"href":1585,"rel":1586},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Fhcp\u002Flatest\u002Fdocs\u002Fdata-sources\u002Fpacker_artifact",[73],[1588],{"type":49,"value":1589},"HCP Terraform Provider",{"type":43,"tag":1591,"props":1592,"children":1593},"style",{},[1594],{"type":49,"value":1595},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1597,"total":263},[1598,1613,1625,1640,1654,1666,1680,1690,1705,1712,1724,1735],{"slug":1599,"name":1599,"fn":1600,"description":1601,"org":1602,"tags":1603,"stars":25,"repoUrl":26,"updatedAt":1612},"aws-ami-builder","build Amazon Machine Images with Packer","Build Amazon Machine Images (AMIs) with Packer using the amazon-ebs builder. Use when creating custom AMIs for EC2 instances.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1604,1607,1608,1611],{"name":1605,"slug":1606,"type":15},"AWS","aws",{"name":20,"slug":21,"type":15},{"name":1609,"slug":1610,"type":15},"Infrastructure as Code","infrastructure-as-code",{"name":23,"slug":24,"type":15},"2026-04-06T18:25:04.01571",{"slug":1614,"name":1614,"fn":1615,"description":1616,"org":1617,"tags":1618,"stars":25,"repoUrl":26,"updatedAt":1624},"azure-image-builder","build Azure managed images with Packer","Build Azure managed images and Azure Compute Gallery images with Packer. Use when creating custom images for Azure VMs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1619,1622,1623],{"name":1620,"slug":1621,"type":15},"Azure","azure",{"name":20,"slug":21,"type":15},{"name":23,"slug":24,"type":15},"2026-04-06T18:25:06.590174",{"slug":1626,"name":1626,"fn":1627,"description":1628,"org":1629,"tags":1630,"stars":25,"repoUrl":26,"updatedAt":1639},"azure-verified-modules","develop certified Azure Verified Modules","Azure Verified Modules (AVM) requirements and best practices for developing certified Azure Terraform modules. Use when creating or reviewing Azure modules that need AVM certification.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1631,1632,1635,1636],{"name":1620,"slug":1621,"type":15},{"name":1633,"slug":1634,"type":15},"Compliance","compliance",{"name":1609,"slug":1610,"type":15},{"name":1637,"slug":1638,"type":15},"Terraform","terraform","2026-04-06T18:25:16.88768",{"slug":1641,"name":1641,"fn":1642,"description":1643,"org":1644,"tags":1645,"stars":25,"repoUrl":26,"updatedAt":1653},"new-terraform-provider","scaffold new Terraform providers","Use this when scaffolding a new Terraform provider.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1646,1649,1652],{"name":1647,"slug":1648,"type":15},"Plugin Development","plugin-development",{"name":1650,"slug":1651,"type":15},"Templates","templates",{"name":1637,"slug":1638,"type":15},"2026-04-06T18:25:11.814973",{"slug":1655,"name":1655,"fn":1656,"description":1657,"org":1658,"tags":1659,"stars":25,"repoUrl":26,"updatedAt":1665},"provider-actions","implement Terraform Provider lifecycle actions","Implement Terraform Provider actions using the Plugin Framework. Use when developing imperative operations that execute at lifecycle events (before\u002Fafter create, update, destroy).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1660,1663,1664],{"name":1661,"slug":1662,"type":15},"API Development","api-development",{"name":1647,"slug":1648,"type":15},{"name":1637,"slug":1638,"type":15},"2026-04-06T18:25:07.880533",{"slug":1667,"name":1667,"fn":1668,"description":1669,"org":1670,"tags":1671,"stars":25,"repoUrl":26,"updatedAt":1679},"provider-docs","generate and review Terraform provider documentation","Create, update, and review Terraform provider documentation for Terraform Registry using HashiCorp-recommended patterns, tfplugindocs templates, and schema descriptions. Use when adding or changing provider configuration, resources, data sources, ephemeral resources, list resources, functions, or guides; when validating generated docs; and when troubleshooting missing or incorrect Registry documentation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1672,1675,1678],{"name":1673,"slug":1674,"type":15},"Documentation","documentation",{"name":1676,"slug":1677,"type":15},"Technical Writing","technical-writing",{"name":1637,"slug":1638,"type":15},"2026-04-06T18:25:09.261559",{"slug":1681,"name":1681,"fn":1682,"description":1683,"org":1684,"tags":1685,"stars":25,"repoUrl":26,"updatedAt":1689},"provider-resources","implement Terraform Provider resources and data sources","Implement Terraform Provider resources and data sources using the Plugin Framework. Use when developing CRUD operations, schema design, state management, and acceptance testing for provider resources.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1686,1687,1688],{"name":1661,"slug":1662,"type":15},{"name":1647,"slug":1648,"type":15},{"name":1637,"slug":1638,"type":15},"2026-04-06T18:25:10.56237",{"slug":1691,"name":1691,"fn":1692,"description":1693,"org":1694,"tags":1695,"stars":25,"repoUrl":26,"updatedAt":1704},"provider-test-patterns","implement Terraform provider acceptance test patterns","Terraform provider acceptance test patterns using terraform-plugin-testing with the Plugin Framework. Covers test structure, TestCase\u002FTestStep fields, ConfigStateChecks with custom statecheck.StateCheck implementations, plan checks, CompareValue for cross-step assertions, config helpers, import testing with ImportStateKind, sweepers, and scenario patterns (basic, update, disappears, validation, regression), and ephemeral resource testing with the echoprovider package. Use when writing, reviewing, or debugging provider acceptance tests, including questions about statecheck, plancheck, TestCheckFunc, CheckDestroy, ExpectError, import state verification, ephemeral resources, or how to structure test files.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1696,1697,1700,1701],{"name":1647,"slug":1648,"type":15},{"name":1698,"slug":1699,"type":15},"QA","qa",{"name":1637,"slug":1638,"type":15},{"name":1702,"slug":1703,"type":15},"Testing","testing","2026-04-06T18:25:14.352781",{"slug":4,"name":4,"fn":5,"description":6,"org":1706,"tags":1707,"stars":25,"repoUrl":26,"updatedAt":27},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1708,1709,1710,1711],{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"slug":1713,"name":1713,"fn":1714,"description":1715,"org":1716,"tags":1717,"stars":25,"repoUrl":26,"updatedAt":1723},"refactor-module","refactor Terraform configurations into reusable modules","Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1718,1721,1722],{"name":1719,"slug":1720,"type":15},"Architecture","architecture",{"name":1609,"slug":1610,"type":15},{"name":1637,"slug":1638,"type":15},"2026-04-06T18:25:20.953737",{"slug":1725,"name":1725,"fn":1726,"description":1727,"org":1728,"tags":1729,"stars":25,"repoUrl":26,"updatedAt":1734},"run-acceptance-tests","run acceptance tests for Terraform providers","Guide for running acceptance tests for a Terraform provider. Use this when asked to run an acceptance test or to run a test with the prefix `TestAcc`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1730,1731,1732,1733],{"name":1647,"slug":1648,"type":15},{"name":1698,"slug":1699,"type":15},{"name":1637,"slug":1638,"type":15},{"name":1702,"slug":1703,"type":15},"2026-04-06T18:25:13.098191",{"slug":1736,"name":1736,"fn":1737,"description":1738,"org":1739,"tags":1740,"stars":25,"repoUrl":26,"updatedAt":1747},"terraform-policy","write and test Terraform policy files","Write, test, or convert Terraform Policy files (.policy.hcl, .policytest.hcl, Sentinel→tfpolicy). Triggers: policy.hcl, policytest, convert sentinel, tfpolicy, write a policy.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1741,1742,1743,1746],{"name":1633,"slug":1634,"type":15},{"name":1609,"slug":1610,"type":15},{"name":1744,"slug":1745,"type":15},"Security","security",{"name":1637,"slug":1638,"type":15},"2026-07-18T05:48:20.299442",{"items":1749,"total":255},[1750,1757,1763,1770,1776,1782,1788],{"slug":1599,"name":1599,"fn":1600,"description":1601,"org":1751,"tags":1752,"stars":25,"repoUrl":26,"updatedAt":1612},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1753,1754,1755,1756],{"name":1605,"slug":1606,"type":15},{"name":20,"slug":21,"type":15},{"name":1609,"slug":1610,"type":15},{"name":23,"slug":24,"type":15},{"slug":1614,"name":1614,"fn":1615,"description":1616,"org":1758,"tags":1759,"stars":25,"repoUrl":26,"updatedAt":1624},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1760,1761,1762],{"name":1620,"slug":1621,"type":15},{"name":20,"slug":21,"type":15},{"name":23,"slug":24,"type":15},{"slug":1626,"name":1626,"fn":1627,"description":1628,"org":1764,"tags":1765,"stars":25,"repoUrl":26,"updatedAt":1639},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1766,1767,1768,1769],{"name":1620,"slug":1621,"type":15},{"name":1633,"slug":1634,"type":15},{"name":1609,"slug":1610,"type":15},{"name":1637,"slug":1638,"type":15},{"slug":1641,"name":1641,"fn":1642,"description":1643,"org":1771,"tags":1772,"stars":25,"repoUrl":26,"updatedAt":1653},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1773,1774,1775],{"name":1647,"slug":1648,"type":15},{"name":1650,"slug":1651,"type":15},{"name":1637,"slug":1638,"type":15},{"slug":1655,"name":1655,"fn":1656,"description":1657,"org":1777,"tags":1778,"stars":25,"repoUrl":26,"updatedAt":1665},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1779,1780,1781],{"name":1661,"slug":1662,"type":15},{"name":1647,"slug":1648,"type":15},{"name":1637,"slug":1638,"type":15},{"slug":1667,"name":1667,"fn":1668,"description":1669,"org":1783,"tags":1784,"stars":25,"repoUrl":26,"updatedAt":1679},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1785,1786,1787],{"name":1673,"slug":1674,"type":15},{"name":1676,"slug":1677,"type":15},{"name":1637,"slug":1638,"type":15},{"slug":1681,"name":1681,"fn":1682,"description":1683,"org":1789,"tags":1790,"stars":25,"repoUrl":26,"updatedAt":1689},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1791,1792,1793],{"name":1661,"slug":1662,"type":15},{"name":1647,"slug":1648,"type":15},{"name":1637,"slug":1638,"type":15}]