Show / Hide Table of Contents

Interface IAddLambdaTargetOptions

(experimental) Options for adding a Lambda target to a gateway.

Namespace: Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
Assembly: Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.dll
Syntax (csharp)
public interface IAddLambdaTargetOptions
Syntax (vb)
Public Interface IAddLambdaTargetOptions
Remarks

Stability: Experimental

ExampleMetadata: fixture=default infused

Examples
// Create a gateway first
             var gateway = new Gateway(this, "MyGateway", new GatewayProps {
                 GatewayName = "my-gateway"
             });

             var lambdaFunction = new Function(this, "MyFunction", new FunctionProps {
                 Runtime = Runtime.NODEJS_22_X,
                 Handler = "index.handler",
                 Code = Code.FromInline(@"
                     exports.handler = async (event) => {
                       return {
                         statusCode: 200,
                         body: JSON.stringify({ message: 'Hello from Lambda!' })
                       };
                     };
                   ")
             });

             var lambdaTarget = gateway.AddLambdaTarget("MyLambdaTarget", new AddLambdaTargetOptions {
                 GatewayTargetName = "my-lambda-target",
                 Description = "Lambda function target",
                 LambdaFunction = lambdaFunction,
                 ToolSchema = ToolSchema.FromInline(new [] { new ToolDefinition {
                     Name = "hello_world",
                     Description = "A simple hello world tool",
                     InputSchema = new SchemaDefinition {
                         Type = SchemaDefinitionType.OBJECT,
                         Properties = new Dictionary<string, SchemaDefinition> {
                             { "name", new SchemaDefinition {
                                 Type = SchemaDefinitionType.STRING,
                                 Description = "The name to greet"
                             } }
                         },
                         Required = new [] { "name" }
                     }
                 } })
             });

Synopsis

Properties

CredentialProviderConfigurations

(experimental) Credential providers for authentication.

Description

(experimental) Optional description for the gateway target.

GatewayTargetName

(experimental) The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).

LambdaFunction

(experimental) The Lambda function to associate with this target.

ToolSchema

(experimental) The tool schema defining the available tools.

Properties

CredentialProviderConfigurations

(experimental) Credential providers for authentication.

ICredentialProviderConfig[]? CredentialProviderConfigurations { get; }
Property Value

ICredentialProviderConfig[]

Remarks

Default: - [GatewayCredentialProvider.iamRole()]

Stability: Experimental

Description

(experimental) Optional description for the gateway target.

string? Description { get; }
Property Value

string

Remarks

Default: - No description

Stability: Experimental

GatewayTargetName

(experimental) The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).

string GatewayTargetName { get; }
Property Value

string

Remarks

Stability: Experimental

LambdaFunction

(experimental) The Lambda function to associate with this target.

IFunction LambdaFunction { get; }
Property Value

IFunction

Remarks

Stability: Experimental

ToolSchema

(experimental) The tool schema defining the available tools.

ToolSchema ToolSchema { get; }
Property Value

ToolSchema

Remarks

Stability: Experimental

Back to top Generated by DocFX