AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

CrossAccountDestination

A new CloudWatch Logs Destination for use in cross-account scenarios. CrossAccountDestinations are used to subscribe a Kinesis stream in a different account to a CloudWatch Subscription. For cross-account scenarios, you need to manually create a `CrossAccountDestination` in the destination account. The integration classes in the `aws-cdk-lib/aws-logs-destinations` package (such as `KinesisDestination`) only handle same-account scenarios and do not automatically create `CrossAccountDestination` for cross-account usage.

Import

import { CrossAccountDestination } from 'aws-cdk-lib/aws-logs';

Or use the module namespace:

import * as logs from 'aws-cdk-lib/aws-logs';
// logs.CrossAccountDestination

Properties

Configuration passed to the constructor as CrossAccountDestinationProps.

roleRequired
IRoleRef

The role to assume that grants permissions to write to 'target'. The role must be assumable by 'logs.{REGION}.amazonaws.com'.

targetArnRequired
string

The log destination target's ARN.

destinationNameOptional
string

The name of the log destination.

Default: Automatically generated

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter