follow the guide from official documentation to download terraform -
https://www.terraform.io/docs/cli/install/apt.html
- Initialize terraform directory:
Do terraform init
in directories: ec2
,iam
,networking
,RDS
,s3
,SecurityGroups
- To get the setup for terraform apply:
terraform plan
Open the terminal in the networking
directory, then:
- To create resources:
terraform apply -var-file="./variables.tfvars"
By default if the variables are not provided: region=us-east-1
, profile=dev
, vpc_name=csye6225
- To destroy resources:
terraform destroy -var-file="./variables.tfvars"
Open the terminal in the SecurityGroups
directory, then:
- To create resources:
terraform apply -var-file="./variables.tfvars"
- To destroy resources:
terraform destroy -var-file="./variables.tfvars"
Open the terminal in the iam
directory, then:
- To create resources:
terraform apply -var-file="./variables.tfvars"
- To destroy resources:
terraform destroy -var-file="./variables.tfvars"
Open the terminals in the s3
and RDS
directory, then:
- To create resources:
terraform apply -var-file="./variables.tfvars"
- To destroy resources:
terraform destroy -var-file="./variables.tfvars"
Open the terminal in the ec2
directory, then:
- To create resources:
terraform apply -var-file="./variables.tfvars"
- To destroy resources:
terraform destroy -var-file="./variables.tfvars"