-
Notifications
You must be signed in to change notification settings - Fork 5
/
s3.tf
114 lines (89 loc) · 3.17 KB
/
s3.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
resource "aws_s3_bucket" "cluster" {
bucket_prefix = "${var.name}-"
acl = "private"
force_destroy = true
versioning {
enabled = true
}
tags = "${var.additional_tags}"
}
data "template_file" "prepare" {
template = "${file("${path.module}/scripts/1_prepare.sh")}"
vars {
kubernetes_version = "${var.kubernetes_version}"
}
}
data "template_file" "prepare2" {
template = "${file("${path.module}/scripts/2_setup_kubernetes.sh")}"
vars {
kubernetes_version = "${var.kubernetes_version}"
kubernetes_dashboard_version = "${var.kubernetes_dashboard_version}"
disable_security_group_limit = "${var.disable_security_group_limit}"
}
}
resource "aws_s3_bucket_object" "prepare" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/installation/1_prepare.sh"
content = "${data.template_file.prepare.rendered}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}
resource "aws_s3_bucket_object" "prepare2" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/installation/2_setup_kubernetes.sh"
content = "${data.template_file.prepare2.rendered}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}
resource "aws_s3_bucket_object" "maint1" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/maintenance/9_verify_network.sh"
content = "${file("${path.module}/scripts/9_verify_network.sh")}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}
resource "aws_s3_bucket_object" "createnamespace" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/maintenance/create_namespace_for_customer.sh"
content = "${file("${path.module}/scripts/create_namespace_for_customer.sh")}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}
resource "aws_s3_bucket_object" "kill" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/maintenance/10_kill.sh"
content = "${file("${path.module}/scripts/10_kill.sh")}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}
resource "aws_s3_bucket_object" "check_proxy" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/maintenance/proxy_healthcheck.sh"
content = "${file("${path.module}/scripts/proxy_healthcheck.sh")}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}
resource "aws_s3_bucket_object" "example_nginx" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/examples/nginx.yaml"
content = "${file("${path.module}/scripts/examples/nginx.yaml")}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}
data "template_file" "addons" {
template = "${file("${path.module}/scripts/3_addons.sh")}"
vars {
node_asg_name = "${aws_autoscaling_group.nodes.name}"
node_asg_min = "${var.node_asg_min}"
node_asg_max = "${var.node_asg_max}"
enable_kube2iam = "${var.enable_kube2iam}"
kubernetes_dashboard_version = "${var.kubernetes_dashboard_version}"
}
}
resource "aws_s3_bucket_object" "addons" {
bucket = "${aws_s3_bucket.cluster.id}"
key = "scripts/installation/3_addons.sh"
content = "${data.template_file.addons.rendered}"
server_side_encryption = "AES256"
tags = "${var.additional_tags}"
}