Terraform script to create VPC, Security Group, Elastic IP, and EC2 in various environments (prod and dev) on AWS
dev
environment/workspaceregion
->ap-southeast-1
(Singapore)
prod
environment/workspaceregion
->ap-southeast-2
(Sydney)
aws configure
git clone https://github.com/raykrishardi/terraform-aws-vpc-sg-eip-ec2-env.git
cd terraform-aws-vpc-sg-eip-ec2-env
terraform init
terraform workspace new dev
terraform apply -var-file environments/dev.tfvars
terraform workspace new prod
terraform apply -var-file environments/prod.tfvars
terraform workspace select dev
terraform destroy -var-file environments/dev.tfvars
terraform workspace select prod
terraform destroy -var-file environments/prod.tfvars