interface GatewayTargetLambdaProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.GatewayTargetLambdaProps |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#GatewayTargetLambdaProps |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.GatewayTargetLambdaProps |
Python | aws_cdk.aws_bedrock_agentcore_alpha.GatewayTargetLambdaProps |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป GatewayTargetLambdaProps |
Properties for creating a Lambda-based Gateway Target Convenience interface for the most common use case.
Example
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!' })
};
};
`),
});
// Create a gateway target with Lambda and tool schema
const target = agentcore.GatewayTarget.forLambda(this, "MyLambdaTarget", {
gatewayTargetName: "my-lambda-target",
description: "Target for Lambda function integration",
gateway: gateway,
lambdaFunction: lambdaFunction,
toolSchema: agentcore.ToolSchema.fromLocalAsset(
path.join(__dirname, "schemas", "my-tool-schema.json")
),
});
Properties
| Name | Type | Description |
|---|---|---|
| gateway | IGateway | The gateway this target belongs to. |
| gateway | string | The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$. |
| 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 Lambda targets only support IAM role authentication. |
| description? | string | Optional description for the gateway target The description can have up to 200 characters. |
gateway
Type:
IGateway
The gateway this target belongs to.
gatewayTargetName
Type:
string
The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$.
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.fromIamRole()])
Credential providers for authentication Lambda targets only support IAM role authentication.
description?
Type:
string
(optional, default: No description)
Optional description for the gateway target The description can have up to 200 characters.

.NET
Go
Java
Python
TypeScript (