This is a tiny terraform module that enables the integration between athena query service and the CloudFront logs collected in S3.
- Create a database in athena query service.
- Create a table for CloudFront logs using the schema defined in the aws doc .
- Create the list of named queries given.
module "athena-cloudfront-logs-integration" {
source = "KumarManoj-S/athena-cloudfront-logs-integration/aws"
cloudfront_access_log_prefix = "cloudfront-logs"
create_database = true
database_name = "cloudfront_logs_db"
queries = [
{
name = "my-first-query-name"
query = "select * from cloudfront_logs limit 10;"
},
{
name = "my-second-query-name"
query = "select * from cloudfront_logs where status = 400 limit 5;"
}
]
s3_bucket_name = "s3-log-bucket"
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
s3_bucket_name | S3 bucket name | string |
- | Yes |
cloudfront_access_log_prefix | S3 log prefix | string |
- | Yes |
create_database | Variable that decides db creation | bool |
true |
No |
cloudfront_logs_table_name | Table name | string |
cloudfront_logs |
No |
database_name | DB name | string |
- | Yes |
queries | list of queries need to be saved | list(string) |
[] |
No |
Name | Description |
---|---|
cloudfront_logs_table_name | The name of the table created |
MIT Licensed. See LICENSE for full details.