Class DataSourceConfig

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.DataSourceConfig
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.129.0 (build eaca441)", date="2026-05-19T08:18:44.377Z") @Stability(Stable) public class DataSourceConfig extends software.amazon.jsii.JsiiObject
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 string
  • DataSourceConfig.fromCloudWatchLogs() for external agents or custom log groups

Example:

 // CloudWatch Logs data source (for external agents)
 DataSourceConfig dataSource = DataSourceConfig.fromCloudWatchLogs(CloudWatchLogsDataSourceConfig.builder()
         .logGroupNames(List.of("/aws/my-external-agent/logs"))
         .serviceNames(List.of("my-external-agent"))
         .build());
 
  • Constructor Details

    • DataSourceConfig

      protected DataSourceConfig(software.amazon.jsii.JsiiObjectRef objRef)
    • DataSourceConfig

      protected DataSourceConfig(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • fromAgentRuntimeEndpoint

      @Stability(Stable) @NotNull public static DataSourceConfig fromAgentRuntimeEndpoint(@NotNull IBedrockAgentRuntime runtime, @Nullable IRuntimeEndpoint endpoint)
      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
       Runtime runtime;
       RuntimeEndpoint endpoint = runtime.addEndpoint("PROD");
       DataSourceConfig dataSource = DataSourceConfig.fromAgentRuntimeEndpoint(runtime, endpoint);
       

      Parameters:
      runtime -
      • The AgentCore Runtime construct.
      This parameter is required.
      endpoint -
      • The RuntimeEndpoint construct.
      Returns:
      A DataSourceConfig instance
    • fromAgentRuntimeEndpoint

      @Stability(Stable) @NotNull public static DataSourceConfig fromAgentRuntimeEndpoint(@NotNull IBedrockAgentRuntime runtime)
      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
       Runtime runtime;
       RuntimeEndpoint endpoint = runtime.addEndpoint("PROD");
       DataSourceConfig dataSource = DataSourceConfig.fromAgentRuntimeEndpoint(runtime, endpoint);
       

      Parameters:
      runtime -
      • The AgentCore Runtime construct.
      This parameter is required.
      Returns:
      A DataSourceConfig instance
    • fromAgentRuntimeEndpointName

      @Stability(Stable) @NotNull public static DataSourceConfig fromAgentRuntimeEndpointName(@NotNull IBedrockAgentRuntime runtime, @NotNull String endpointName)
      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:

       Runtime runtime;
       DataSourceConfig dataSource = DataSourceConfig.fromAgentRuntimeEndpointName(runtime, "PROD");
       

      Parameters:
      runtime -
      • The AgentCore Runtime construct.
      This parameter is required.
      endpointName -
      • The name of the runtime endpoint.
      This parameter is required.
      Returns:
      A DataSourceConfig instance
    • fromCloudWatchLogs

      @Stability(Stable) @NotNull public static DataSourceConfig fromCloudWatchLogs(@NotNull CloudWatchLogsDataSourceConfig config)
      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:

       DataSourceConfig dataSource = DataSourceConfig.fromCloudWatchLogs(CloudWatchLogsDataSourceConfig.builder()
               .logGroupNames(List.of("/aws/bedrock-agentcore/runtimes/myRuntime-abc123-DEFAULT"))
               .serviceNames(List.of("myRuntime.DEFAULT"))
               .build());
       

      Parameters:
      config -
      • The CloudWatch Logs data source configuration.
      This parameter is required.
      Returns:
      A DataSourceConfig instance
    • bind

      @Stability(Stable) @NotNull public DataSourceConfigBindResult bind()
      Binds the data source configuration to produce the L1 property.
    • getCloudWatchLogsConfig

      @Stability(Stable) @NotNull public CloudWatchLogsDataSourceConfig getCloudWatchLogsConfig()
      The CloudWatch Logs configuration.