Class LambdaIntegration.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<LambdaIntegration>
- Enclosing class:
- LambdaIntegration
LambdaIntegration
.-
Method Summary
Modifier and TypeMethodDescriptionallowTestInvoke
(Boolean allowTestInvoke) Allow invoking method from AWS Console UI (for testing purposes).build()
cacheKeyParameters
(List<String> cacheKeyParameters) A list of request parameters whose values are to be cached.cacheNamespace
(String cacheNamespace) An API-specific tag group of related cached parameters.connectionType
(ConnectionType connectionType) The type of network connection to the integration endpoint.contentHandling
(ContentHandling contentHandling) Specifies how to handle request payload content type conversions.static LambdaIntegration.Builder
credentialsPassthrough
(Boolean credentialsPassthrough) Requires that the caller's identity be passed through from the request.credentialsRole
(IRole credentialsRole) An IAM role that API Gateway assumes.integrationResponses
(List<? extends IntegrationResponse> integrationResponses) The response that API Gateway provides after a method's backend completes processing a request.passthroughBehavior
(PassthroughBehavior passthroughBehavior) Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource.Use proxy integration or normal (request/response mapping) integration.requestParameters
(Map<String, String> requestParameters) The request parameters that API Gateway sends with the backend request.requestTemplates
(Map<String, String> requestTemplates) A map of Apache Velocity templates that are applied on the request payload.The maximum amount of time an integration will run before it returns without a response.The VpcLink used for the integration.
-
Method Details
-
create
- Parameters:
handler
- This parameter is required.- Returns:
- a new instance of
LambdaIntegration.Builder
.
-
cacheKeyParameters
@Stability(Stable) public LambdaIntegration.Builder cacheKeyParameters(List<String> cacheKeyParameters) A list of request parameters whose values are to be cached.It determines request parameters that will make it into the cache key.
- Parameters:
cacheKeyParameters
- A list of request parameters whose values are to be cached. This parameter is required.- Returns:
this
-
cacheNamespace
An API-specific tag group of related cached parameters.- Parameters:
cacheNamespace
- An API-specific tag group of related cached parameters. This parameter is required.- Returns:
this
-
connectionType
The type of network connection to the integration endpoint.Default: - ConnectionType.VPC_LINK if `vpcLink` property is configured; ConnectionType.Internet otherwise.
- Parameters:
connectionType
- The type of network connection to the integration endpoint. This parameter is required.- Returns:
this
-
contentHandling
@Stability(Stable) public LambdaIntegration.Builder contentHandling(ContentHandling contentHandling) Specifies how to handle request payload content type conversions.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.
- Parameters:
contentHandling
- Specifies how to handle request payload content type conversions. This parameter is required.- Returns:
this
-
credentialsPassthrough
@Stability(Stable) public LambdaIntegration.Builder credentialsPassthrough(Boolean credentialsPassthrough) Requires that the caller's identity be passed through from the request.Default: Caller identity is not passed through
- Parameters:
credentialsPassthrough
- Requires that the caller's identity be passed through from the request. This parameter is required.- Returns:
this
-
credentialsRole
An IAM role that API Gateway assumes.Mutually exclusive with
credentialsPassThrough
.Default: A role is not assumed
- Parameters:
credentialsRole
- An IAM role that API Gateway assumes. This parameter is required.- Returns:
this
-
integrationResponses
@Stability(Stable) public LambdaIntegration.Builder integrationResponses(List<? extends IntegrationResponse> 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.
- Parameters:
integrationResponses
- The response that API Gateway provides after a method's backend completes processing a request. This parameter is required.- Returns:
this
-
passthroughBehavior
@Stability(Stable) public LambdaIntegration.Builder passthroughBehavior(PassthroughBehavior passthroughBehavior) Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource.There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.
- Parameters:
passthroughBehavior
- Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. This parameter is required.- Returns:
this
-
requestParameters
@Stability(Stable) public LambdaIntegration.Builder requestParameters(Map<String, 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.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.
- Parameters:
requestParameters
- The request parameters that API Gateway sends with the backend request. This parameter is required.- Returns:
this
-
requestTemplates
@Stability(Stable) public LambdaIntegration.Builder requestTemplates(Map<String, String> 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": "{ \"statusCode\": 200 }" }
- Parameters:
requestTemplates
- A map of Apache Velocity templates that are applied on the request payload. This parameter is required.- Returns:
this
- See Also:
-
timeout
The maximum amount of time an integration will run before it returns without a response.Must be between 50 milliseconds and 29 seconds.
Default: Duration.seconds(29)
- Parameters:
timeout
- The maximum amount of time an integration will run before it returns without a response. This parameter is required.- Returns:
this
-
vpcLink
The VpcLink used for the integration.Required if connectionType is VPC_LINK
- Parameters:
vpcLink
- The VpcLink used for the integration. This parameter is required.- Returns:
this
-
allowTestInvoke
Allow invoking method from AWS Console UI (for testing purposes).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 tofalse
, the function will only be usable from the deployment endpoint.Default: true
- Parameters:
allowTestInvoke
- Allow invoking method from AWS Console UI (for testing purposes). This parameter is required.- Returns:
this
-
proxy
Use proxy integration or normal (request/response mapping) integration.Default: true
- Parameters:
proxy
- Use proxy integration or normal (request/response mapping) integration. This parameter is required.- Returns:
this
- See Also:
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<LambdaIntegration>
- Returns:
- a newly built instance of
LambdaIntegration
.
-