Terraform

  • Installation (Windows)
    • Download executable
    • Copy executable to Terraform directory
    • Configure environment variable
    • Confirm Terraform is installed
  • Configure a text editor (Visual Studio Code)
    • Install Terraform extension
  • Create project folder
    • Open folder in Visual Studio Code
    • Create new file (main.tf)
      • Configure provider
      • Configure authentication
      • Create a sample code of syntax for resource provision
      • Provision an EC2 instance
        • Execute terraform init
        • Execute terraform plan
        • Execute terraform apply
        • Verify in console
        • Execute terraform apply
        • Execute terraform plan
        • Add tag
        • Execute terraform plan
        • Execute terraform apply
        • Verify in console
        • Execute terraform destroy
        • Verify in console
        • Execute terraform apply
        • Verify in console
        • Comment out EC2 provisioning
        • Execute terraform apply
        • Verify in console
      • Reference a Resource
        • Execute terraform destroy
        • Verify in console
        • Provision VPC
        • Provision subnet within VPC
        • Execute terraform plan
        • Execute terraform apply
        • Verify in console
        • Execute terraform destroy
        • Verify in console
      • Terraform Files
        • Delete .terraform/providers in text editor
        • Execute terraform apply
        • Execute terraform init
        • Verify .terraform folder in text editor
        • View the state file
        • Provision additional VPC and subnet
        • Execute terraform plan
        • Execute terraform apply
        • View the state file
      • Web Server Project
        • Create key pair (manually)
        • Provision VPC
        • Provision Internet Gateway
        • Provision route table
        • Provision a subnet
        • Associate subnet with route table
        • Provision Security Group
        • Provision EC2 instance
      • Terraform State Commands
        • List the resources in the state
        • View detailed data on resource in state
      • Terraform Output
        • Output the public IP of an EC2 instance
        • Output the public DNS of an EC2 instance
        • Verify existing output
        • View added output
      • Target Resources
        • Destroy the EC2 instance, only
        • Launch the EC2 instance, only
      • Terraform Variables
        • Create a variable (subnet)
        • Verify in console
        • Enter value of variable using command line argument
        • Verify in console
        • Create file to define variables
        • Verify in console
        • Execute terraform destroy
        • Change name of file to define variables
        • Execute terraform apply and specify variable file
        • Assign default value to variable