Interface IntegrationOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
LambdaIntegrationOptions, SagemakerIntegrationOptions, StepFunctionsExecutionIntegrationOptions
All Known Implementing Classes:
IntegrationOptions.Jsii$Proxy, LambdaIntegrationOptions.Jsii$Proxy, SagemakerIntegrationOptions.Jsii$Proxy, StepFunctionsExecutionIntegrationOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-25T14:21:09.361Z") @Stability(Stable) public interface IntegrationOptions extends software.amazon.jsii.JsiiSerializable
Example:

 import path.*;
 import software.amazon.awscdk.services.lambda.*;
 import software.amazon.awscdk.App;
 import software.amazon.awscdk.Stack;
 import software.amazon.awscdk.services.apigateway.MockIntegration;
 import software.amazon.awscdk.services.apigateway.PassthroughBehavior;
 import software.amazon.awscdk.services.apigateway.RestApi;
 import software.amazon.awscdk.services.apigateway.RequestAuthorizer;
 import software.amazon.awscdk.services.apigateway.IdentitySource;
 // Against the RestApi endpoint from the stack output, run
 // `curl -s -o /dev/null -w "%{http_code}" <url>` should return 401
 // `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: deny' <url>?allow=yes` should return 403
 // `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: allow' <url>?allow=yes` should return 200
 App app = new App();
 Stack stack = new Stack(app, "RequestAuthorizerInteg");
 Function authorizerFn = Function.Builder.create(stack, "MyAuthorizerFunction")
         .runtime(Runtime.NODEJS_LATEST)
         .handler("index.handler")
         .code(AssetCode.fromAsset(join(__dirname, "integ.request-authorizer.handler")))
         .build();
 RestApi restapi = RestApi.Builder.create(stack, "MyRestApi").cloudWatchRole(true).build();
 RequestAuthorizer authorizer = RequestAuthorizer.Builder.create(stack, "MyAuthorizer")
         .handler(authorizerFn)
         .identitySources(List.of(IdentitySource.header("Authorization"), IdentitySource.queryString("allow")))
         .build();
 RequestAuthorizer secondAuthorizer = RequestAuthorizer.Builder.create(stack, "MySecondAuthorizer")
         .handler(authorizerFn)
         .identitySources(List.of(IdentitySource.header("Authorization"), IdentitySource.queryString("allow")))
         .build();
 restapi.root.addMethod("ANY", MockIntegration.Builder.create()
         .integrationResponses(List.of(IntegrationResponse.builder().statusCode("200").build()))
         .passthroughBehavior(PassthroughBehavior.NEVER)
         .requestTemplates(Map.of(
                 "application/json", "{ \"statusCode\": 200 }"))
         .build(), MethodOptions.builder()
         .methodResponses(List.of(MethodResponse.builder().statusCode("200").build()))
         .authorizer(authorizer)
         .build());
 restapi.root.resourceForPath("auth").addMethod("ANY", MockIntegration.Builder.create()
         .integrationResponses(List.of(IntegrationResponse.builder().statusCode("200").build()))
         .passthroughBehavior(PassthroughBehavior.NEVER)
         .requestTemplates(Map.of(
                 "application/json", "{ \"statusCode\": 200 }"))
         .build(), MethodOptions.builder()
         .methodResponses(List.of(MethodResponse.builder().statusCode("200").build()))
         .authorizer(secondAuthorizer)
         .build());
 
  • Method Details

    • getCacheKeyParameters

      @Stability(Stable) @Nullable default List<String> getCacheKeyParameters()
      A list of request parameters whose values are to be cached.

      It determines request parameters that will make it into the cache key.

    • getCacheNamespace

      @Stability(Stable) @Nullable default String getCacheNamespace()
      An API-specific tag group of related cached parameters.
    • getConnectionType

      @Stability(Stable) @Nullable default ConnectionType getConnectionType()
      The type of network connection to the integration endpoint.

      Default: - ConnectionType.VPC_LINK if `vpcLink` property is configured; ConnectionType.Internet otherwise.

    • getContentHandling

      @Stability(Stable) @Nullable default ContentHandling getContentHandling()
      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.

    • getCredentialsPassthrough

      @Stability(Stable) @Nullable default Boolean getCredentialsPassthrough()
      Requires that the caller's identity be passed through from the request.

      Default: Caller identity is not passed through

    • getCredentialsRole

      @Stability(Stable) @Nullable default IRole getCredentialsRole()
      An IAM role that API Gateway assumes.

      Mutually exclusive with credentialsPassThrough.

      Default: A role is not assumed

    • getIntegrationResponses

      @Stability(Stable) @Nullable default List<IntegrationResponse> getIntegrationResponses()
      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.

    • getPassthroughBehavior

      @Stability(Stable) @Nullable default PassthroughBehavior getPassthroughBehavior()
      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.

    • getRequestParameters

      @Stability(Stable) @Nullable default Map<String,String> getRequestParameters()
      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.

    • getRequestTemplates

      @Stability(Stable) @Nullable default Map<String,String> getRequestTemplates()
      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 }" }
       

      See Also:
    • getTimeout

      @Stability(Stable) @Nullable default Duration getTimeout()
      The maximum amount of time an integration will run before it returns without a response.

      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 acccount. This increase might require a reduction in your account-level throttle quota limit. See

      invalid @link
      {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html
      Amazon API Gateway quotas} for more details.

      Default: Duration.seconds(29)

    • getVpcLink

      @Stability(Stable) @Nullable default IVpcLink getVpcLink()
      The VpcLink used for the integration.

      Required if connectionType is VPC_LINK

    • builder

      @Stability(Stable) static IntegrationOptions.Builder builder()
      Returns:
      a IntegrationOptions.Builder of IntegrationOptions