forked from jenkins-infra/aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc.tf
45 lines (37 loc) · 1.29 KB
/
vpc.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
data "aws_availability_zones" "available" {}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.1.0"
name = "${local.cik8s_cluster_name}-vpc"
cidr = "10.0.0.0/16"
manage_default_network_acl = false
map_public_ip_on_launch = true
manage_default_route_table = false
manage_default_security_group = false
azs = data.aws_availability_zones.available.names
private_subnets = [
# first for eks-cluster
"10.0.16.0/20", # 10.0.16.1 -> 10.0.31.254
"10.0.32.0/20", # 10.0.32.1 -> 10.0.47.254
"10.0.64.0/20", # 10.0.64.1 -> 10.0.79.254
# next for eks-public
"10.0.80.0/24", # 10.0.80.1 -> 10.0.80.254
"10.0.81.0/24", # 10.0.81.1 -> 10.0.81.254
"10.0.82.0/24", # 10.0.82.1 -> 10.0.82.254
]
public_subnets = [
# first for vpc's Elastic IPs
"10.0.0.16/28", # 10.0.0.17 -> 10.0.0.30
"10.0.0.32/28", # 10.0.0.33 -> 10.0.0.46
"10.0.0.48/28", # 10.0.0.49 -> 10.0.0.62
]
# One NAT gateway per subnet (default)
# ref. https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest#one-nat-gateway-per-subnet-default
enable_nat_gateway = true
single_nat_gateway = false
one_nat_gateway_per_az = false
enable_dns_hostnames = true
public_subnet_tags = {
"kubernetes.io/role/elb" = 1
}
}