VPC Networking - Part 3

cd ~/environment/terraform/modules/tf-vpc

## Initialize Terraform
terraform init

## Format code, validate syntax & check security issues
terraform fmt
terraform validate

## Terraform "plan" what it is going to do
terraform plan -out tfplan

## Build the VPC
terraform apply tfplan

## Destroy what we have created !!!
# terraform destroy -auto-approve
✍️ Understanding order and dependancies
🎯 variables.tf >> Terraform variables
πŸš€ main.tf
πŸš€ subnets.tf >> Terraform

Go to the AWS console as before and find:

  • βœ… The new VPC
  • βœ… New subnets
  • βœ… Observe the relevant routing table entries for the public and private subnets
  • βœ… Is there a new instance running ?