Skip to content

add support for gateway response #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions modules/gateway_response/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.20.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.20.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_api_gateway_gateway_response.wrapper](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_gateway_response) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_gateway_responses"></a> [gateway\_responses](#input\_gateway\_responses) | map of gateway responses | `map(any)` | `{}` | no |
| <a name="input_rest_api_id"></a> [rest\_api\_id](#input\_rest\_api\_id) | The ID of the REST API | `string` | `""` | no |

## Outputs

No outputs.
10 changes: 10 additions & 0 deletions modules/gateway_response/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "aws_api_gateway_gateway_response" "wrapper" {
for_each = var.gateway_responses

rest_api_id = var.rest_api_id
response_type = each.key
status_code = each.value.status_code

response_templates = each.value.response_templates
response_parameters = each.value.response_parameters
}
11 changes: 11 additions & 0 deletions modules/gateway_response/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "rest_api_id" {
description = "The ID of the REST API"
type = string
default = ""
}

variable "gateway_responses" {
description = "map of gateway responses"
type = map(any)
default = {}
}
9 changes: 9 additions & 0 deletions modules/gateway_response/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.9"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.20.0"
}
}
}
Loading