-
Notifications
You must be signed in to change notification settings - Fork 5
/
subnet_traefik.tf
74 lines (65 loc) · 1.98 KB
/
subnet_traefik.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
###### VARIABLES ######
variable "traefik_aws_pub_cidrs" {
type = "list"
description = "List of traefik aws public subnet CIDR's"
}
variable "traefik_aws_prv_cidrs" {
type = "list"
description = "List of traefik aws private subnet CIDR's"
}
variable "traefik_k8s_prv_cidrs" {
type = "list"
description = "List of traefik k8s private subnet CIDR's"
}
###### SUBNETS ######
module "traefik_aws_pub" {
source = "./modules/aws_tf_module_subnet"
vpc_id = "${module.vpc.vpc_id}"
name = "${local.name}_traefik_aws"
cidrs = "${var.traefik_aws_pub_cidrs}"
availability_zones = "${var.availability_zones}"
tier = "pub"
public = true
tags = "${local.tags}"
region = "${var.aws_region}"
}
module "traefik_aws_prv" {
source = "./modules/aws_tf_module_subnet"
vpc_id = "${module.vpc.vpc_id}"
name = "${local.name}_traefik_aws"
cidrs = "${var.traefik_aws_prv_cidrs}"
availability_zones = "${var.availability_zones}"
tier = "prv"
public = false
tags = "${local.tags}"
region = "${var.aws_region}"
}
module "traefik_k8s_prv" {
source = "./modules/aws_tf_module_subnet"
vpc_id = "${module.vpc.vpc_id}"
name = "${local.name}_traefik_k8s"
cidrs = "${var.traefik_k8s_prv_cidrs}"
availability_zones = "${var.availability_zones}"
tier = "prv"
public = false
region = "${var.aws_region}"
tags = "${
map(
"Name", "${var.env}_traefik_k8s",
"Environment", "${var.env}",
"kubernetes.io/cluster/${var.cluster_defaults["name"]}", "shared"
)
}"
}
# /*
resource "aws_route_table_association" "traefik_aws_prv" {
count = "${var.private_zones_count}"
subnet_id = "${element(module.traefik_aws_prv.ids, count.index)}"
route_table_id = "${element(module.nat_gateway.ids, count.index)}"
}
resource "aws_route_table_association" "traefik_k8s_prv" {
count = "${var.private_zones_count}"
subnet_id = "${element(module.traefik_k8s_prv.ids, count.index)}"
route_table_id = "${element(module.nat_gateway.ids, count.index)}"
}
# */