Interface InterceptorOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
InterceptorOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.451Z") @Stability(Stable) public interface InterceptorOptions extends software.amazon.jsii.JsiiSerializable
Options for configuring an interceptor.

Example:

 // Create Lambda functions for interceptors
 Function requestInterceptorFn = Function.Builder.create(this, "RequestInterceptor")
         .runtime(Runtime.PYTHON_3_12)
         .handler("index.handler")
         .code(Code.fromInline("\ndef handler(event, context):\n    # Validate and transform request\n    return {\n        \"interceptorOutputVersion\": \"1.0\",\n        \"mcp\": {\n            \"transformedGatewayRequest\": event[\"mcp\"][\"gatewayRequest\"]\n        }\n    }\n  "))
         .build();
 Function responseInterceptorFn = Function.Builder.create(this, "ResponseInterceptor")
         .runtime(Runtime.PYTHON_3_12)
         .handler("index.handler")
         .code(Code.fromInline("\ndef handler(event, context):\n    # Filter or transform response\n    return {\n        \"interceptorOutputVersion\": \"1.0\",\n        \"mcp\": {\n            \"transformedGatewayResponse\": event[\"mcp\"][\"gatewayResponse\"]\n        }\n    }\n  "))
         .build();
 // Create gateway with interceptors
 Gateway gateway = Gateway.Builder.create(this, "MyGateway")
         .gatewayName("my-gateway")
         .interceptorConfigurations(List.of(LambdaInterceptor.forRequest(requestInterceptorFn, InterceptorOptions.builder()
                 .passRequestHeaders(true)
                 .build()), LambdaInterceptor.forResponse(responseInterceptorFn)))
         .build();
 
  • Method Details

    • getPassRequestHeaders

      @Stability(Stable) @Nullable default Boolean getPassRequestHeaders()
      Whether to pass request headers to the interceptor Lambda function.

      Security Warning: Request headers can contain sensitive information such as authentication tokens and credentials. Only enable this if your interceptor needs access to headers and you have verified that sensitive information is not logged or exposed.

      Default: false - Headers are not passed to interceptor for security

    • builder

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