Reliable way to create and provision an AWS AMI with Packer, Ansible & Terraform (others Nix, Taskfile, AWSCLI)
Is highly recommended have Nix installed, otherwise you will need manually install: Packer, Ansible, Terraform and Taskfile and AWSCLI
- First, clone this repository:
git clone https://github.com/nietzscheson/terrami && cd terrami
- Export the environment vars:
export AWS_ACCESS_KEY_ID=your-credentials
export AWS_SECRET_ACCESS_KEY=your-credentials
export AWS_DEFAULT_REGION=us-east-2
export AWS_CLI_AUTO_PROMPT=on
export NIXPKGS_ALLOW_UNFREE=1
- Start the Nix-shell:
nix-shell
- Check all the Taskfile commands:
task --list
task: Available tasks for this project:
* ansible.check: Check the Ansible Playbook
* aws.sts: Who am I in AWS
* packer.build: Build the Packer Image
* packer.format: Format the Packer Template
* packer.validate: Validate the Packer Template
* terraform.apply: Apply the Terraform Deployment
* terraform.destroy: Destroy the Terraform Deployment
* terraform.format: Format the Terraform Code
* terraform.plan: Plan the Terraform Deployment
* terraform.validate: Validate the Terraform Code