GatewayTargetLambdaProps Struct
Properties for creating a Lambda-based Gateway Target Convenience interface for the most common use case.
| Source | lib/gateway/targets/target.ts |
|---|
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import { aws_lambda as lambda } from 'aws-cdk-lib';
declare const credentialProviderConfig: bedrock_agentcore_alpha.ICredentialProviderConfig;
declare const function_: lambda.Function;
declare const gateway: bedrock_agentcore_alpha.Gateway;
declare const toolSchema: bedrock_agentcore_alpha.ToolSchema;
const gatewayTargetLambdaProps: bedrock_agentcore_alpha.GatewayTargetLambdaProps = {
gateway: gateway,
lambdaFunction: function_,
toolSchema: toolSchema,
// the properties below are optional
credentialProviderConfigurations: [credentialProviderConfig],
description: 'description',
gatewayTargetName: 'gatewayTargetName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha
from aws_cdk import aws_lambda as lambda_
# credential_provider_config: bedrock_agentcore_alpha.ICredentialProviderConfig
# function_: lambda.Function
# gateway: bedrock_agentcore_alpha.Gateway
# tool_schema: bedrock_agentcore_alpha.ToolSchema
gateway_target_lambda_props = bedrock_agentcore_alpha.GatewayTargetLambdaProps(
gateway=gateway,
lambda_function=function_,
tool_schema=tool_schema,
# the properties below are optional
credential_provider_configurations=[credential_provider_config],
description="description",
gateway_target_name="gatewayTargetName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
import software.amazon.awscdk.services.lambda.*;
ICredentialProviderConfig credentialProviderConfig;
Function function_;
Gateway gateway;
ToolSchema toolSchema;
GatewayTargetLambdaProps gatewayTargetLambdaProps = GatewayTargetLambdaProps.builder()
.gateway(gateway)
.lambdaFunction(function_)
.toolSchema(toolSchema)
// the properties below are optional
.credentialProviderConfigurations(List.of(credentialProviderConfig))
.description("description")
.gatewayTargetName("gatewayTargetName")
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
using Amazon.CDK.AWS.Lambda;
ICredentialProviderConfig credentialProviderConfig;
Function function_;
Gateway gateway;
ToolSchema toolSchema;
var gatewayTargetLambdaProps = new GatewayTargetLambdaProps {
Gateway = gateway,
LambdaFunction = function_,
ToolSchema = toolSchema,
// the properties below are optional
CredentialProviderConfigurations = new [] { credentialProviderConfig },
Description = "description",
GatewayTargetName = "gatewayTargetName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
import "github.com/aws/aws-cdk-go/awscdk"
var credentialProviderConfig ICredentialProviderConfig
var function_ Function
var gateway Gateway
var toolSchema ToolSchema
gatewayTargetLambdaProps := &GatewayTargetLambdaProps{
Gateway: gateway,
LambdaFunction: function_,
ToolSchema: toolSchema,
// the properties below are optional
CredentialProviderConfigurations: []ICredentialProviderConfig{
credentialProviderConfig,
},
Description: jsii.String("description"),
GatewayTargetName: jsii.String("gatewayTargetName"),
}
Properties
credentialProviderConfigurationsoptionalICredentialProviderConfig[]credential_provider_configurationsoptionaltyping.List[ICredentialProviderConfig]credentialProviderConfigurationsoptionalList<ICredentialProviderConfig>CredentialProviderConfigurationsoptionalICredentialProviderConfig[]CredentialProviderConfigurationsoptional*[]ICredentialProviderConfig #Credential providers for authentication Lambda targets only support IAM role authentication.
Default: [GatewayCredentialProvider.fromIamRole()]
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #Optional description for the gateway target The description can have up to 200 characters.
Default: No description
The gateway this target belongs to.
gatewayTargetNameoptionalstringgateway_target_nameoptionalstrgatewayTargetNameoptionalStringGatewayTargetNameoptionalstringGatewayTargetNameoptional*string #The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$.
Default: auto generate
lambdaFunctionIFunctionlambda_functionIFunctionlambdaFunctionIFunctionLambdaFunctionIFunctionLambdaFunctionIFunction required #The Lambda function to associate with this target.
toolSchemaToolSchematool_schemaToolSchematoolSchemaToolSchemaToolSchemaToolSchemaToolSchemaToolSchema required #The tool schema defining the available tools.