github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/website/source/docs/providers/aws/r/api_gateway_integration.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_api_gateway_integration" 4 sidebar_current: "docs-aws-resource-api-gateway-integration" 5 description: |- 6 Provides an HTTP Method Integration for an API Gateway Resource. 7 --- 8 9 # aws\_api\_gateway\_integration 10 11 Provides an HTTP Method Integration 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 42 ## Argument Reference 43 44 The following arguments are supported: 45 46 * `rest_api_id` - (Required) The ID of the associated REST API 47 * `resource_id` - (Required) The API resource ID 48 * `http_method` - (Required) The HTTP method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`) 49 * `type` - (Required) The integration input's type (HTTP, MOCK, AWS) 50 * `uri` - (Optional) The input's URI (HTTP, AWS). **Required** if `type` is `HTTP` or `AWS`. 51 For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification . For AWS integrations, the URI should be of the form `arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}`. `region`, `subdomain` and `service` are used to determine the right endpoint. 52 e.g. `arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:012345678901:function:my-func/invocations` 53 * `credentials` - (Optional) The credentials required for the integration. For `AWS` integrations, 2 options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's ARN. To require that the caller's identity be passed through from the request, specify the string `arn:aws:iam::\*:user/\*`. 54 * `integration_http_method` - (Optional) The integration HTTP method 55 (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTION`). **Required** if `type` is `AWS` or `HTTP`. 56 Not all methods are compatible with all `AWS` integrations. 57 e.g. Lambda function [can only be invoked](https://github.com/awslabs/aws-apigateway-importer/issues/9#issuecomment-129651005) via `POST`. 58 * `request_templates` - (Optional) A map of the integration's request templates.