aws_api_gateway_gateway_response

Provides an API Gateway Gateway Response for a REST API Gateway.

Example Usage

resource "aws_api_gateway_rest_api" "main" {
  name = "MyDemoAPI"
}

resource "aws_api_gateway_gateway_response" "test" {
  rest_api_id   = "${aws_api_gateway_rest_api.main.id}"
  status_code   = "401"
  response_type = "UNAUTHORIZED"

  response_templates = {
    "application/json" = "{'message':$context.error.messageString}"
  }

  response_parameters = {
    "gatewayresponse.header.Authorization" = "'Basic'"
  }
}

Argument Reference

The following arguments are supported:

  • rest_api_id - (Required) The string identifier of the associated REST API.
  • response_type - (Required) The response type of the associated GatewayResponse.
  • status_code - (Optional) The HTTP status code of the Gateway Response.
  • response_parameters - (Optional) A map specifying the templates used to transform the response body.
  • response_templates - (Optional) A map specifying the parameters (paths, query strings and headers) of the Gateway Response.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/r/api_gateway_gateway_response.html