$ terraform init
$ terraform plan
$ terraform apply
Terraform cloud can be used for remote backend as well as running the terraform scripts at cloud.
In this homework exercise, Terraform Cloud is being setup as remote backend only to store the tfstate. The terraform scripts are executed locally. This is because the own public ip address (myip) is generated dynamically using website http://ipv4.icanhazip.com for use to generate security group (sg_22) resource. If we run the terraform scripts remotely,myip will end up being Terraform Cloud's public ip address.
terraform {
backend "remote" {
organization = "james-sutd"
workspaces {
name = "devtools-hw-day4"
}
}
}
Login to terraform cloud
$ terraform login
$ terraform destroy