Skip to content

Deploy WhaleOps related products on cloud ☁️ easier.

Notifications You must be signed in to change notification settings

WhaleOps/packer_tmpl

Repository files navigation

Packer Template

Packer is an open source tool that enables you to create identical machine images for multiple platforms from a single source template.

What Template This Repository Have

How To Build With Packer

Install Packer

See install packer about how to install packer.

Build Image

We here using template in examples/aws-ubuntu.pkr.hcl as example

# export AWS key and secret
export AWS_ACCESS_KEY_ID="<YOUR_AWS_ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<YOUR_AWS_SECRET_ACCESS_KEY>"

cd examples
packer init .
packer build aws-ubuntu.pkr.hcl

For more detail you can see Build an Image

FAQ

AWS AMI

Error: AMI Name: '[NAME-OF-YOUR-AMI]' is used by an existing AMI: '[ID-OF-YOUR-AMI]'

It means your AMI with name '[NAME-OF-YOUR-AMI]' already exists in your AMIs (some time you have your region to find the exists AMIs). In this case you should:

  • Remove exists AMIs: remove exists AMI with name '[NAME-OF-YOUR-AMI]', ref to deregister-ami if you want to see more detail.
  • Rename your ami_name attribute in your *.pkr.hcl: rename the attribute in your *.pkr.hcl file to not exists name.