VPC Lattice Terraform Infrastructure
This directory contains Terraform modules and configurations for demonstrating AWS VPC Lattice service-to-service communication.
๐ Directory Structure
terraform/
โโโ main.tf # Root Terraform configuration
โโโ outputs.tf # Root module outputs
โโโ local.tf # Local values and data sources
โโโ versions.tf # Terraform and provider version constraints
โโโ modules/
โโโ vpc/ # VPC module (3 VPCs: client, app1, app2)
โโโ ec2/ # EC2 notifications service
โโโ ec2_web_server/ # EC2 web server for VPC Lattice demo
โโโ ecs_fargate/ # ECS Fargate analytics service
โโโ lambda/ # Lambda functions
โโโ vpc_lattice/ # VPC Lattice service network and services
๐ Quick Start
1. Initialize Terraform
cd terraform
terraform init
2. Review the configuration
terraform plan
3. Deploy the infrastructure
terraform apply
๐๏ธ Architecture Overview
This Terraform configuration creates a complete VPC Lattice demonstration environment:
- 3 VPCs: Client, App1, and App2 VPCs for multi-VPC communication
- EC2 Instances: Web servers and notification services
- ECS Fargate: Containerized analytics service
- VPC Lattice: Service network connecting all services
- Lambda Functions: Serverless components
๐ Prerequisites
- AWS CLI configured with appropriate permissions
- Terraform >= 1.3
- AWS Provider >= 6.0
๐ Outputs
After deployment, you'll get:
- VPC IDs and CIDR blocks
- EC2 instance details
- ECS service endpoints
- VPC Lattice service network information
๐งน Cleanup
To destroy all resources:
terraform destroy