diff --git a/modules/gateway_response/main.tf b/modules/gateway_response/main.tf index 4ab0fac..bf085b1 100644 --- a/modules/gateway_response/main.tf +++ b/modules/gateway_response/main.tf @@ -1,10 +1,8 @@ -resource "aws_api_gateway_gateway_response" "wrapper" { - for_each = var.gateway_responses - +resource "aws_api_gateway_gateway_response" "this" { rest_api_id = var.rest_api_id - response_type = each.key - status_code = each.value.status_code + response_type = var.response_type + status_code = var.status_code - response_templates = each.value.response_templates - response_parameters = each.value.response_parameters + response_templates = var.gateway_responses + response_parameters = var.response_parameters } diff --git a/modules/gateway_response/variables.tf b/modules/gateway_response/variables.tf index 8deba13..e5ce59f 100644 --- a/modules/gateway_response/variables.tf +++ b/modules/gateway_response/variables.tf @@ -4,8 +4,26 @@ variable "rest_api_id" { default = "" } +variable "response_type" { + description = "The response type of the gateway response" + type = string + default = "" +} + +variable "status_code" { + description = "The status code of the gateway response" + type = string + default = "" +} + variable "gateway_responses" { description = "map of gateway responses" type = map(any) default = {} } + +variable "response_parameters" { + description = "map of response parameters" + type = map(any) + default = {} +}