Skip to content

Commit 59f65af

Browse files
authoredDec 21, 2023
feat(logging): Date based partitioning for access-logs
1 parent 7263d09 commit 59f65af

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎main.tf

+21
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@ resource "aws_s3_bucket_logging" "this" {
4040

4141
target_bucket = var.logging["target_bucket"]
4242
target_prefix = try(var.logging["target_prefix"], null)
43+
44+
45+
dynamic "target_object_key_format" {
46+
for_each = try([var.logging["target_object_key_format"]], [])
47+
48+
content {
49+
dynamic "partitioned_prefix" {
50+
for_each = try(target_object_key_format.value["partitioned_prefix"], [])
51+
52+
content {
53+
partition_date_source = try(partitioned_prefix.value, null)
54+
}
55+
}
56+
57+
dynamic "simple_prefix" {
58+
for_each = contains(keys(target_object_key_format.value), "simple_prefix") ? [true] : []
59+
60+
content {}
61+
}
62+
}
63+
}
4364
}
4465

4566
resource "aws_s3_bucket_acl" "this" {

0 commit comments

Comments
 (0)
Please sign in to comment.