Packer Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 33: Line 33:


  packer build <''template-name''>.json
  packer build <''template-name''>.json
==Debug==
-debug

Revision as of 17:56, 2 July 2020

Internal

Build an Amazon EC2 AMI

Credentials

Amazon credentials can be provided in the template (not recommended) or as environment variables in the context packer is executed:

export AWS_ACCESS_KEY_ID="anaccesskey"
$ export AWS_SECRET_ACCESS_KEY="asecretkey"
$ export AWS_DEFAULT_REGION="us-west-2"

or in ~/.aws/credentials file. To specify a specific profile in the file, set "AWS_PROFILE" environment variable or use insert this in the template, in the corresponding builder block:

{
  "profile": "customprofile",
  ...
}

then

packer build ...

Build

packer build <template-name>.json

Debug

-debug