github.com/ves/terraform@v0.8.0-beta2/website/source/docs/providers/aws/r/api_gateway_integration_response.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_api_gateway_integration_response" 4 sidebar_current: "docs-aws-resource-api-gateway-integration-response" 5 description: |- 6 Provides an HTTP Method Integration Response for an API Gateway Resource. 7 --- 8 9 # aws\_api\_gateway\_integration\_response 10 11 Provides an HTTP Method Integration Response for an API Gateway Resource. 12 13 -> **Note:** Depends on having `aws_api_gateway_integration` inside your rest api. To ensure this 14 you might need to add an explicit `depends_on` for clean runs. 15 16 ## Example Usage 17 18 ``` 19 resource "aws_api_gateway_rest_api" "MyDemoAPI" { 20 name = "MyDemoAPI" 21 description = "This is my API for demonstration purposes" 22 } 23 24 resource "aws_api_gateway_resource" "MyDemoResource" { 25 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 26 parent_id = "${aws_api_gateway_rest_api.MyDemoAPI.root_resource_id}" 27 path_part = "mydemoresource" 28 } 29 30 resource "aws_api_gateway_method" "MyDemoMethod" { 31 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 32 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 33 http_method = "GET" 34 authorization = "NONE" 35 } 36 37 resource "aws_api_gateway_integration" "MyDemoIntegration" { 38 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 39 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 40 http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}" 41 type = "MOCK" 42 } 43 44 resource "aws_api_gateway_method_response" "200" { 45 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 46 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 47 http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}" 48 status_code = "200" 49 } 50 51 resource "aws_api_gateway_integration_response" "MyDemoIntegrationResponse" { 52 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 53 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 54 http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}" 55 status_code = "${aws_api_gateway_method_response.200.status_code}" 56 } 57 ``` 58 59 ## Argument Reference 60 61 The following arguments are supported: 62 63 * `rest_api_id` - (Required) The ID of the associated REST API 64 * `resource_id` - (Required) The API resource ID 65 * `http_method` - (Required) The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`, `ANY`) 66 * `status_code` - (Required) The HTTP status code 67 * `selection_pattern` - (Optional) Specifies the regular expression pattern used to choose 68 an integration response based on the response from the backend. 69 If the backend is an `AWS` Lambda function, the AWS Lambda function error header is matched. 70 For all other `HTTP` and `AWS` backends, the HTTP status code is matched. 71 * `response_templates` - (Optional) A map specifying the templates used to transform the integration response body 72 * `response_parameters` - (Optional) A map of response parameters that can be read from the backend response. 73 For example: `response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }`, 74 * `response_parameters_in_json` - **Deprecated**, use `response_parameters` instead.