k8s-cluster/terraform/testbed/modules/main/vpc.tf

40 lines
1.1 KiB
Terraform
Raw Normal View History

2024-05-17 22:03:38 -04:00
module "vpc" {
source = "../vpc"
name = "Kubernetes"
cidr = "10.0.0.0/16"
azs = ["us-east-2a", "us-east-2b", "us-east-2c"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
public_subnets = ["10.0.11.0/24", "10.0.12.0/24", "10.0.13.0/24"]
database_subnets = ["10.0.21.0/24", "10.0.22.0/24", "10.0.23.0/24"]
public_subnet_tags = {
Name = "${terraform.workspace}-public-subnet"
"kubernetes.io/cluster/${var.eks_cluster_name}-${terraform.workspace}" = "shared"
"kubernetes.io/role/elb" = 1
Environment = terraform.workspace
}
private_subnet_tags = {
Name = "${terraform.workspace}-private-subnet"
"kubernetes.io/cluster/${var.eks_cluster_name}-${terraform.workspace}" = "shared"
"kubernetes.io/role/internal-elb" = 1
Environment = terraform.workspace
}
enable_nat_gateway = true
single_nat_gateway = true
one_nat_gateway_per_az = false
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "${var.vpc_name}-${terraform.workspace}"
"kubernetes.io/cluster/${var.eks_cluster_name}" = "shared"
}
}