Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)