interface AddLambdaTargetOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.AddLambdaTargetOptions |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#AddLambdaTargetOptions |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.AddLambdaTargetOptions |
Python | aws_cdk.aws_bedrock_agentcore_alpha.AddLambdaTargetOptions |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป AddLambdaTargetOptions |
Options for adding a Lambda target to a gateway.
Example
// Create a gateway first
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
const lambdaFunction = new lambda.Function(this, "MyFunction", {
runtime: lambda.Runtime.NODEJS_22_X,
handler: "index.handler",
code: lambda.Code.fromInline(`
exports.handler = async (event) => {
return {
statusCode: 200,
body: JSON.stringify({ message: 'Hello from Lambda!' })
};
};
`),
});
const lambdaTarget = gateway.addLambdaTarget("MyLambdaTarget", {
gatewayTargetName: "my-lambda-target",
description: "Lambda function target",
lambdaFunction: lambdaFunction,
toolSchema: agentcore.ToolSchema.fromInline([
{
name: "hello_world",
description: "A simple hello world tool",
inputSchema: {
type: agentcore.SchemaDefinitionType.OBJECT,
properties: {
name: {
type: agentcore.SchemaDefinitionType.STRING,
description: "The name to greet",
},
},
required: ["name"],
},
},
]),
});
Properties
| Name | Type | Description |
|---|---|---|
| gateway | string | The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). |
| lambda | IFunction | The Lambda function to associate with this target. |
| tool | Tool | The tool schema defining the available tools. |
| credential | ICredential[] | Credential providers for authentication. |
| description? | string | Optional description for the gateway target. |
gatewayTargetName
Type:
string
The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).
lambdaFunction
Type:
IFunction
The Lambda function to associate with this target.
toolSchema
Type:
Tool
The tool schema defining the available tools.
credentialProviderConfigurations?
Type:
ICredential[]
(optional, default: [GatewayCredentialProvider.iamRole()])
Credential providers for authentication.
description?
Type:
string
(optional, default: No description)
Optional description for the gateway target.

.NET
Go
Java
Python
TypeScript (