This is an old revision of the document!
Terraform
General Information
Terraform allows you to “write, plan, and create infrastructure as code”.
Site: https://www.terraform.io/
Checklist
- AWS Account
Install Terraform
Installing Terraform on Linux.
- Visit downloads page: https://www.terraform.io/downloads.html
- Copy download link
- On Linux server, wget the link to download (example link)
wget https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip
- Unzip single binary, move into /usr/local/bin
unzip terraform_0.11.7_linux_amd64.zip mv terraform /usr/local/bin/
- Verify
terraform --version
Configure AWS Credentials for Use
- Login to your AWS account, create access keys for CLI use and download the file.
- Create an AWS credentials file in your home directory
vim ~/.aws/credentials # AWS Credentials [default] aws_access_key_id = "access-key-id-here" aws_secret_access_key = "secret-key-here"
- The profile name is “default” and can now be referenced in the terraform config files.
- Lock down permissions
chmod 600 ~/.aws/credentials
Terraform Example: 2 Tier VPC
Creating a 2-tier VPC, utilizing 3 availability zones in US-West (Oregon).