class DataSourceConfig
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.DataSourceConfig |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#DataSourceConfig |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.DataSourceConfig |
Python | aws_cdk.aws_bedrock_agentcore_alpha.DataSourceConfig |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป DataSourceConfig |
Configuration for the data source used in online evaluation.
Use the static factory methods to create data source configurations:
DataSourceConfig.fromAgentRuntimeEndpoint()for AgentCore Runtime (recommended)DataSourceConfig.fromAgentRuntimeEndpointName()for AgentCore Runtime using endpoint name stringDataSourceConfig.fromCloudWatchLogs()for external agents or custom log groups
Example
// CloudWatch Logs data source (for external agents)
const dataSource = agentcore.DataSourceConfig.fromCloudWatchLogs({
logGroupNames: ['/aws/my-external-agent/logs'],
serviceNames: ['my-external-agent'],
});
Properties
| Name | Type | Description |
|---|---|---|
| cloud | Cloud | The CloudWatch Logs configuration. |
cloudWatchLogsConfig
Type:
Cloud
The CloudWatch Logs configuration.
Methods
| Name | Description |
|---|---|
| bind() | Binds the data source configuration to produce the L1 property. |
| static from | Creates a data source configuration from an AgentCore Runtime and optional endpoint. |
| static from | Creates a data source configuration from an AgentCore Runtime and an endpoint name string. |
| static from | Creates a CloudWatch Logs data source configuration. |
bind()
public bind(): DataSourceConfigBindResult
Returns
Binds the data source configuration to produce the L1 property.
static fromAgentRuntimeEndpoint(runtime, endpoint?)
public static fromAgentRuntimeEndpoint(runtime: IBedrockAgentRuntime, endpoint?: IRuntimeEndpoint): DataSourceConfig
Parameters
- runtime
IBedrockโ - The AgentCore Runtime construct.Agent Runtime - endpoint
IRuntimeโ - The RuntimeEndpoint construct.Endpoint
Returns
Creates a data source configuration from an AgentCore Runtime and optional endpoint.
This is the recommended way to configure evaluation for AgentCore Runtime agents. It automatically derives the CloudWatch log group and service name from the runtime and endpoint. Example
// Using a specific endpoint
declare const runtime: agentcore.Runtime;
const endpoint = runtime.addEndpoint('PROD');
const dataSource = agentcore.DataSourceConfig.fromAgentRuntimeEndpoint(runtime, endpoint);
static fromAgentRuntimeEndpointName(runtime, endpointName)
public static fromAgentRuntimeEndpointName(runtime: IBedrockAgentRuntime, endpointName: string): DataSourceConfig
Parameters
- runtime
IBedrockโ - The AgentCore Runtime construct.Agent Runtime - endpointName
stringโ - The name of the runtime endpoint.
Returns
Creates a data source configuration from an AgentCore Runtime and an endpoint name string.
Use this method when you want to reference an endpoint by name without
having a construct reference. For construct references, prefer fromAgentRuntimeEndpoint().
Example
declare const runtime: agentcore.Runtime;
const dataSource = agentcore.DataSourceConfig.fromAgentRuntimeEndpointName(runtime, 'PROD');
static fromCloudWatchLogs(config)
public static fromCloudWatchLogs(config: CloudWatchLogsDataSourceConfig): DataSourceConfig
Parameters
- config
Cloudโ - The CloudWatch Logs data source configuration.Watch Logs Data Source Config
Returns
Creates a CloudWatch Logs data source configuration.
Use this when your agent traces are stored in CloudWatch Logs, such as for external agents or when you need to specify log groups directly. Example
const dataSource = agentcore.DataSourceConfig.fromCloudWatchLogs({
logGroupNames: ['/aws/bedrock-agentcore/runtimes/myRuntime-abc123-DEFAULT'],
serviceNames: ['myRuntime.DEFAULT'],
});

.NET
Go
Java
Python
TypeScript (