Skip to main content

atmos packer

Packer
Purpose

Use these subcommands to interact with HashiCorp Packer to build automated machine images.

Usage

atmos packer <sub-command> <atmos-component> --stack <atmos-stack> [atmos-flags] -- [packer-options]
tip

For more details on the Packer commands and options, refer to Packer Commands.

Atmos Flags

--stack (alias -s)

Atmos stack.

--template (alias -t)(optional)

Packer template. It can be specified in the settings.packer.template section in the Atmos component manifest, or on the command line via the flag --template <template> (shorthand -t). The command line flag takes precedence over settings.packer.template.

--query (alias -q)(optional)

YQ expression to get sections and attributes from a Packer manifest. Used in the atmos packer output command.

Examples

atmos packer version

atmos packer validate aws/bastion --stack prod
atmos packer validate aws/bastion -s prod --template main.pkr.hcl
atmos packer validate aws/bastion -s nonprod -t main.nonprod.pkr.hcl

atmos packer inspect aws/bastion -s prod
atmos packer inspect aws/bastion -s prod --template main.pkr.hcl
atmos packer inspect aws/bastion -s nonprod -t main.nonprod.pkr.hcl

atmos packer init aws/bastion -s prod
atmos packer init aws/bastion -s prod --template main.pkr.hcl
atmos packer init aws/bastion -s nonprod -t main.nonprod.pkr.hcl

atmos packer build aws/bastion -s prod
atmos packer build aws/bastion -s prod --template main.pkr.hcl
atmos packer build aws/bastion -s nonprod -t main.nonprod.pkr.hcl

atmos packer output aws/bastion -s prod
atmos packer output aws/bastion -s prod --query '.builds[0].artifact_id'
atmos packer output aws/bastion -s prod -q '.builds[0].artifact_id | split(":")[1]'

Subcommands