From 59141649d8bd0a0921b0c587fa542b386c22fed7 Mon Sep 17 00:00:00 2001 From: jakeasaurus Date: Fri, 6 Dec 2024 09:52:30 -0700 Subject: [PATCH] added some args --- modules/aws/api_gateway/README.md | 23 ++++------------------- modules/aws/api_gateway/main.tf | 2 +- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/modules/aws/api_gateway/README.md b/modules/aws/api_gateway/README.md index abcd1ce4..d4a618d5 100644 --- a/modules/aws/api_gateway/README.md +++ b/modules/aws/api_gateway/README.md @@ -101,7 +101,7 @@ No modules. | Name | Type | |------|------| -| [aws_apigatewayv2_api.api](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_api) | resource | +| [aws_apigatewayv2_api.example](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_api) | resource | | [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | | [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | @@ -109,30 +109,15 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [api\_gateway\_version](#input\_api\_gateway\_version) | Version of the API Gateway | `string` | `null` | no | -| [api\_key\_selection\_expression](#input\_api\_key\_selection\_expression) | API key selection expression for the API Gateway | `string` | `"$request.header.x-api-key"` | no | -| [body](#input\_body) | OpenAPI specification for the API Gateway | `string` | `null` | no | -| [cors\_configuration](#input\_cors\_configuration) | CORS configuration for the API Gateway |
object({
allow_credentials = bool
allow_headers = list(string)
allow_methods = list(string)
allow_origins = list(string)
expose_headers = list(string)
max_age = number
})
|
{
"allow_credentials": false,
"allow_headers": [],
"allow_methods": [],
"allow_origins": [],
"expose_headers": [],
"max_age": 0
}
| no | -| [credentials\_arn](#input\_credentials\_arn) | ARN of the credentials for the API Gateway | `string` | `null` | no | -| [description](#input\_description) | Description of the API Gateway | `string` | `null` | no | -| [disable\_execute\_api\_endpoint](#input\_disable\_execute\_api\_endpoint) | Whether to disable the execute-api endpoint | `bool` | `false` | no | -| [fail\_on\_warnings](#input\_fail\_on\_warnings) | Whether to fail on warnings during API Gateway creation | `bool` | `false` | no | -| [name](#input\_name) | Name of the API Gateway | `string` | n/a | yes | -| [protocol\_type](#input\_protocol\_type) | Protocol type of the API Gateway (HTTP or WEBSOCKET) | `string` | n/a | yes | -| [tags](#input\_tags) | Tags to apply to the API Gateway | `map(string)` | `{}` | no | -| [target](#input\_target) | Target for the API Gateway | `string` | `null` | no | +| [name](#input\_name) | (Required) The name of the API | `string` | n/a | yes | +| [protocol_type](#input\_protocol_type) | (Required) The API protocol. Valid values: HTTP, WEBSOCKET | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| | [api\_endpoint](#output\_api\_endpoint) | The URI of the API | -| [api\_key\_selection\_expression](#output\_api\_key\_selection\_expression) | The API key selection expression for the API | -| [arn](#output\_arn) | The ARN of the API | -| [cors\_configuration](#output\_cors\_configuration) | The CORS configuration for the API | -| [execution\_arn](#output\_execution\_arn) | The ARN prefix to be used in permission policies | -| [id](#output\_id) | The API identifier | -| [tags\_all](#output\_tags\_all) | Map of tags assigned to the resource | +| [api\_id](#output\_api\_id) | The API identifier | diff --git a/modules/aws/api_gateway/main.tf b/modules/aws/api_gateway/main.tf index dae9b387..fa171409 100644 --- a/modules/aws/api_gateway/main.tf +++ b/modules/aws/api_gateway/main.tf @@ -21,7 +21,7 @@ resource "aws_apigatewayv2_api" "api" { #Required name = var.name protocol_type = var.protocol_type - route_selection_expression = "$request.body.action" + route_selection_expression = "$request.method $request.path" #Optional api_key_selection_expression = var.api_key_selection_expression