This repository has been archived by the owner on Jan 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.tf
71 lines (57 loc) · 1.66 KB
/
main.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
data "aws_caller_identity" "default" {}
data "aws_vpc" "kops" {
count = "${var.enabled == "true" ? 1 : 0}"
filter {
name = "tag:${var.vpc_tag}"
values = ["${concat(var.vpc_tag_values, list(var.dns_zone))}"]
}
}
data "aws_subnet_ids" "private" {
count = "${var.enabled == "true" ? 1 : 0}"
vpc_id = "${data.aws_vpc.kops.id}"
tags {
"kubernetes.io/role/internal-elb" = "1"
}
}
data "aws_subnet_ids" "utility" {
count = "${var.enabled == "true" ? 1 : 0}"
vpc_id = "${data.aws_vpc.kops.id}"
tags {
"kubernetes.io/role/elb" = "1"
}
}
data "aws_security_group" "bastion" {
count = "${var.enabled == "true" ? 1 : 0}"
vpc_id = "${data.aws_vpc.kops.id}"
name = "${var.bastion_name}.${var.dns_zone}"
tags {
Name = "${var.bastion_name}.${var.dns_zone}"
KubernetesCluster = "${var.dns_zone}"
}
}
data "aws_security_group" "masters" {
count = "${var.enabled == "true" ? 1 : 0}"
vpc_id = "${data.aws_vpc.kops.id}"
name = "${var.masters_name}.${var.dns_zone}"
tags {
Name = "${var.masters_name}.${var.dns_zone}"
KubernetesCluster = "${var.dns_zone}"
}
}
data "aws_security_group" "nodes" {
count = "${var.enabled == "true" ? 1 : 0}"
vpc_id = "${data.aws_vpc.kops.id}"
name = "${var.nodes_name}.${var.dns_zone}"
tags {
Name = "${var.nodes_name}.${var.dns_zone}"
KubernetesCluster = "${var.dns_zone}"
}
}
data "aws_iam_role" "masters" {
count = "${var.enabled == "true" ? 1 : 0}"
name = "${var.masters_name}.${var.dns_zone}"
}
data "aws_iam_role" "nodes" {
count = "${var.enabled == "true" ? 1 : 0}"
name = "${var.nodes_name}.${var.dns_zone}"
}