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 { CrossAccountDestination } from 'aws-cdk-lib/aws-logs';Or use the module namespace:
import * as logs from 'aws-cdk-lib/aws-logs';
// logs.CrossAccountDestinationConfiguration passed to the constructor as CrossAccountDestinationProps.
roleRequiredIRoleRefThe role to assume that grants permissions to write to 'target'. The role must be assumable by 'logs.{REGION}.amazonaws.com'.
targetArnRequiredstringThe log destination target's ARN.
destinationNameOptionalstringThe name of the log destination.
Default: Automatically generated
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-logs