Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/GorillaStack/athena-cloudtrail-partitioner
Automate the daily partitioning of your CloudTrail bucket in Athena
https://github.com/GorillaStack/athena-cloudtrail-partitioner
athena aws aws-athena aws-glue cloudtrail cloudtrail-logs glue gorillastack partitioning
Last synced: about 1 month ago
JSON representation
Automate the daily partitioning of your CloudTrail bucket in Athena
- Host: GitHub
- URL: https://github.com/GorillaStack/athena-cloudtrail-partitioner
- Owner: GorillaStack
- License: mit
- Created: 2019-07-26T06:34:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-19T18:12:57.000Z (about 1 year ago)
- Last Synced: 2024-08-04T08:04:04.057Z (5 months ago)
- Topics: athena, aws, aws-athena, aws-glue, cloudtrail, cloudtrail-logs, glue, gorillastack, partitioning
- Language: JavaScript
- Size: 671 KB
- Stars: 26
- Watchers: 3
- Forks: 7
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Athena CloudTrail Partitioner
AWS Athena is a serverless query service that helps you query your unstructured S3 data without all the ETL.
Athena allows you to query your CloudTrail log data from your S3 bucket on demand. However, it can be challenging to maintain sensible partitioning on the database over time.
This project helps you periodically add partitions to your Athena/Glue database for each day/month/year/region/account added to your CloudTrail log bucket.
[Read more about why we built this, and how it can be used, in this blog post](https://www.gorillastack.com/news/cloudtrail-athena-query/).
## Prerequisite - Enable CloudTrail
CloudTrail is an audit log of every action to occur in your AWS Action. It should be on all the time.
You can now [enable CloudTrail at the AWS Organization level](https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-ct.html), which means that CloudTrail for each account will be centrally logged and automatically enabled for all new accounts.
Read about how to [create your organization CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html) here.
## Installation
Install the Athena CloudTrail Partitioner through CloudFormation, either through the AWSCLI:
```
aws cloudformation deploy \
--stack-name athena-cloudtrail-partitioner \
--region ${AWS_DEFAULT_REGION} \
--template-file cf/template.yml \
--force-upload \
--parameter-overrides \
"OrganizationId=${ORGANIZATION_ID}" \
"S3BucketName=${S3_BUCKET_NAME}" \
--capabilities CAPABILITY_NAMED_IAM \
--no-fail-on-empty-changeset
```or click this button to deploy throught the AWS Console:
[![Launch Stack](https://cdn.rawgit.com/buildkite/cloudformation-launch-stack-button-svg/master/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/quickcreate?stackName=athena-cloudtrail-partitioner&templateUrl=https%3A%2F%2Fgorillastack-cloudformation-templates.s3.amazonaws.com%2Fathena-cloudtrail-partitioner.yml)