aws configure
terraform init # Initialize project
terraform plan # Check difference
terraform apply # Create resources
terraform destroy # Destroy resources
# It won't ask for confirmation to create resources
terraform apply -auto-approve
dep
lesson about dependenciescount-demo
andcount-advc
are lessons about how to create multiple ec2 instances, for examplevars
lesson about how to setup differently test and prod environments using same terraform filesterraform plan -var-file=test.tfvars terraform plan -var-file=prod.tfvars # And to apply use terraform apply -var-file=prod.tfvars
import
about importing a resource that's already on AWS and you want terraform to control it# For example vpc-020dc6ade3c71871e is the id of a VPC already created terraform import aws_vpc.myvpc2 vpc-020dc6ade3c71871e # When you do terraform destroy # it will destroy the two VPCs