Interface AddLambdaTargetOptions

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

@Generated(value="jsii-pacmak/1.130.0 (build 048a5ee)", date="2026-05-19T19:44:36.887Z") @Stability(Stable) public interface AddLambdaTargetOptions extends software.amazon.jsii.JsiiSerializable
Options for adding a Lambda target to a gateway.

Example:

 // Create a gateway first
 Gateway gateway = Gateway.Builder.create(this, "MyGateway")
         .gatewayName("my-gateway")
         .build();
 Function lambdaFunction = Function.Builder.create(this, "MyFunction")
         .runtime(Runtime.NODEJS_22_X)
         .handler("index.handler")
         .code(Code.fromInline("\n    exports.handler = async (event) => {\n      return {\n        statusCode: 200,\n        body: JSON.stringify({ message: 'Hello from Lambda!' })\n      };\n    };\n  "))
         .build();
 GatewayTarget lambdaTarget = gateway.addLambdaTarget("MyLambdaTarget", AddLambdaTargetOptions.builder()
         .gatewayTargetName("my-lambda-target")
         .description("Lambda function target")
         .lambdaFunction(lambdaFunction)
         .toolSchema(ToolSchema.fromInline(List.of(ToolDefinition.builder()
                 .name("hello_world")
                 .description("A simple hello world tool")
                 .inputSchema(SchemaDefinition.builder()
                         .type(SchemaDefinitionType.OBJECT)
                         .properties(Map.of(
                                 "name", SchemaDefinition.builder()
                                         .type(SchemaDefinitionType.STRING)
                                         .description("The name to greet")
                                         .build()))
                         .required(List.of("name"))
                         .build())
                 .build())))
         .build());
 
  • Method Details

    • getLambdaFunction

      @Stability(Stable) @NotNull IFunction getLambdaFunction()
      The Lambda function to associate with this target.
    • getToolSchema

      @Stability(Stable) @NotNull ToolSchema getToolSchema()
      The tool schema defining the available tools.
    • getCredentialProviderConfigurations

      @Stability(Stable) @Nullable default List<ICredentialProviderConfig> getCredentialProviderConfigurations()
      Credential providers for authentication.

      Default: - [GatewayCredentialProvider.iamRole()]

    • getDescription

      @Stability(Stable) @Nullable default String getDescription()
      Optional description for the gateway target.

      Default: - No description

    • getGatewayTargetName

      @Stability(Stable) @Nullable default String getGatewayTargetName()
      The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).

      Default: - auto generate

    • builder

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