-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcommon.tf
47 lines (37 loc) · 1.11 KB
/
common.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
data "aws_availability_zones" "all" {}
data "aws_availability_zone" "all" {
count = length(data.aws_availability_zones.all.names)
name = data.aws_availability_zones.all.names[count.index]
}
data "aws_route53_zone" "main" {
zone_id = var.route53_zone_id
}
data "aws_route53_zone" "inaddr_arpa" {
zone_id = var.route53_inaddr_arpa_zone_id
}
data "aws_vpc" "main" {
id = var.vpc_id
}
data "aws_subnet" "control_plane_private" {
count = var.control_plane_private_subnet_count
id = var.control_plane_private_subnet_ids[count.index]
}
data "aws_subnet" "workers_private" {
count = var.worker_node_private_subnet_count
id = var.worker_node_private_subnet_ids[count.index]
}
data "aws_subnet" "public" {
count = var.public_subnet_count
id = var.public_subnet_ids[count.index]
}
resource "aws_s3_bucket" "userdata" {
bucket = "${var.bucket_prefix}-ignition-userdata-${var.cluster_name}"
}
resource "aws_s3_bucket_server_side_encryption_configuration" "userdata" {
bucket = aws_s3_bucket.userdata.bucket
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}