Skip to content
v2.275.0

LoggingDestination Class ​

Represents a logging destination for AgentCore Runtime.

Use the static factory methods to create instances:

  • LoggingDestination.cloudWatchLogs(logGroup) - Send logs to CloudWatch Logs
  • LoggingDestination.s3(bucket) - Send logs to S3
  • LoggingDestination.firehose(stream) - Send logs to Kinesis Data Firehose

Example ​

ts
const repository = new ecr.Repository(this, 'TestRepository', {
  repositoryName: 'test-agent-runtime',
});

const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, 'v1.0.0');

// Use a /aws/vendedlogs/ log group for same-account delivery without explicit resource policy
const logGroup = new logs.LogGroup(this, 'RuntimeLogGroup', {
  logGroupName: '/aws/vendedlogs/bedrock-agentcore/my-runtime',
});

new agentcore.Runtime(this, 'test-runtime', {
  runtimeName: 'test_runtime',
  agentRuntimeArtifact: agentRuntimeArtifact,
  tracingEnabled: true,
  loggingConfigs: [
    {
      logType: agentcore.LogType.APPLICATION_LOGS,
      destination: agentcore.LoggingDestination.cloudWatchLogs(logGroup),
    },
  ],
  manageDeliveryResourcePolicy: false,
});

Initializer ​

ts
new LoggingDestination()
python
LoggingDestination()
java
new LoggingDestination()
csharp
new LoggingDestination()
go
NewLoggingDestination()

Methods ​

cloudWatchLogs(logGroup: ILogGroup): LoggingDestination // chainable@staticmethod def cloud_watch_logs(log_group: ILogGroup) -> LoggingDestinationpublic static LoggingDestination cloudWatchLogs(ILogGroup logGroup)public static LoggingDestination CloudWatchLogs(ILogGroup logGroup)func CloudWatchLogs(LogGroup ILogGroup) LoggingDestinationstatic#
Create a logging destination that sends logs to a CloudWatch Log Group.
1 parameter

Parameters

  • logGrouplog_grouplogGrouplogGroupLogGroup — The CloudWatch Log Group to send logs to.
firehose(stream: IDeliveryStream): LoggingDestination // chainable@staticmethod def firehose(stream: IDeliveryStream) -> LoggingDestinationpublic static LoggingDestination firehose(IDeliveryStream stream)public static LoggingDestination Firehose(IDeliveryStream stream)func Firehose(Stream IDeliveryStream) LoggingDestinationstatic#
Create a logging destination that sends logs to a Kinesis Data Firehose delivery stream.
1 parameter

Parameters

  • streamstreamstreamstreamStream — The Firehose delivery stream to send logs to.
s3(bucket: IBucket): LoggingDestination // chainable@staticmethod def s3(bucket: IBucket) -> LoggingDestinationpublic static LoggingDestination s3(IBucket bucket)public static LoggingDestination S3(IBucket bucket)func S3(Bucket IBucket) LoggingDestinationstatic#
Create a logging destination that sends logs to an S3 bucket.
1 parameter

Parameters

  • bucketbucketbucketbucketBucket — The S3 bucket to send logs to.