-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,107 @@ | ||
# Terraform module for AWS lambda to receive GitHub App events | ||
|
||
This module creates the required infra to handle events of GitHub app via a Lambda connected to API Gateway V2. | ||
|
||
## Examples | ||
|
||
- _[default](./examples/default/)_ : Example that will create the lambda based on provided config and a zip file. | ||
- _[provided-](./examples/provide-lambda/)_ : Example that will let you create the lambda resource and pass the resource to the module. The module will create the API gateway for you. | ||
|
||
## Usages | ||
|
||
```bash | ||
# build the lambda | ||
cd examples/lambda-nodejs-ts | ||
./build.sh | ||
|
||
## create infra | ||
cd ../default | ||
terraform init | ||
terraform apply | ||
``` | ||
|
||
Terraform will output the webhook endpoint and secret for the GitHub. Go to https://github.com/settings/apps and create your app. | ||
|
||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| aws | n/a | | ||
| ---- | ------- | | ||
| aws | n/a | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | | ||
| create\_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | | ||
| labmda\_config | Configuration for the lambda. Only required if `create_lambda` is set to `true`. | <pre>object({<br> filename = string<br> handler = string<br> runtime = string<br> variables = map(string)<br> })</pre> | `null` | no | | ||
| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | | ||
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | | ||
| Name | Description | Type | Default | Required | | ||
| ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------- | :------: | | ||
| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | | ||
| create_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | | ||
| labmda_config | Configuration for the lambda. Only required if `create_lambda` is set to `true`. | <pre>object({<br> filename = string<br> handler = string<br> runtime = string<br> variables = map(string)<br> })</pre> | `null` | no | | ||
| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | | ||
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| gateway | n/a | | ||
| Name | Description | | ||
| ------- | ----------- | | ||
| gateway | n/a | | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| Name | Version | | ||
| --------- | ------- | | ||
| terraform | ~> 0.12 | | ||
| aws | ~> 2.50 | | ||
| aws | ~> 2.50 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| aws | ~> 2.50 | | ||
| ---- | ------- | | ||
| aws | ~> 2.50 | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | | ||
| create\_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | | ||
| labmda\_config | Configuration for the lambda. Only required if `create_lambda` is set to `true`. | <pre>object({<br> filename = string<br> handler = string<br> runtime = string<br> variables = map(string)<br> })</pre> | `null` | no | | ||
| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | | ||
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | | ||
| Name | Description | Type | Default | Required | | ||
| ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------- | :------: | | ||
| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | | ||
| create_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | | ||
| labmda_config | Configuration for the lambda. Only required if `create_lambda` is set to `true`. | <pre>object({<br> filename = string<br> handler = string<br> runtime = string<br> variables = map(string)<br> })</pre> | `null` | no | | ||
| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | | ||
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| gateway | n/a | | ||
| Name | Description | | ||
| ------- | ----------- | | ||
| gateway | n/a | | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| Name | Version | | ||
| --------- | ------- | | ||
| terraform | ~> 0.12 | | ||
| aws | ~> 2.50 | | ||
| aws | ~> 2.50 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| aws | ~> 2.50 | | ||
| ---- | ------- | | ||
| aws | ~> 2.50 | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | | ||
| create\_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | | ||
| labmda\_config | Configuration for the lambda. Only required if `create_lambda` is set to `true`. | <pre>object({<br> filename = string<br> handler = string<br> runtime = string<br> variables = map(string)<br> })</pre> | `null` | no | | ||
| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | | ||
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | | ||
| Name | Description | Type | Default | Required | | ||
| ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------- | :------: | | ||
| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | | ||
| create_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | | ||
| labmda_config | Configuration for the lambda. Only required if `create_lambda` is set to `true`. | <pre>object({<br> filename = string<br> handler = string<br> runtime = string<br> variables = map(string)<br> })</pre> | `null` | no | | ||
| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | | ||
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| gateway | n/a | | ||
|
||
| Name | Description | | ||
| ------- | ----------- | | ||
| gateway | n/a | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters