StepFunctionsExecutionIntegrationOptions Struct
Options when configuring Step Functions synchronous integration with Rest API.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
declare const role: iam.Role;
declare const vpcLink: apigateway.VpcLink;
const stepFunctionsExecutionIntegrationOptions: apigateway.StepFunctionsExecutionIntegrationOptions = {
authorizer: false,
cacheKeyParameters: ['cacheKeyParameters'],
cacheNamespace: 'cacheNamespace',
connectionType: apigateway.ConnectionType.INTERNET,
contentHandling: apigateway.ContentHandling.CONVERT_TO_BINARY,
credentialsPassthrough: false,
credentialsRole: role,
headers: false,
integrationResponses: [{
statusCode: 'statusCode',
// the properties below are optional
contentHandling: apigateway.ContentHandling.CONVERT_TO_BINARY,
responseParameters: {
responseParametersKey: 'responseParameters',
},
responseTemplates: {
responseTemplatesKey: 'responseTemplates',
},
selectionPattern: 'selectionPattern',
}],
passthroughBehavior: apigateway.PassthroughBehavior.WHEN_NO_MATCH,
path: false,
querystring: false,
requestContext: {
accountId: false,
apiId: false,
apiKey: false,
authorizerPrincipalId: false,
caller: false,
cognitoAuthenticationProvider: false,
cognitoAuthenticationType: false,
cognitoIdentityId: false,
cognitoIdentityPoolId: false,
httpMethod: false,
requestId: false,
resourceId: false,
resourcePath: false,
sourceIp: false,
stage: false,
user: false,
userAgent: false,
userArn: false,
},
requestParameters: {
requestParametersKey: 'requestParameters',
},
requestTemplates: {
requestTemplatesKey: 'requestTemplates',
},
responseTransferMode: apigateway.ResponseTransferMode.BUFFERED,
timeout: cdk.Duration.minutes(30),
useDefaultMethodResponses: false,
vpcLink: vpcLink,
};
Properties
The execution input will include a new key authorizer:
{ "body": {}, "authorizer": { "key": "value" } }
cacheKeyParametersstring[]cache_key_parameterstyping.List[str]cacheKeyParametersList<String>CacheKeyParametersstring[]CacheKeyParameters*[]*string#It determines request parameters that will make it into the cache key.
cacheNamespacestringcache_namespacestrcacheNamespaceStringCacheNamespacestringCacheNamespace*string#connectionTypeConnectionTypeconnection_typeConnectionTypeconnectionTypeConnectionTypeConnectionTypeConnectionTypeConnectionTypeConnectionType= ConnectionType.VPC_LINK if `vpcL…#default
Default: ConnectionType.VPC_LINK if vpcLink property is configured; ConnectionType.Internet otherwise.
contentHandlingContentHandlingcontent_handlingContentHandlingcontentHandlingContentHandlingContentHandlingContentHandlingContentHandlingContentHandling= none if this property isn't defi…#default
Default: none 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 passthroughBehaviors property is configured to support payload pass-through.
credentialsPassthroughbooleancredentials_passthroughboolcredentialsPassthroughBooleanCredentialsPassthroughboolCredentialsPassthrough*bool= Caller identity is not passed th…#default
Default: Caller identity is not passed through
credentialsRoleIRolecredentials_roleIRolecredentialsRoleIRoleCredentialsRoleIRoleCredentialsRoleIRole= A role is not assumed#Mutually exclusive with credentialsPassThrough.
The execution input will include a new key headers:
{ "body": {}, "headers": { "header1": "value", "header2": "value" } }
integrationResponsesIntegrationResponse[]integration_responsestyping.List[IntegrationResponse]integrationResponsesList<IntegrationResponse>IntegrationResponsesIntegrationResponse[]IntegrationResponses*[]IntegrationResponse#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.
passthroughBehaviorPassthroughBehaviorpassthrough_behaviorPassthroughBehaviorpassthroughBehaviorPassthroughBehaviorPassthroughBehaviorPassthroughBehaviorPassthroughBehaviorPassthroughBehavior#There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.
The execution input will include a new key path:
{ "body": {}, "path": { "resourceName": "resourceValue" } }
The execution input will include a new key queryString:
{ "body": {}, "querystring": { "key": "value" } }
requestContextRequestContextrequest_contextRequestContextrequestContextRequestContextRequestContextRequestContextRequestContextRequestContext= all parameters within request co…#The execution input will include a new key requestContext:
{ "body": {}, "requestContext": { "key": "value" } }
default
Default: all parameters within request context will be set as false
requestParameters{ [key: string]: string }request_parameterstyping.Mapping[str, str]requestParametersMap<String, String>RequestParametersIDictionary<string, string>RequestParameters*map[string]*string#notes
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.location.name, where location is querystring, path, or header, and name is a valid, unique parameter name.
The 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.
requestTemplates{ [key: string]: string }request_templatestyping.Mapping[str, str]requestTemplatesMap<String, String>RequestTemplatesIDictionary<string, string>RequestTemplates*map[string]*string#notes
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": "{ \"statusCode\": 200 }" }
responseTransferModeResponseTransferModeresponse_transfer_modeResponseTransferModeresponseTransferModeResponseTransferModeResponseTransferModeResponseTransferModeResponseTransferModeResponseTransferMode= ResponseTransferMode.BUFFERED#To enable response streaming, set this value to ResponseTransferMode.STREAM.
notes
By default, the value must be between 50 milliseconds and 29 seconds. The upper bound can be increased for regional and private Rest APIs only, via a quota increase request for your account. This increase might require a reduction in your account-level throttle quota limit.
See {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html Amazon API Gateway quotas} for more details.
useDefaultMethodResponsesbooleanuse_default_method_responsesbooluseDefaultMethodResponsesBooleanUseDefaultMethodResponsesboolUseDefaultMethodResponses*bool= true#