-
Notifications
You must be signed in to change notification settings - Fork 0
/
glue.tf
117 lines (108 loc) · 2.59 KB
/
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
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
resource "aws_glue_catalog_database" "database" {
name = "s3_inventory"
description = "Database for storing S3 inventory reports"
}
resource "aws_glue_catalog_table" "table" {
for_each = var.s3_inventory_configuration
name = replace(each.value["bucket"], "-", "_")
database_name = aws_glue_catalog_database.database.name
table_type = "EXTERNAL_TABLE"
storage_descriptor {
location = "s3://${aws_s3_bucket.inventory_bucket.id}/${each.value["bucket"]}/${each.value["bucket"]}-inventory/hive"
input_format = "org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat"
output_format = "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat"
columns {
name = "bucket"
type = "string"
}
columns {
name = "key"
type = "string"
}
columns {
name = "version_id"
type = "string"
}
columns {
name = "is_latest"
type = "boolean"
}
columns {
name = "is_delete_marker"
type = "boolean"
}
columns {
name = "size"
type = "bigint"
}
columns {
name = "last_modified_date"
type = "bigint"
}
columns {
name = "e_tag"
type = "string"
}
columns {
name = "storage_class"
type = "string"
}
columns {
name = "is_multipart_uploaded"
type = "boolean"
}
columns {
name = "replication_status"
type = "string"
}
columns {
name = "encryption_status"
type = "string"
}
columns {
name = "object_lock_retention_until_date"
type = "bigint"
}
columns {
name = "object_lock_mode"
type = "string"
}
columns {
name = "object_lock_legal_hold_status"
type = "string"
}
columns {
name = "intelligent_tiering_access_tier"
type = "string"
}
columns {
name = "bucket_key_status"
type = "string"
}
columns {
name = "checksum_algorithm"
type = "string"
}
ser_de_info {
name = "ParquetHiveSerDe"
serialization_library = "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"
parameters = {
"serialization.format" = "\t"
}
}
}
# Projection configuration
parameters = {
"EXTERNAL" = "TRUE"
"projection.enabled" = "true"
"projection.dt.type" = "date"
"projection.dt.format" = "yyyy-MM-dd-HH-mm"
"projection.dt.interval" = "1"
"projection.dt.range" = "2022-01-01-00-00,NOW"
"projection.dt.interval.unit" = "DAYS"
}
partition_keys {
name = "dt"
type = "string"
}
}