Setup terraform provider plugins:
terraform init
Plan all the things to be deployed:
terraform plan
Apply on cloud:
terraform apply
terraform apply -auto-approve
apply with variable:
terraform apply -var "subnet_cidr_block=10.0.10.0/24"
apply with variables file:
terraform apply -var-file terraform-prod.tfvars
List current state of the resources created by terraform:
terraform state list
check the state of a specific resource:
terraform state show aws_vpc.development-vpc
delete a specific resource from cloud provider:
terraform destroy --target aws_subnet.dev-subnet-2
delete everything:
terraform destroy
terraform destroy -auto-approve
pull tf state from s3:
terraform state pull