- Understand about Terraform Modules
- Create VPC using
Terraform Modules
- Define
Input Variables
for VPC module and reference them in VPC Terraform Module - Define
local values
and reference them in VPC Terraform Module - Create
terraform.tfvars
to load variable values by default from this file - Create
vpc.auto.tfvars
to load variable values by default from this file related to a VPC - Define
Output Values
for VPC
# Working Folder
terraform-manifests/v2-vpc-module-standardized
# Terraform Initialize
terraform init
# Terraform Validate
terraform validate
# Terraform plan
terraform plan
# Terraform Apply
terraform apply -auto-approve
Observation:
1) Verify VPC
2) Verify Subnets
3) Verify IGW
4) Verify Public Route for Public Subnets
5) Verify no public route for private subnets
6) Verify NAT Gateway and Elastic IP for NAT Gateway
7) Verify NAT Gateway route for Private Subnets
8) Verify no public route or no NAT Gateway route to Database Subnets
9) Verify Tags
# Terraform Destroy
terraform destroy -auto-approve
# Delete Files
rm -rf .terraform*
rm -rf terraform.tfstate*