Amazon API Gateway Method Integration
Integration is a property of the AWS::ApiGateway::Method resource that specifies information about the
target backend that an Amazon API Gateway (API Gateway) method calls.
Syntax
JSON
{ "CacheKeyParameters" : [String, ...], "CacheNamespace" :String, "ConnectionId" :String, "ConnectionType" :String, "ContentHandling" :String, "Credentials" :String, "IntegrationHttpMethod" :String, "IntegrationResponses" : [IntegrationResponse, ...], "PassthroughBehavior" :String, "RequestParameters" : {String:String, ...}, "RequestTemplates" : {String:String, ...}, "TimeoutInMillis" :Integer, "Type" :String, "Uri" :String}
YAML
CacheKeyParameters: -StringCacheNamespace:StringConnectionId:StringConnectionType:StringContentHandling:StringCredentials:StringIntegrationHttpMethod:StringIntegrationResponses:IntegrationResponsePassthroughBehavior:StringRequestParameters:String:StringRequestTemplates:String:StringType:StringTimeoutInMillis:IntegerUri:String
Properties
CacheKeyParameters-
A list of request parameters whose values API Gateway caches. These parameters must also be specified in RequestParameters to be supported in
CacheKeyParameters.Required: No
Type: List of String values
CacheNamespace-
An API-specific tag group of related cached parameters.
Required: No
Type: String
ContentHandling-
Specifies how to handle request payload content type conversions. Valid values are:
-
CONVERT_TO_BINARY: Converts a request payload from a base64-encoded string to a binary blob. -
CONVERT_TO_TEXT: Converts a request payload from a binary blob to a base64-encoded string.
If this property isn't defined, the request payload is passed through from the method request to the integration request without modification, provided that the
PassthroughBehaviorsproperty is configured to support payload pass-through.Required: No
Type: String
Update requires: No interruption
-
ConnectionId-
The ID of the VpcLink used for the integration when
connectionType=VPC_LINKand undefined, otherwise.Required: No
Type: String
Update requires: No interruption
ConnectionType-
The type of the network connection to the integration endpoint. The valid value is
INTERNETfor connections through the public routable internet orVPC_LINKfor private connections between API Gateway and a network load balancer in a VPC. The default value isINTERNET.Required: No
Type: String
Update requires: No interruption
Credentials-
The credentials that are required for the integration. To specify an AWS Identity and Access Management (IAM) role that API Gateway assumes, specify the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify
arn:aws:iam::*:user/*.To use resource-based permissions on the AWS Lambda (Lambda) function, don't specify this property. Use the AWS::Lambda::Permission resource to permit API Gateway to call the function. For more information, see Allow Amazon API Gateway to Invoke a Lambda Function in the AWS Lambda Developer Guide.
Required: No
Type: String
IntegrationHttpMethod-
The integration's HTTP method type.
Required: Conditional. For the
Typeproperty, if you specifyMOCK, this property is optional. For all other types, you must specify this property.Type: String
IntegrationResponses-
The response that API Gateway provides after a method's backend completes processing a request. API Gateway intercepts the response from the backend so that you can control how API Gateway surfaces backend responses. For example, you can map the backend status codes to codes that you define.
Required: No
Type: List of Amazon API Gateway Method Integration IntegrationResponse property types
PassthroughBehavior-
Indicates when API Gateway passes requests to the targeted backend. This behavior depends on the request's
Content-Typeheader and whether you defined a mapping template for it.For more information and valid values, see the
passthroughBehaviorfield in the API Gateway API Reference.Required: No
Type: String
RequestParameters-
The request parameters that API Gateway sends with the backend request. Specify request parameters as key-value pairs (string-to-string mappings), with a destination as the key and a source as the value.
Specify the destination by using the following pattern
integration.request., wherelocation.nameislocationquerystring,path, orheader, andis a valid, unique parameter name.nameThe source must be an existing method request parameter or a static value. You must enclose static values in single quotation marks and pre-encode these values based on their destination in the request.
Required: No
Type: Mapping of key-value pairs
RequestTemplates-
A map of Apache Velocity templates that are applied on the request payload. The template that API Gateway uses is based on the value of the Content-Type header that's sent by the client. The content type value is the key, and the template is the value (specified as a string), such as the following snippet:
"application/json": "{\n \"statusCode\": \"200\"\n}"For more information about templates, see API Gateway API Request and Response Payload-Mapping Template Reference in the API Gateway Developer Guide.
Required: No
Type: Mapping of key-value pairs
TimeoutInMillis-
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
Required: No
Type: Integer
Update requires: No interruption
Type-
The type of backend that your method is running, such as
HTTPorMOCK. For all of the valid values, see thetypeproperty for theIntegrationresource in the Amazon API Gateway REST API Reference.Required: Yes
Type: String
Uri-
The Uniform Resource Identifier (URI) for the integration.
If you specify
HTTPfor theTypeproperty, specify the API endpoint URL.If you specify
MOCKfor theTypeproperty, don't specify this property.If you specify
AWSfor theTypeproperty, specify an AWS service that follows this form:arn:aws:apigateway:. For example, a Lambda function URI follows this form:region:subdomain.service|service:path|action/service_apiarn:aws:apigateway:. The path is usually in the formregion:lambda:path/path/2015-03-31/functions/. For more information, see theLambdaFunctionARN/invocationsuriproperty of the Integration resource in the Amazon API Gateway REST API Reference.Required: Conditional. If you specified
HTTPorAWSfor theTypeproperty, you must specify this property.Type: String
