|
| 1 | +# Terraform module for AWS lambda to receive GitHub App events |
| 2 | + |
| 3 | +This module creates the required infra to handle events of GitHub app via a Lambda connected to API Gateway V2. |
| 4 | + |
| 5 | +## Examples |
| 6 | + |
| 7 | +- _[default](./examples/default/)_ : Example that will create the lambda based on provided config and a zip file. |
| 8 | +- _[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. |
| 9 | + |
| 10 | +## Usages |
| 11 | + |
| 12 | +```bash |
| 13 | +# build the lambda |
| 14 | +cd examples/lambda-nodejs-ts |
| 15 | +./build.sh |
| 16 | + |
| 17 | +## create infra |
| 18 | +cd ../default |
| 19 | +terraform init |
| 20 | +terraform apply |
| 21 | +``` |
| 22 | + |
| 23 | +Terraform will output the webhook endpoint and secret for the GitHub. Go to https://github.com/settings/apps and create your app. |
| 24 | + |
1 | 25 | ## Requirements
|
2 | 26 |
|
3 | 27 | No requirements.
|
4 | 28 |
|
5 | 29 | ## Providers
|
6 | 30 |
|
7 | 31 | | Name | Version |
|
8 |
| -|------|---------| |
9 |
| -| aws | n/a | |
| 32 | +| ---- | ------- | |
| 33 | +| aws | n/a | |
10 | 34 |
|
11 | 35 | ## Inputs
|
12 | 36 |
|
13 |
| -| Name | Description | Type | Default | Required | |
14 |
| -|------|-------------|------|---------|:--------:| |
15 |
| -| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | |
16 |
| -| create\_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | |
17 |
| -| 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 | |
18 |
| -| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | |
19 |
| -| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | |
| 37 | +| Name | Description | Type | Default | Required | |
| 38 | +| ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------- | :------: | |
| 39 | +| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | |
| 40 | +| create_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | |
| 41 | +| 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 | |
| 42 | +| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | |
| 43 | +| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | |
20 | 44 |
|
21 | 45 | ## Outputs
|
22 | 46 |
|
23 |
| -| Name | Description | |
24 |
| -|------|-------------| |
25 |
| -| gateway | n/a | |
| 47 | +| Name | Description | |
| 48 | +| ------- | ----------- | |
| 49 | +| gateway | n/a | |
26 | 50 |
|
27 | 51 | ## Requirements
|
28 | 52 |
|
29 |
| -| Name | Version | |
30 |
| -|------|---------| |
| 53 | +| Name | Version | |
| 54 | +| --------- | ------- | |
31 | 55 | | terraform | ~> 0.12 |
|
32 |
| -| aws | ~> 2.50 | |
| 56 | +| aws | ~> 2.50 | |
33 | 57 |
|
34 | 58 | ## Providers
|
35 | 59 |
|
36 | 60 | | Name | Version |
|
37 |
| -|------|---------| |
38 |
| -| aws | ~> 2.50 | |
| 61 | +| ---- | ------- | |
| 62 | +| aws | ~> 2.50 | |
39 | 63 |
|
40 | 64 | ## Inputs
|
41 | 65 |
|
42 |
| -| Name | Description | Type | Default | Required | |
43 |
| -|------|-------------|------|---------|:--------:| |
44 |
| -| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | |
45 |
| -| create\_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | |
46 |
| -| 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 | |
47 |
| -| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | |
48 |
| -| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | |
| 66 | +| Name | Description | Type | Default | Required | |
| 67 | +| ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------- | :------: | |
| 68 | +| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | |
| 69 | +| create_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | |
| 70 | +| 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 | |
| 71 | +| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | |
| 72 | +| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | |
49 | 73 |
|
50 | 74 | ## Outputs
|
51 | 75 |
|
52 |
| -| Name | Description | |
53 |
| -|------|-------------| |
54 |
| -| gateway | n/a | |
| 76 | +| Name | Description | |
| 77 | +| ------- | ----------- | |
| 78 | +| gateway | n/a | |
55 | 79 |
|
56 | 80 | ## Requirements
|
57 | 81 |
|
58 |
| -| Name | Version | |
59 |
| -|------|---------| |
| 82 | +| Name | Version | |
| 83 | +| --------- | ------- | |
60 | 84 | | terraform | ~> 0.12 |
|
61 |
| -| aws | ~> 2.50 | |
| 85 | +| aws | ~> 2.50 | |
62 | 86 |
|
63 | 87 | ## Providers
|
64 | 88 |
|
65 | 89 | | Name | Version |
|
66 |
| -|------|---------| |
67 |
| -| aws | ~> 2.50 | |
| 90 | +| ---- | ------- | |
| 91 | +| aws | ~> 2.50 | |
68 | 92 |
|
69 | 93 | ## Inputs
|
70 | 94 |
|
71 |
| -| Name | Description | Type | Default | Required | |
72 |
| -|------|-------------|------|---------|:--------:| |
73 |
| -| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | |
74 |
| -| create\_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | |
75 |
| -| 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 | |
76 |
| -| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | |
77 |
| -| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | |
| 95 | +| Name | Description | Type | Default | Required | |
| 96 | +| ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------- | :------: | |
| 97 | +| environment | Name of the environment will be used to name resources unique. | `string` | n/a | yes | |
| 98 | +| create_lambda | Let the module create the lambda, provide the config for the lambda via `lambda_config`. | `bool` | `true` | no | |
| 99 | +| 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 | |
| 100 | +| lambda | Provide your own lambda resource. Only required if `create_lambda` is set to `false`. | `any` | `null` | no | |
| 101 | +| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environment. | `map(string)` | `{}` | no | |
78 | 102 |
|
79 | 103 | ## Outputs
|
80 | 104 |
|
81 |
| -| Name | Description | |
82 |
| -|------|-------------| |
83 |
| -| gateway | n/a | |
84 |
| - |
| 105 | +| Name | Description | |
| 106 | +| ------- | ----------- | |
| 107 | +| gateway | n/a | |
0 commit comments