-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paths3_glue.tf
48 lines (38 loc) · 1.25 KB
/
s3_glue.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
resource "aws_s3_bucket" "glue_assets" {
bucket = format("aws-glue-assets-%s-%s", var.project_name, data.aws_caller_identity.current.account_id)
}
resource "aws_s3_bucket_acl" "glue_assets" {
bucket = aws_s3_bucket.glue_assets.id
acl = "private"
}
resource "aws_s3_bucket_server_side_encryption_configuration" "glue_assets" {
bucket = aws_s3_bucket.glue_assets.id
rule {
apply_server_side_encryption_by_default {
kms_master_key_id = aws_kms_key.main.arn
sse_algorithm = "aws:kms"
}
}
}
resource "aws_s3_object" "convert_to_parquet" {
bucket = aws_s3_bucket.glue_assets.bucket
key = "convert_to_parquet.py"
source = "./glue/jobs/convert_to_parquet.py"
etag = filemd5("./glue/jobs/convert_to_parquet.py")
}
resource "aws_s3_bucket" "glue_temp" {
bucket = format("aws-glue-temp-%s", data.aws_caller_identity.current.account_id)
}
resource "aws_s3_bucket_acl" "glue_temp" {
bucket = aws_s3_bucket.glue_temp.id
acl = "private"
}
resource "aws_s3_bucket_server_side_encryption_configuration" "glue_temp" {
bucket = aws_s3_bucket.glue_temp.id
rule {
apply_server_side_encryption_by_default {
kms_master_key_id = aws_kms_key.main.arn
sse_algorithm = "aws:kms"
}
}
}