A Terraform module for ingesting GitHub event data
- AWS Lambda function to act as a receiver for HTTP webhook events from GitHub (about GitHub webhooks)
- Supports GitHub shared secret to secure the endpoint (more information)
- AWS Kinesis Data Firehose receives the event data and writes to S3 in JSON format
- AWS Athena table is created and configured to query data
Look at examples/complete/main.tf
for an example of how to deploy this Terraform module
AWS Athena can be used to query the data in S3. This Terraform module sets up the Athena table so that it is possible to immediately begin running queries.
Below is an example query for extracting nested JSON fields:
select json_extract_scalar(repository, '$.name') as name,
json_extract_scalar(repository, '$.owner.login') as login
from "my-athena-table"
Several integration tests are run in test/src/examples_complete_test.go
, which are executed on each commit to this
repository.
- An HTTP test event is sent to the Lambda function with a secret set to validate the event is received successfully
- An HTTP test event is sent to the Lambda function without a secret set to validate the event is rejected
- The S3 bucket is inspected to ensure the test event data is written successfully
- An AWS Athena query is executed and the result is checked to ensure data is returned successfully
Name | Version |
---|---|
terraform | >= 0.15.1 |
aws | >= 4.17.1 |
Name | Version |
---|---|
archive | n/a |
aws | >= 4.17.1 |
Name | Source | Version |
---|---|---|
lambda | github.com/champ-oss/terraform-aws-lambda.git | v1.0.97-948bb8b |
s3 | github.com/champ-oss/terraform-aws-s3.git | v1.0.29-4a98121 |
Name | Type |
---|---|
aws_glue_catalog_database.this | resource |
aws_glue_catalog_table.this | resource |
aws_iam_policy.this | resource |
aws_iam_role.this | resource |
aws_iam_role_policy_attachment.firehose | resource |
aws_iam_role_policy_attachment.s3 | resource |
aws_iam_role_policy_attachment.this | resource |
aws_kinesis_firehose_delivery_stream.this | resource |
aws_sns_topic.this | resource |
aws_sns_topic_subscription.this | resource |
archive_file.this | data source |
aws_iam_policy_document.assume | data source |
aws_iam_policy_document.this | data source |
aws_region.this | data source |