Skip to content

Commit

Permalink
change partition format
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsweetman committed Dec 19, 2023
1 parent 5ccae84 commit 4013ee1
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -332,19 +332,28 @@ resource "aws_glue_catalog_table" "application_lb_logs" {

table_type = "EXTERNAL_TABLE"

partition_keys {
name = "year"
type = "string"
}
partition_keys {
name = "month"
type = "string"
}
partition_keys {
name = "day"
type = "string"
}

parameters = {
"projection.enabled" = "true"
"projection.day.type" = "date"
"projection.day.range" = "2023/12/01,NOW"
"projection.day.format" = "yyyy/MM/dd"
"projection.day.interval" = "1"
"projection.day.interval.unit" = "DAYS"
"storage.location.template" = var.existing_bucket_name != "" ? "s3://${var.existing_bucket_name}/${var.application_name}/AWSLogs/${var.account_number}/elasticloadbalancing/${var.region}/$${day}" : "s3://${module.s3-bucket[0].bucket.id}/${var.application_name}/AWSLogs/${var.account_number}/elasticloadbalancing/${var.region}/$${day}"
"projection.year.type" = "integer"
"projection.year.range" = "2023,2024"
"projection.month.type" = "integer"
"projection.month.range" = "1,12"
"projection.day.type" = "integer"
"projection.day.range" = "1,31"
"storage.location.template" = var.existing_bucket_name != "" ? "s3://${var.existing_bucket_name}/${var.application_name}/AWSLogs/${var.account_number}/elasticloadbalancing/${var.region}/$${year}/$${month}/$${day}" : "s3://${module.s3-bucket[0].bucket.id}/${var.application_name}/AWSLogs/${var.account_number}/elasticloadbalancing/${var.region}/$${year}/$${month}/$${day}"
}
storage_descriptor {
location = var.existing_bucket_name != "" ? "s3://${var.existing_bucket_name}/${var.application_name}/AWSLogs/${var.account_number}/elasticloadbalancing/${var.region}/" : "s3://${module.s3-bucket[0].bucket.id}/${var.application_name}/AWSLogs/${var.account_number}/elasticloadbalancing/${var.region}/"
Expand Down

0 comments on commit 4013ee1

Please sign in to comment.