1"use strict";(globalThis.webpackChunkwebsite=globalThis.webpackChunkwebsite||[]).push([[9643],{939541(e,a,t){t.r(a),t.d(a,{assets:()=>m,contentTitle:()=>d,default:()=>h,frontMatter:()=>l,metadata:()=>n,toc:()=>u});const n=JSON.parse('{"id":"cli/configuration/components/packer","title":"Packer Configuration","description":"Configure Packer component behavior in atmos.yaml.","source":"@site/docs/cli/configuration/components/packer.mdx","sourceDirName":"cli/configuration/components","slug":"/cli/configuration/components/packer","permalink":"/cli/configuration/components/packer","draft":false,"unlisted":false,"editUrl":"https://github.com/cloudposse/atmos/edit/main/website/docs/cli/configuration/components/packer.mdx","tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"title":"Packer Configuration","sidebar_position":4,"sidebar_label":"packer","sidebar_class_name":"command","id":"packer","description":"Configure Packer component behavior in atmos.yaml."},"sidebar":"cli","previous":{"title":"kubernetes","permalink":"/cli/configuration/components/kubernetes"},"next":{"title":"terraform","permalink":"/cli/configuration/components/terraform"}}');var s=t(886070),c=t(845906),r=t(875658),i=t(178032),o=t(322271);const l={title:"Packer Configuration",sidebar_position:4,sidebar_label:"packer",sidebar_class_name:"command",id:"packer",description:"Configure Packer component behavior in atmos.yaml."},d=void 0,m={},u=[{value:"Configuration",id:"configuration",level:2},{value:"Configuration Reference",id:"configuration-reference",level:2},{value:"Component Directory Structure",id:"component-directory-structure",level:2},{value:"Example Configuration",id:"example-configuration",level:2},{value:"Related Commands",id:"related-commands",level:2},{value:"Related",id:"related",level:2}];function p(e){const a={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,{children:(0,s.jsx)(a.p,{children:"Configure how Atmos executes Packer commands for building machine images,\nincluding AMIs, VM images, and container images."})}),"\n",(0,s.jsx)(a.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(r.A,{title:"atmos.yaml",children:(0,s.jsx)(a.pre,{children:(0,s.jsx)(a.code,{className:"language-yaml",children:"components:\n packer:\n # Executable to run\n command: packer\n\n # Base path to Packer components\n base_path: components/packer\n\n"})})}),"\n",(0,s.jsx)(a.h2,{id:"configuration-reference",children:"Configuration Reference"}),"\n",(0,s.jsxs)("dl",{children:[(0,s.jsx)("dt",{children:(0,s.jsx)(a.code,{children:"command"})}),(0,s.jsxs)("dd",{children:[(0,s.jsxs)(a.p,{children:["Specifies the executable to run for Packer commands. Defaults to ",(0,s.jsx)(a.code,{children:"packer"}),"."]}),(0,s.jsx)(a.p,{children:"Examples:"}),(0,s.jsxs)(a.ul,{children:["\n",(0,s.jsxs)(a.li,{children:[(0,s.jsx)(a.code,{children:"packer"})," - Use Packer from PATH"]}),"\n",(0,s.jsxs)(a.li,{children:[(0,s.jsx)(a.code,{children:"/usr/local/bin/packer"})," - Use specific binary"]}),"\n",(0,s.jsxs)(a.li,{children:[(0,s.jsx)(a.code,{children:"/usr/local/bin/packer-1.9"})," - Use specific version"]}),"\n"]})]}),(0,s.jsx)("dt",{children:(0,s.jsx)(a.code,{children:"base_path"})}),(0,s.jsxs)("dd",{children:[(0,s.jsx)(a.p,{children:"Directory containing Packer component directories. Supports absolute and relative paths."}),(0,s.jsxs)(a.p,{children:["Each subdirectory should contain Packer templates (",(0,s.jsx)(a.code,{children:".pkr.hcl"})," files) for building images."]})]})]}),"\n",(0,s.jsx)(a.h2,{id:"component-directory-structure",children:"Component Directory Structure"}),"\n",(0,s.jsx)(a.p,{children:"Packer components follow the same directory structure as other component types:"}),"\n",(0,s.jsx)(a.pre,{children:(0,s.jsx)(a.code,{children:"\ncomponents/\n\u2514\u2500\u2500 packer/\n\u251c\u2500\u2500 ami-builder/\n\u2502 \u251c\u2500\u2500 main.pkr.hcl\n\u2502 \u2514\u2500\u2500 variables.pkr.hcl\n\u2514\u2500\u2500 docker-image/\n\u251c\u2500\u2500 main.pkr.hcl\n\u2514\u2500\u2500 variables.pkr.hcl\n\n"})}),"\n",(0,s.jsx)(a.h2,{id:"example-configuration",children:"Example Configuration"}),"\n",(0,s.jsx)(r.A,{title:"atmos.yaml",children:(0,s.jsx)(a.pre,{children:(0,s.jsx)(a.code,{className:"language-yaml",children:"components:\n packer:\n command: packer\n base_path: components/packer\n"})})}),"\n",(0,s.jsx)(a.p,{children:"With this configuration, you can run Packer commands through Atmos:"}),"\n",(0,s.jsx)(a.pre,{children:(0,s.jsx)(a.code,{className:"language-bash",children:"# Build an AMI\natmos packer build ami-builder -s prod\n\n# Validate a Packer template\natmos packer validate docker-image -s dev\n"})}),"\n",(0,s.jsx)(a.h2,{id:"related-commands",children:"Related Commands"}),"\n",(0,s.jsx)(o.A,{items:[{type:"link",href:"/cli/commands/packer/usage",label:"atmos packer",description:"Execute Packer commands"},{type:"link",href:"/cli/commands/packer/build",label:"atmos packer build",de
1scription:"Build machine images"},{type:"link",href:"/cli/commands/packer/validate",label:"atmos packer validate",description:"Validate Packer templates"},{type:"link",href:"/cli/commands/packer/init",label:"atmos packer init",description:"Initialize Packer plugins"},{type:"link",href:"/cli/commands/packer/inspect",label:"atmos packer inspect",description:"Inspect Packer templates"}]}),"\n",(0,s.jsx)(a.h2,{id:"related",children:"Related"}),"\n",(0,s.jsxs)(a.ul,{children:["\n",(0,s.jsx)(a.li,{children:(0,s.jsx)(a.a,{href:"/cli/configuration/components",children:"Component Configuration Overview"})}),"\n",(0,s.jsx)(a.li,{children:(0,s.jsx)(a.a,{href:"/components/packer",children:"Packer Components"})}),"\n",(0,s.jsx)(a.li,{children:(0,s.jsx)(a.a,{href:"/cli/configuration/stacks",children:"Stack Configuration"})}),"\n"]})]})}function h(e={}){const{wrapper:a}={...(0,c.R)(),...e.components};return a?(0,s.jsx)(a,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},322271(e,a,t){t.d(a,{A:()=>j});t(830758);var n=t(313526),s=t(339405),c=t(580622),r=t(835118),i=t(479878),o=t(332537);const l={cardContainer:"cardContainer_S8oU",cardTitle:"cardTitle_HoSo",cardIcon:"cardIcon_whke",cardIconCategory:"cardIconCategory_hrze",cardIconLink:"cardIconLink_v4QB",cardIconExternal:"cardIconExternal_Otlb",cardDescription:"cardDescription_c27F"};var d=t(886070);function m({className:e,href:a,children:t}){return(0,d.jsx)(c.A,{href:a,className:(0,n.A)("card padding--lg",l.cardContainer,e),children:t})}function u({kind:e}){return(0,d.jsx)("span",{className:(0,n.A)(l.cardIcon,l[`cardIcon${e}`]),"aria-hidden":"true"})}function p({className:e,href:a,kind:t,title:s,description:c}){return(0,d.jsxs)(m,{href:a,className:e,children:[(0,d.jsxs)("div",{className:(0,n.A)("text--truncate",l.cardTitle),title:s,children:[(0,d.jsx)(u,{kind:t}),(0,d.jsx)("span",{children:s})]}),c&&(0,d.jsx)("p",{className:(0,n.A)("text--truncate",l.cardDescription),title:c,children:c})]})}function h({item:e}){const a=(0,s.Nr)(e),t=function(){const{selectMessage:e}=(0,r.W)();return a=>e(a,(0,o.T)({message:"1 item|{count} items",id:"theme.docs.DocCard.categoryDescription.plurals",description:"The default description for a category card in the generated index about how many items this category includes"},{count:a}))}();return a?(0,d.jsx)(p,{className:e.className,href:a,kind:"Category",title:e.label,description:e.description??t(e.items.length)}):null}function f({item:e}){const a=(0,i.A)(e.href)?"Link":"External",t=(0,s.cC)(e.docId??void 0);return(0,d.jsx)(p,{className:e.className,href:e.href,kind:a,title:e.label,description:e.description??t?.description})}function k({item:e}){switch(e.type){case"link":return(0,d.jsx)(f,{item:e});case"category":return(0,d.jsx)(h,{item:e});default:throw new Error(`unknown item type ${JSON.stringify(e)}`)}}const g="docCardListItem_Pssh";function x({className:e}){const a=(0,s.a4)();return(0,d.jsx)(j,{items:a,className:e})}function y({item:e}){return(0,d.jsx)("article",{className:(0,n.A)(g,"col col--6"),children:(0,d.jsx)(k,{item:e})})}function j(e){const{items:a,className:t}=e;if(!a)return(0,d.jsx)(x,{...e});const c=(0,s.d1)(a);return(0,d.jsx)("section",{className:(0,n.A)("row",t),children:c.map((e,a)=>(0,d.jsx)(y,{item:e},a))})}},835118(e,a,t){t.d(a,{W:()=>l});var n=t(830758),s=t(3250);const c=["zero","one","two","few","many","other"];function r(e){return c.filter(a=>e.includes(a))}const i={locale:"en",pluralForms:r(["one","other"]),select:e=>1===e?"one":"other"};function o(){const{i18n:{currentLocale:e}}=(0,s.A)();return(0,n.useMemo)(()=>{try{return function(e){const a=new Intl.PluralRules(e);return{locale:e,pluralForms:r(a.resolvedOptions().pluralCategories),select:e=>a.select(e)}}(e)}catch(a){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${a.message}\n`),i}},[e])}function l(){const e=o();return{selectMessage:(a,t)=>function(e,a,t){const n=e.split("|");if(1===n.length)return n[0];n.length>t.pluralForms.length&&console.error(`For locale=${t.locale}, a maximum of ${t.pluralForms.length} plural forms are expected (${t.pluralForms.join(",")}), but the message contains ${n.length}: ${e}`);const s=t.select(a),c=t.pluralForms.indexOf(s);return n[Math.min(c,n.length-1)]}(t,a,e)}}},875658(e,a,t){t.d(a,{A:()=>x});t(830758);var n=t(580622),s=t(325557),c=t(68068),r=t(896811),i=t(913756),o=t(105652),l=t(735910),d=t(387332),m=t(102980),u=t(485962),p=t(445907),h=t(58127),f=t(886070);l.Yv.add(d.Cvc,m.X7I,u.C91);const k={file:m.A4h,folder:m.ao0,image:m.Cyq,stack:m.qIE,component:m.br3,config:m.BH7,code:m.o97,hcl:m.o97,yaml:m.o97,json:m.o97},g={yaml:r.WDB};function x({title:e,className:a,type:t,icon:r,size:l="1x",children:d}){const u=t||(e=>/\.tf\.json$/i.test(e)?"code":/atmos\.ya?ml$/i.test(e)?"yaml":/.*stack.*\.ya?ml$/i.test(e)?"stack":/\.ya?ml$/i.test(e)?"yaml":/\.json$/i.test(e)?"json":/\.tf$/i.test(e)?"hcl":/\/$/i.test(e)?"folder":"file")(e),x=r||k[u]||m.A4h,y=r?null:g[u],{pathname:j}=(0,s.zy)(),b=(0,h.A)(j),v=(0,c.Ay)(),w=v["file-browser"]?.examples,C=b&&w?.examples?(0,p.q1)(w.examples,b.exampleName):void 0,$=b?((e,a)=>!e||/\/$/i.test(e)?null:e.startsWith("examples/")?e.slice(9):e.startsWith(`${a}/`)?e:`${a}/${e}`)(e,b.exampleName):null,A=$&&C?(0,p.MB)(C.root,$):null,E=A&&w?.options?.routeBasePath?`${w.options.routeBasePath}/${$}`:null;return(0,f.jsx)("div",{className:a,children:(0,f.jsxs)("div",{className:"file",children:[(0,f.jsxs)("div",{className:"file-header",children:[(0,f.jsxs)("div",{className:"file-title",children:[y?(0,f.jsx)(y,{className:`file-type-icon file-type-icon--${u}`,"aria-hidden":"true"}):(0,f.jsx)(o.g,{icon:x,size:l}),E?(0,f.jsx)(n.A,{to:E,title:`Open ${e} in the example browser`,children:e}):(0,f.jsx)("span",{children:e})]}),A&&E&&(0,f.jsxs)("div",{className:"file-actions",children:[(0,f.jsx)(n.A,{to:E,className:"file-action-button",title:`Open ${e} in the example browser`,"aria-label":`Open ${e} in the example browser`,children:(0,f.jsx)(i.ZQn,{"aria-hidden":"true"})}),(0,f.jsx)("button",{type:"button",className:"file-action-button",onClick:()=>{$&&"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("quick-start-example-drawer:open",{detail:{path:$}}))},title:`Open ${e} in the example drawer`,"aria-label":`Open ${e} in the example drawer`,children:(0,f.jsx)(i.YI5,{"aria-hidden":"true"})})]})]}),(0,f.jsx)("div",{className:"viewport",children:d})]})})}},445907(e,a,t){t.d(a,{Fp:()=>u,I3:()=>c,MB:()=>i,VV:()=>l,YY:()=>m,e$:()=>d,q1:()=>o,v7:()=>r});var n=t(102980);const s={file:n.A4h,folder:n.ao0,folderOpen:n.Uj9,config:n.BH7,code:n.o97,stack:n.qIE,component:n.br3,hcl:n.ruc,yaml:n.o97,json:n.jTw,markdown:n.bLf,image:n.Cyq,lock:n.DW4,shell:n.MNM,docker:n.THi};function c(e,a=!1){if("directory"===e.type)return a?s.folderOpen:s.folder;const{name:t,extension:n}=e,c=t.toLowerCase();if(/^atmos\.ya?ml$/i.test(c))return s.config;if(/.*stack.*\.ya?ml$/i.test(c))return s.stack;if("dockerfile"===c)return s.docker;if("makefile"===c)return s.shell;if(c.endsWith(".lock"))return s.lock;if(c.endsWith(".sh")||c.endsWith(".bash"))return s.shell;switch(n.toLowerCase()){case"tf":case"hcl":return s.hcl;case"yaml":case"yml":return s.yaml;case"json":return s.json;case"md":case"mdx":return s.markdown;case"png":case"jpg":case"jpeg":case"gif":case"svg":case"webp":return s.image;default:return s.file}}function r(e){if(0===e)return"0 B";const a=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,a)).toFixed(a>0?1:0)} ${["B","KB","MB","GB"][a]}`}function i(e,a){if(e.path===a)return e;for(const t of e.children){if(t.path===a)return t;if("directory"===t.type){const e=i(t,a);if(e)return e}}return null}function o(e,a){return e.find(e=>e.name===a)}
1function l(e){return e.split("/").filter(Boolean)[0]||""}function d(e){const a=e.extension.toLowerCase();return"md"===a||"mdx"===a}function m(e){return["png","jpg","jpeg","gif","svg","webp","ico","pdf","zip","tar","gz","exe","dll","so","dylib","bin","dat"].includes(e.extension.toLowerCase())}function u(e){const a=[],t=e.readme?.path,n=e=>{if(null==e.content||m(e))return;const t=e.content.trim(),n=d(e)?t:function(e,a){const t=Math.max(0,...(e.match(/`+/g)??[]).map(e=>e.length)),n="`".repeat(Math.max(3,t+1));return`${n}${a}\n${e}\n${n}`}(t,e.language);a.push(`## ${e.path}\n\n${n}`)},s=e=>{"directory"===e.type?e.children.forEach(s):e.path!==t&&n(e)};return e.readme&&n(e.readme),s(e),a.join("\n\n---\n\n")}},178032(e,a,t){t(830758);var n=t(886070);const s=({children:e})=>(0,n.jsx)("div",{className:"intro",children:e});t.d(a,["A",0,s])},58127(e,a,t){function n(e,a){return`${e}/${a}`}function s(e,a,t,s=[]){return{route:e,exampleName:a,selectedPath:n(a,t),relatedPaths:s.map(e=>n(a,e))}}t.d(a,{A:()=>o});const c="quick-start-simple",r="quick-start-advanced",i=[s("/quick-start/simple/configure-cli",c,"atmos.yaml"),s("/quick-start/simple/configure-project",c,"README.md",["atmos.yaml"]),s("/quick-start/simple/write-components",c,"components/terraform/weather/main.tf",["components/terraform/weather/variables.tf","components/terraform/weather/main.tf","components/terraform/weather/versions.tf","components/terraform/weather/outputs.tf"]),s("/quick-start/simple/configure-stacks",c,"stacks/catalog/station.yaml",["stacks/catalog/station.yaml","stacks/deploy/dev.yaml","stacks/deploy/staging.yaml","stacks/deploy/prod.yaml"]),s("/quick-start/simple/provision",c,"README.md",["README.md","stacks/deploy/dev.yaml"]),s("/quick-start/simple/summary",c,"README.md"),s("/quick-start/simple/extra-credit/add-another-component",c,"stacks/deploy/dev.yaml",["stacks/deploy/dev.yaml","stacks/catalog/station.yaml"]),s("/quick-start/simple/extra-credit/add-custom-commands",c,"atmos.yaml"),s("/quick-start/simple/extra-credit/create-workflows",c,"atmos.yaml"),s("/quick-start/simple/extra-credit/vendor-components",c,"README.md"),s("/quick-start/simple/extra-credit",c,"README.md"),s("/quick-start/simple",c,"README.md"),s("/quick-start/advanced/configure-project",r,"atmos.yaml"),s("/quick-start/advanced/install-toolchain",r,".tool-versions",[".tool-versions",".atmos.d/test.yaml","atmos.yaml"]),s("/quick-start/advanced/start-sandbox",r,"stacks/catalog/emulator/aws.yaml",["stacks/catalog/emulator/aws.yaml","atmos.yaml"]),s("/quick-start/advanced/create-atmos-stacks",r,"stacks/catalog/backend.yaml",["stacks/catalog/kms-key/defaults.yaml","stacks/catalog/s3-bucket/defaults.yaml","stacks/catalog/dynamodb-table/defaults.yaml","stacks/catalog/sns-topic/defaults.yaml","stacks/catalog/sqs-queue/defaults.yaml","stacks/catalog/app-config/defaults.yaml","stacks/catalog/backend.yaml","stacks/mixins/tenant/plat.yaml","stacks/mixins/region/us-east-2.yaml","stacks/mixins/stage/dev.yaml","stacks/orgs/acme/plat/dev/us-east-2.yaml"]),s("/quick-start/advanced/configure-hooks",r,"stacks/orgs/acme/_defaults.yaml",["stacks/orgs/acme/_defaults.yaml","stacks/catalog/s3-bucket/defaults.yaml","atmos.yaml"]),s("/quick-start/advanced/configure-secrets",r,"stacks/catalog/app-config/defaults.yaml",["stacks/catalog/app-config/defaults.yaml","atmos.yaml"]),s("/quick-start/advanced/configure-validation",r,"stacks/schemas/jsonschema/s3-bucket/validate-s3-bucket-component.json",["atmos.yaml","stacks/catalog/s3-bucket/defaults.yaml","stacks/schemas/jsonschema/s3-bucket/validate-s3-bucket-component.json","stacks/schemas/opa/s3-bucket/validate-s3-bucket-component.rego"]),s("/quick-start/advanced/provision",r,"README.md",["README.md","atmos.yaml","stacks/catalog/backend.yaml"]),s("/quick-start/advanced/create-workflows",r,"stacks/workflows/backend.yaml"),s("/quick-start/advanced/add-custom-commands",r,"atmos.yaml"),s("/quick-start/advanced/vendor-components",r,"vendor.yaml"),s("/quick-start/advanced/configure-terraform-backend",r,"atmos.yaml",["atmos.yaml","stacks/catalog/s3-bucket/defaults.yaml","stacks/orgs/acme/_defaults.yaml","stacks/orgs/acme/plat/dev/_defaults.yaml"]),s("/quick-start/advanced/final-notes",r,"README.md"),s("/quick-start/advanced/next-steps",r,"README.md"),s("/quick-start/advanced",r,"README.md")];function o(e){const a=function(e){const a=e.split(/[?#]/)[0]||"/";return a.length>1?a.replace(/\/+$/,""):a}(e),t=i.slice().sort((e,a)=>a.route.length-e.route.length).find(e=>function(e,a){return e===a||e.startsWith(`${a}/`)}(a,e.route));return t?{exampleName:t.exampleName,selectedPath:t.selectedPath,relatedPaths:t.relatedPaths?.length?t.relatedPaths:[t.selectedPath]}:null}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.