resource "aws_vpc" "vpc" { cidr_block = "10.0.0.0/24" tags = { Name = "${var.prefix}-fargate-vpc" } } resource "aws_internet_gateway" "igw" { vpc_id = aws_vpc.vpc.id tags = { Name = "${var.prefix}-fargate-igw" } } resource "aws_route_table" "route_table" { vpc_id = aws_vpc.vpc.id route { cidr_block = "0.0.0.0/0" gateway_id = aws_internet_gateway.igw.id } tags = { Name = "${var.prefix}-fargate-route-table" } } data "aws_availability_zones" "available" { state = "available" } resource "aws_subnet" "subnet_1" { vpc_id = aws_vpc.vpc.id cidr_block = "10.0.0.0/25" map_public_ip_on_launch = true availability_zone = data.aws_availability_zones.available.names[0] tags = { Name = "${var.prefix}-fargate-subnet-1" } } resource "aws_subnet" "subnet_2" { vpc_id = aws_vpc.vpc.id cidr_block = "10.0.0.128/25" map_public_ip_on_launch = true availability_zone = data.aws_availability_zones.available.names[1] tags = { Name = "${var.prefix}-fargate-subnet-2" } } resource "aws_route_table_association" "rt_subnet_1" { subnet_id = aws_subnet.subnet_1.id route_table_id = aws_route_table.route_table.id } resource "aws_route_table_association" "rt_subnet_2" { subnet_id = aws_subnet.subnet_2.id route_table_id = aws_route_table.route_table.id } output "agentone_vpc" { value = aws_vpc.vpc.id } output "agentone_subnet_1" { value = aws_subnet.subnet_1.id } output "agentone_subnet_2" { value = aws_subnet.subnet_2.id }