linux_wiki:terraform

This is an old revision of the document!


Terraform

General Information

“Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.”

Site

Checklist

  • AWS Account

Install Terraform

Installing Terraform on Linux.

  • 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 (public and private subnets), utilizing 3 availability zones in US-West (Oregon).


  • linux_wiki/terraform.1528980930.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)