This Terraform module creates an AWS Glue table designed specifically to query Amazon S3 server access logs in the new date-based partitioning format 1.
Date-based partitioning improves performance and cost-efficiency of downstream log processing systems by limiting the scanning of logs to only the desired time range.
module "s3_access_logs_glue_table" {
source = "github.com/fivexl/terraform-aws-s3-access-logs-athena-table/?ref=main"
name = "s3_server_access_logs"
database_name = aws_glue_catalog_database.s3_access_logs_db.name
location = "s3://${local.logging_bucket_name}/s3-server-access-logs"
}
Name | Version |
---|---|
terraform | ~> 1.0 |
aws | >= 4.9.0 |
Name | Version |
---|---|
aws | >= 4.9.0 |
Name | Type |
---|---|
aws_glue_catalog_table.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
database_name | Name of AWS Glue database to create table in | string |
n/a | yes |
date_based_partitioning | Whether to enable date-based partitioning | bool |
true |
no |
location | S3 location of S3 access logs. This is the same url you specify in the S3 bucket when you enable S3 server access logging - e.g. s3://my-bucket-name/s3-access-logs | string |
n/a | yes |
name | Name of AWS Glue table to create | string |
"s3_access_logs" |
no |
Name | Description |
---|---|
aws_glue_catalog_table_arn | The ARN of the Glue Table. |
aws_glue_catalog_table_id | The ID of the Glue Table. |