tech-docs

Terraform

Background

Terraform - Official home page

Terraform vs. Custom Solutions - Benefits of Terraform vs custom solution

Cheat Sheet

Installation

Download package:

mkdir terraform
cd terraform/
wget https://releases.hashicorp.com/terraform/0.12.6/terraform_0.12.6_linux_amd64.zip
unzip terraform_0.12.6_linux_amd64.zip

Add to path:

vi .bashrc
PATH=$PATH:$HOME/terraform

Edit ~/.vimrc

syntax on

colorscheme desert

Usage

Initialisation:

terraform init

Edit script:

vi test.tf

Basic commands:

terraform plan
terraform apply
terraform show
terraform destroy

AWS

Introduction

Introduction to AWS With Terraform - Hacknoon blog

Elastic IP Example - AWS example from Terraform

Best Practices

terraform-best-practices - Nice project on GitHub

VPC

VPC - Provides a VPC resource

EC2

EC2 Instance - Provides an EC2 instance resource

TODO

https://www.terraform.io/docs/providers/aws/r/instance.html

Reference

Miscellaneous

Output Variables - Outputs are a way to tell Terraform what data is important

Local Values - Avoid repeated values in script