-
Notifications
You must be signed in to change notification settings - Fork 145
/
modules.tf
161 lines (137 loc) · 4.33 KB
/
modules.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
module "s3" {
source = "./modules/s3"
# variables
aws = "${ var.aws }"
bucket = "kz8s-pki-${ var.name }-${ var.aws["account-id"] }-${ var.aws["region"] }"
name = "${ var.name }"
}
module "vpc" {
source = "./modules/vpc"
depends-id = ""
# variables
azs = "${ var.aws["azs"] }"
cidr = "${ var.cidr["vpc"] }"
hyperkube-tag = "${ var.k8s["hyperkube-tag"] }"
name = "${ var.name }"
region = "${ var.aws["region"] }"
}
module "route53" {
source = "./modules/route53"
depends-id = "${ module.vpc.depends-id }"
# variables
etcd-ips = "${ var.etcd-ips }"
internal-tld = "${ var.internal-tld }"
name = "${ var.name }"
# modules
vpc-id = "${ module.vpc.id }"
}
module "pki" {
source = "./modules/pki"
depends-id = "${ module.vpc.depends-id }"
# variables
ami-id = "${ var.coreos-aws["ami"] }"
aws = "${ var.aws }"
cidr-vpc = "${ var.cidr["vpc"] }"
instance-type = "${ var.instance-type["pki"] }"
internal-tld = "${ var.internal-tld }"
ip = "${ var.pki-ip }"
k8s = "${ var.k8s }"
name = "${ var.name }"
# modules
instance-profile-name = "${ module.iam.instance-profile-name-pki }"
internal-zone-id = "${ module.route53.internal-zone-id }"
s3-bucket = "${ module.s3.bucket }"
s3-bucket-arn = "${ module.s3.bucket-arn }"
security-group-id = "${ module.security.pki-id }"
subnet-id = "${ element( split(",", module.vpc.subnet-ids-private), 0 ) }"
vpc-id = "${ module.vpc.id }"
}
module "security" {
source = "./modules/security"
depends-id = "${ module.vpc.depends-id }"
# variables
cidr-allow-ssh = "${ var.cidr["allow-ssh"] }"
cidr-vpc = "${ var.cidr["vpc"] }"
name = "${ var.name }"
# modules
vpc-id = "${ module.vpc.id }"
}
module "iam" {
source = "./modules/iam"
depends-id = "${ module.pki.depends-id }"
# variables
name = "${ var.name }"
# modules
s3-bucket-arn = "${ module.s3.bucket-arn }"
}
module "bastion" {
source = "./modules/bastion"
depends-id = "${ module.vpc.depends-id }"
# variables
ami-id = "${ var.coreos-aws["ami"] }"
instance-type = "${ var.instance-type["bastion"] }"
internal-tld = "${ var.internal-tld }"
key-name = "${ var.aws["key-name"] }"
name = "${ var.name }"
# modules
instance-profile-name = "${ module.iam.instance-profile-name-bastion }"
s3-bucket = "${ module.s3.bucket }"
s3-bucket-arn = "${ module.s3.bucket-arn }"
security-group-id = "${ module.security.bastion-id }"
subnet-id = "${ element( split(",", module.vpc.subnet-ids-public), 0 ) }"
vpc-id = "${ module.vpc.id }"
}
module "etcd" {
source = "./modules/etcd"
depends-id = "${ module.route53.depends-id }"
# variables
ami-id = "${ var.coreos-aws["ami"] }"
aws = "${ var.aws }"
cluster-domain = "${ var.cluster-domain }"
dns-service-ip = "${ var.dns-service-ip }"
etcd-ips = "${ var.etcd-ips }"
instance-type = "${ var.instance-type["etcd"] }"
internal-tld = "${ var.internal-tld }"
ip-k8s-service = "${ var.k8s-service-ip }"
k8s = "${ var.k8s }"
name = "${ var.name }"
pod-ip-range = "${ var.cidr["pods"] }"
service-cluster-ip-range = "${ var.cidr["service-cluster"] }"
# modules
etcd-security-group-id = "${ module.security.etcd-id }"
external-elb-security-group-id = "${ module.security.external-elb-id }"
instance-profile-name = "${ module.iam.instance-profile-name-master }"
s3-bucket = "${ module.s3.bucket }"
subnet-id-private = "${ element( split(",", module.vpc.subnet-ids-private), 0 ) }"
subnet-id-public = "${ element( split(",", module.vpc.subnet-ids-public), 0 ) }"
vpc-id = "${ module.vpc.id }"
}
module "worker" {
source = "./modules/worker"
depends-id = "${ module.route53.depends-id }"
# variables
ami-id = "${ var.coreos-aws["ami"] }"
aws = "${ var.aws }"
capacity = {
desired = 3
max = 5
min = 1
}
cluster-domain = "${ var.cluster-domain }"
dns-service-ip = "${ var.dns-service-ip }"
instance-type = "${ var.instance-type["worker"] }"
internal-tld = "${ var.internal-tld }"
k8s = "${ var.k8s }"
name = "${ var.name }"
volume_size = {
ebs = 250
root = 52
}
worker-name = "general"
# modules
instance-profile-name = "${ module.iam.instance-profile-name-worker }"
s3-bucket = "${ module.s3.bucket }"
security-group-id = "${ module.security.worker-id }"
subnet-id = "${ element( split(",", module.vpc.subnet-ids-private), 0 ) }"
vpc-id = "${ module.vpc.id }"
}