Skip to content

Contains some packer configurations I use from time to time

License

Notifications You must be signed in to change notification settings

yiskaneto/iac_packer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Packer Configuration

Contains packer configurations

Folder Structure

  1. Have the following folder structure for each project:

    project_folder:
      - scripts/script_<purpose>.sh
      - ansible/playbook.yaml
      - builder.pkr.hcl
      - plugins.pkr.hcl
      - sources.pkr.hcl
      - variables.pkr.hcl

Important notes

  1. Requirements:

    1. Make sure to declare the AWS_REGION enviroment variable before continuing.
  2. If developing locally then run the following commands to ensure the required plugins are installed (see the packer block on the plugins.pkr.hcl file whithin the project folder):

    1. cd <project_name>
    2. packer init plugins.pkr.hcl
  3. Always set the value if the SKIP_CREATE_AMI environment variable to true before running validate and build, once the test goes ok set the value to false

  4. Use the -debug flag in case you need to inspect each step.

Workflow

  1. Init and Verify
time packer init .
time packer fmt .
export SKIP_CREATE_AMI=true && packer validate -var aws_region=${AWS_REGION} .
time packer validate .
  1. Build:
export SKIP_CREATE_AMI=false && time packer build .

About

Contains some packer configurations I use from time to time

Resources

License

Stars

Watchers

Forks

Packages

No packages published