# VPC Private and public subnets in two Availability Zones. Add NAT, routes and endpoints as the design needs. ```hcl variable "zones" { type = list(string) } resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" enable_dns_hostnames = true enable_dns_support = true } resource "aws_subnet" "private" { count = 2 vpc_id = aws_vpc.main.id availability_zone = var.zones[count.index] cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 4, count.index) } resource "aws_flow_log" "main" { vpc_id = aws_vpc.main.id traffic_type = "ALL" log_destination_type = "cloud-watch-logs" log_destination = aws_cloudwatch_log_group.flow.arn iam_role_arn = var.flow_log_role_arn } variable "flow_log_role_arn" { type = string } resource "aws_cloudwatch_log_group" "flow" { name = "/vpc/flow" retention_in_days = 90 } ```