LambdaIntegrationOptions Struct
| Source | aws-apigateway/lib/integrations/lambda.ts |
|---|---|
| Type last changed |
Example
declare const backend: lambda.Function;
const api = new apigateway.LambdaRestApi(this, 'myapi', {
handler: backend,
integrationOptions: {
allowTestInvoke: false,
timeout: Duration.seconds(1),
}
})
# backend: lambda.Function
api = apigateway.LambdaRestApi(self, "myapi",
handler=backend,
integration_options=apigateway.LambdaIntegrationOptions(
allow_test_invoke=False,
timeout=Duration.seconds(1)
)
)
Function backend;
LambdaRestApi api = LambdaRestApi.Builder.create(this, "myapi")
.handler(backend)
.integrationOptions(LambdaIntegrationOptions.builder()
.allowTestInvoke(false)
.timeout(Duration.seconds(1))
.build())
.build();
// Install: dotnet add package Amazon.CDK.Lib
Function backend;
var api = new LambdaRestApi(this, "myapi", new LambdaRestApiProps {
Handler = backend,
IntegrationOptions = new LambdaIntegrationOptions {
AllowTestInvoke = false,
Timeout = Duration.Seconds(1)
}
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var backend Function
api := apigateway.NewLambdaRestApi(this, jsii.String("myapi"), &LambdaRestApiProps{
Handler: backend,
IntegrationOptions: &LambdaIntegrationOptions{
AllowTestInvoke: jsii.Boolean(false),
Timeout: awscdk.Duration_Seconds(jsii.Number(1)),
},
})
Properties
allowTestInvokeoptionalbooleanallow_test_invokeoptionalboolallowTestInvokeoptionalBooleanAllowTestInvokeoptionalboolAllowTestInvokeoptional*bool = true #notes
This will add another permission to the AWS Lambda resource policy which will allow the test-invoke-stage stage to invoke this handler. If this is set to false, the function will only be usable from the deployment endpoint.
Note that this property is ignored when scopePermissionToMethod is false.
cacheKeyParametersoptionalstring[]cache_key_parametersoptionaltyping.List[str]cacheKeyParametersoptionalList<String>CacheKeyParametersoptionalstring[]CacheKeyParametersoptional*[]*string #It determines request parameters that will make it into the cache key.
cacheNamespaceoptionalstringcache_namespaceoptionalstrcacheNamespaceoptionalStringCacheNamespaceoptionalstringCacheNamespaceoptional*string #connectionTypeoptionalConnectionTypeconnection_typeoptionalConnectionTypeconnectionTypeoptionalConnectionTypeConnectionTypeoptionalConnectionTypeConnectionTypeoptionalConnectionType #Default: ConnectionType.VPC_LINK if vpcLink property is configured; ConnectionType.Internet otherwise.
contentHandlingoptionalContentHandlingcontent_handlingoptionalContentHandlingcontentHandlingoptionalContentHandlingContentHandlingoptionalContentHandlingContentHandlingoptionalContentHandling #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.
credentialsPassthroughoptionalbooleancredentials_passthroughoptionalboolcredentialsPassthroughoptionalBooleanCredentialsPassthroughoptionalboolCredentialsPassthroughoptional*bool #Default: Caller identity is not passed through
credentialsRoleoptionalIRolecredentials_roleoptionalIRolecredentialsRoleoptionalIRoleCredentialsRoleoptionalIRoleCredentialsRoleoptionalIRole #Default: A role is not assumed
Mutually exclusive with credentialsPassThrough.
integrationResponsesoptionalIntegrationResponse[]integration_responsesoptionaltyping.List[IntegrationResponse]integrationResponsesoptionalList<IntegrationResponse>IntegrationResponsesoptionalIntegrationResponse[]IntegrationResponsesoptional*[]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.
passthroughBehavioroptionalPassthroughBehaviorpassthrough_behavioroptionalPassthroughBehaviorpassthroughBehavioroptionalPassthroughBehaviorPassthroughBehavioroptionalPassthroughBehaviorPassthroughBehavioroptionalPassthroughBehavior #There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.
proxyoptionalbooleanproxyoptionalboolproxyoptionalBooleanProxyoptionalboolProxyoptional*bool = true #requestParametersoptional{ [key: string]: string }request_parametersoptionaltyping.Mapping[str, str]requestParametersoptionalMap<String, String>RequestParametersoptionalIDictionary<string, string>RequestParametersoptional*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.
requestTemplatesoptional{ [key: string]: string }request_templatesoptionaltyping.Mapping[str, str]requestTemplatesoptionalMap<String, String>RequestTemplatesoptionalIDictionary<string, string>RequestTemplatesoptional*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 }" }
responseTransferModeoptionalResponseTransferModeresponse_transfer_modeoptionalResponseTransferModeresponseTransferModeoptionalResponseTransferModeResponseTransferModeoptionalResponseTransferModeResponseTransferModeoptionalResponseTransferMode = ResponseTransferMode.BUFFERED #To enable response streaming, set this value to ResponseTransferMode.STREAM.
scopePermissionToMethodoptionalbooleanscope_permission_to_methodoptionalboolscopePermissionToMethodoptionalBooleanScopePermissionToMethodoptionalboolScopePermissionToMethodoptional*bool = true #notes
If this is set to false, the permission will allow invoking the AWS Lambda from any method. This is useful for reducing the AWS Lambda policy size for cases where the same AWS Lambda function is reused for many integrations.
Note that this will always allow test invocations.
timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration = Duration.seconds(29) #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 Amazon API Gateway quotas for more details.