Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminlukeclark committed Sep 17, 2024
1 parent a0920e2 commit a7e31ac
Show file tree
Hide file tree
Showing 9 changed files with 865 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/commit-to-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
validation:
strategy:
matrix:
folder: ["add", "folders", "here"]
folder: ["./", "examples/api_gateway"]
name: Terraform validate for ${{ matrix.folder }}
runs-on: ubuntu-20.04
steps:
Expand All @@ -41,7 +41,7 @@ jobs:
linting:
strategy:
matrix:
folder: ["add", "folders", "here"]
folder: ["./", "examples/api_gateway"]
name: Terraform lint for ${{ matrix.folder }}
runs-on: ubuntu-20.04
steps:
Expand All @@ -59,7 +59,7 @@ jobs:
plan:
strategy:
matrix:
folder: ["add", "folders", "here"]
folder: ["examples/api_gateway"]
name: Terraform plan for ${{ matrix.folder }}
runs-on: ubuntu-20.04
needs: [validation, linting]
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_application_name"></a> [application\_name](#input\_application\_name) | Name of the application utilising resource. | `string` | n/a | yes |
| <a name="input_environment"></a> [environment](#input\_environment) | Which environment this is being instantiated in. | `string` | n/a | yes |
| <a name="input_raw_api_gateway_rest_apis"></a> [raw\_api\_gateway\_rest\_apis](#input\_raw\_api\_gateway\_rest\_apis) | Data structure<br>---------------<br>A list of dictionaries, where each dictionary has the following attributes:<br><br>REQUIRED<br>---------<br>- suffix : Suffix to use when creating the RESTAPI Gateway<br>- open\_api\_file\_path : Path to OpenAPI definition file<br>- description : A human-friendly description of the API<br>- tags : A dictionary of tags, required to tag Stage to ensure its protected by WAF.<br><br><br>OPTIONAL<br>---------<br>- template\_input : A dictionary of variable input for the OpenAPI definition file (leave blank if no template required)<br>- allowed\_lambdas : A list of strings, where each string is the function\_name of a lambda to allow access to.<br>- quota\_limit : Maximum number of requests that can be made in a given time period, defaults to 10.<br>- quota\_offset : Number of requests subtracted from the given limit in the initial time period, defaults to 0.<br>- quota\_period : Time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH". Defaults to "DAY"<br>- burst\_limit : The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity. Defaults to 5.<br>- rate\_limit : The API request steady-state rate limit, defaults to 10.<br>- api\_keys : List of strings, where each string is name of an API key to create for the API, defaults to empty list. | <pre>list(<br> object({<br> suffix = string,<br> description = string,<br> tags = map(string),<br> open_api_file_path = string,<br> template_input = optional(map(string), {}),<br> quota_limit = optional(number, 10),<br> quota_offset = optional(number, 0),<br> quota_period = optional(string, "DAY"),<br> burst_limit = optional(number, 5),<br> rate_limit = optional(number, 10)<br> allowed_lambdas = optional(list(string), [])<br> api_keys = optional(list(string), [])<br> })<br> )</pre> | n/a | yes |
| <a name="input_raw_api_gateway_rest_apis"></a> [raw\_api\_gateway\_rest\_apis](#input\_raw\_api\_gateway\_rest\_apis) | Data structure<br>---------------<br>A list of dictionaries, where each dictionary has the following attributes:<br><br>REQUIRED<br>---------<br>- suffix : Suffix to use when creating the RESTAPI Gateway<br>- open\_api\_file\_path : Path to OpenAPI definition file<br>- description : A human-friendly description of the API<br><br><br>OPTIONAL<br>---------<br>- template\_input : A dictionary of variable input for the OpenAPI definition file (leave blank if no template required)<br>- allowed\_lambdas : A list of strings, where each string is the function\_name of a lambda to allow access to.<br>- quota\_limit : Maximum number of requests that can be made in a given time period, defaults to 10.<br>- quota\_offset : Number of requests subtracted from the given limit in the initial time period, defaults to 0.<br>- quota\_period : Time period in which the limit applies. Valid values are "DAY", "WEEK" or "MONTH". Defaults to "DAY"<br>- burst\_limit : The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity. Defaults to 5.<br>- rate\_limit : The API request steady-state rate limit, defaults to 10.<br>- api\_keys : List of strings, where each string is name of an API key to create for the API, defaults to empty list. | <pre>list(<br> object({<br> suffix = string,<br> description = string,<br> open_api_file_path = string,<br> template_input = optional(map(string), {}),<br> quota_limit = optional(number, 10),<br> quota_offset = optional(number, 0),<br> quota_period = optional(string, "DAY"),<br> burst_limit = optional(number, 5),<br> rate_limit = optional(number, 10)<br> allowed_lambdas = optional(list(string), [])<br> api_keys = optional(list(string), [])<br> })<br> )</pre> | n/a | yes |

## Outputs

Expand All @@ -95,7 +95,6 @@ REQUIRED
- suffix : Suffix to use when creating the RESTAPI Gateway
- open_api_file_path : Path to OpenAPI definition file
- description : A human-friendly description of the API
- tags : A dictionary of tags, required to tag Stage to ensure its protected by WAF.
OPTIONAL
Expand Down
1 change: 0 additions & 1 deletion api_gateway_stage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ resource "aws_api_gateway_stage" "stages" {
deployment_id = aws_api_gateway_deployment.deployments[each.value["suffix"]].id
rest_api_id = aws_api_gateway_rest_api.api_gateway[each.value["suffix"]].id
stage_name = var.environment
tags = each.value["tags"]
}
Loading

0 comments on commit a7e31ac

Please sign in to comment.