This module creates an API gateway endpoint and lambda function to handle GitHub App webhook events.
Usage examples are available in the root module. By default the root module will assume local zip files containing the lambda distribution are available. See the download lambda module for more information.
The Lambda function is written in TypeScript and requires Node 12.x and yarn. Sources are located in [./lambdas/webhook].
cd lambdas/webhook
yarn install
Test are implemented with Jest, calls to AWS and GitHub are mocked.
yarn run test
To compile all TypeScript/JavaScript sources in a single file ncc is used.
yarn run dist
Name | Version |
---|---|
terraform | >= 0.14.1 |
aws | >= 3.38 |
Name | Version |
---|---|
aws | >= 3.38 |
No Modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
aws_region | AWS region. | string |
n/a | yes |
disable_check_wokflow_job_labels | Disable the the check of workflow labels. | bool |
false |
no |
environment | A name that identifies the environment, used as prefix and for tagging. | string |
n/a | yes |
github_app_webhook_secret_arn | n/a | string |
n/a | yes |
kms_key_arn | Optional CMK Key ARN to be used for Parameter Store. | string |
null |
no |
lambda_s3_bucket | S3 bucket from which to specify lambda functions. This is an alternative to providing local files directly. | any |
null |
no |
lambda_timeout | Time out of the lambda in seconds. | number |
10 |
no |
lambda_zip | File location of the lambda zip file. | string |
null |
no |
log_level | Logging level for lambda logging. Valid values are 'silly', 'trace', 'debug', 'info', 'warn', 'error', 'fatal'. | string |
"info" |
no |
log_type | Logging format for lambda logging. Valid values are 'json', 'pretty', 'hidden'. | string |
"pretty" |
no |
logging_retention_in_days | Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653. | number |
7 |
no |
repository_white_list | List of repositories allowed to use the github app | list(string) |
[] |
no |
role_path | The path that will be added to the role; if not set, the environment name will be used. | string |
null |
no |
role_permissions_boundary | Permissions boundary that will be added to the created role for the lambda. | string |
null |
no |
runner_extra_labels | Extra labels for the runners (GitHub). Separate each label by a comma | string |
"" |
no |
sqs_build_queue | SQS queue to publish accepted build events. | object({ |
n/a | yes |
tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | map(string) |
{} |
no |
webhook_lambda_s3_key | S3 key for webhook lambda function. Required if using S3 bucket to specify lambdas. | any |
null |
no |
webhook_lambda_s3_object_version | S3 object version for webhook lambda function. Useful if S3 versioning is enabled on source bucket. | any |
null |
no |
Name | Description |
---|---|
endpoint_relative_path | n/a |
gateway | n/a |
lambda | n/a |
role | n/a |
This module is part of the Philips Forest.
___ _
/ __\__ _ __ ___ ___| |_
/ _\/ _ \| '__/ _ \/ __| __|
/ / | (_) | | | __/\__ \ |_
\/ \___/|_| \___||___/\__|
Infrastructure
Talk to the forestkeepers in the forest
-channel on Slack.