-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
67 lines (59 loc) · 1.71 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
data "template_file" "zone_name" {
template = "${replace(var.zone_name, "$$$$", "$")}"
vars {
namespace = "${var.namespace}"
name = "${var.cluster_name}"
stage = "${var.stage}"
parent_zone_name = "${var.parent_zone_name}"
}
}
locals {
tags = "${
merge(
var.tags,
map(
"Cluster", "${data.template_file.zone_name.rendered}"
)
)
}"
}
# Kops domain (e.g. `kops.domain.com`)
module "domain" {
source = "git::https://github.com/cloudposse/terraform-aws-route53-cluster-zone.git?ref=tags/0.3.1"
namespace = "${var.namespace}"
name = "${var.cluster_name}"
stage = "${var.stage}"
delimiter = "${var.delimiter}"
attributes = "${var.attributes}"
zone_name = "${var.zone_name}"
parent_zone_id = "${var.parent_zone_id}"
parent_zone_name = "${var.parent_zone_name}"
tags = "${local.tags}"
enabled = "${var.domain_enabled}"
}
module "s3_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.3"
namespace = "${var.namespace}"
name = "${var.name}"
stage = "${var.stage}"
delimiter = "${var.delimiter}"
attributes = "${var.attributes}"
tags = "${local.tags}"
}
resource "aws_s3_bucket" "default" {
bucket = "${module.s3_label.id}"
acl = "${var.acl}"
region = "${var.region}"
force_destroy = "${var.force_destroy}"
versioning {
enabled = true
}
server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
tags = "${module.s3_label.tags}"
}