github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/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 ## Example Usage 14 15 ``` 16 resource "aws_api_gateway_rest_api" "MyDemoAPI" { 17 name = "MyDemoAPI" 18 description = "This is my API for demonstration purposes" 19 } 20 21 resource "aws_api_gateway_resource" "MyDemoResource" { 22 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 23 parent_id = "${aws_api_gateway_rest_api.MyDemoAPI.root_resource_id}" 24 path_part = "mydemoresource" 25 } 26 27 resource "aws_api_gateway_method" "MyDemoMethod" { 28 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 29 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 30 http_method = "GET" 31 authorization = "NONE" 32 } 33 34 resource "aws_api_gateway_integration" "MyDemoIntegration" { 35 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 36 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 37 http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}" 38 type = "MOCK" 39 } 40 41 resource "aws_api_gateway_method_response" "200" { 42 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 43 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 44 http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}" 45 status_code = "200" 46 } 47 48 resource "aws_api_gateway_integration_response" "MyDemoIntegrationResponse" { 49 rest_api_id = "${aws_api_gateway_rest_api.MyDemoAPI.id}" 50 resource_id = "${aws_api_gateway_resource.MyDemoResource.id}" 51 http_method = "${aws_api_gateway_method.MyDemoMethod.http_method}" 52 status_code = "${aws_api_gateway_method_response.200.status_code}" 53 } 54 ``` 55 56 ## Argument Reference 57 58 The following arguments are supported: 59 60 * `rest_api_id` - (Required) The ID of the associated REST API 61 * `resource_id` - (Required) The API resource ID 62 * `http_method` - (Required) The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`) 63 * `status_code` - (Required) The HTTP status code 64 * `selection_pattern` - (Optional) Specifies the regular expression pattern used to choose an integration response based on the response from the backend 65 * `response_templates` - (Optional) A map specifying the templates used to transform the integration response body