Skip to content

This Terraform module creates an AWS Glue table designed specifically to query Amazon S3 server access logs in the new date-based partitioning format.

License

Notifications You must be signed in to change notification settings

fivexl/terraform-aws-s3-access-logs-athena-table

Repository files navigation

terraform-aws-s3-access-logs-athena-table

FivexL

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.

Usage

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"
}

Links that may be useful

Requirements

Name Version
terraform ~> 1.0
aws >= 4.9.0

Providers

Name Version
aws >= 4.9.0

Resources

Name Type
aws_glue_catalog_table.this resource

Inputs

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

Outputs

Name Description
aws_glue_catalog_table_arn The ARN of the Glue Table.
aws_glue_catalog_table_id The ID of the Glue Table.

Weekly review link

Footnotes

  1. Amazon S3 server access logging now supports automatic date-based partitioning

About

This Terraform module creates an AWS Glue table designed specifically to query Amazon S3 server access logs in the new date-based partitioning format.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages