Skip to content

Commit be60771

Browse files
authored
add support for gateway response (#31)
* add support for gateway responses
1 parent 309a773 commit be60771

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

Diff for: modules/gateway_response/README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Requirements
2+
3+
| Name | Version |
4+
|------|---------|
5+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9 |
6+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.20.0 |
7+
8+
## Providers
9+
10+
| Name | Version |
11+
|------|---------|
12+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.20.0 |
13+
14+
## Modules
15+
16+
No modules.
17+
18+
## Resources
19+
20+
| Name | Type |
21+
|------|------|
22+
| [aws_api_gateway_gateway_response.wrapper](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_gateway_response) | resource |
23+
24+
## Inputs
25+
26+
| Name | Description | Type | Default | Required |
27+
|------|-------------|------|---------|:--------:|
28+
| <a name="input_gateway_responses"></a> [gateway\_responses](#input\_gateway\_responses) | map of gateway responses | `map(any)` | `{}` | no |
29+
| <a name="input_rest_api_id"></a> [rest\_api\_id](#input\_rest\_api\_id) | The ID of the REST API | `string` | `""` | no |
30+
31+
## Outputs
32+
33+
No outputs.

Diff for: modules/gateway_response/main.tf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
resource "aws_api_gateway_gateway_response" "wrapper" {
2+
for_each = var.gateway_responses
3+
4+
rest_api_id = var.rest_api_id
5+
response_type = each.key
6+
status_code = each.value.status_code
7+
8+
response_templates = each.value.response_templates
9+
response_parameters = each.value.response_parameters
10+
}

Diff for: modules/gateway_response/variables.tf

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
variable "rest_api_id" {
2+
description = "The ID of the REST API"
3+
type = string
4+
default = ""
5+
}
6+
7+
variable "gateway_responses" {
8+
description = "map of gateway responses"
9+
type = map(any)
10+
default = {}
11+
}

Diff for: modules/gateway_response/versions.tf

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
required_version = ">= 1.9"
3+
required_providers {
4+
aws = {
5+
source = "hashicorp/aws"
6+
version = ">= 5.20.0"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)