Class CrossAccountDestination

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.logs.CrossAccountDestination
All Implemented Interfaces:
IConstruct, IDependable, IResource, ILogSubscriptionDestination, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.095Z") @Stability(Stable) public class CrossAccountDestination extends Resource implements ILogSubscriptionDestination
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.

Consumers will hardly ever need to use this class. Instead, directly subscribe a Kinesis stream using the integration class in the @aws-cdk/aws-logs-destinations package; if necessary, a CrossAccountDestination will be created automatically.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.iam.*;
 import software.amazon.awscdk.services.logs.*;
 Role role;
 CrossAccountDestination crossAccountDestination = CrossAccountDestination.Builder.create(this, "MyCrossAccountDestination")
         .role(role)
         .targetArn("targetArn")
         // the properties below are optional
         .destinationName("destinationName")
         .build();
 
  • Constructor Details

    • CrossAccountDestination

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

      protected CrossAccountDestination(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CrossAccountDestination

      @Stability(Stable) public CrossAccountDestination(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CrossAccountDestinationProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • addToPolicy

      @Stability(Stable) public void addToPolicy(@NotNull PolicyStatement statement)
      Parameters:
      statement - This parameter is required.
    • bind

      @Stability(Stable) @NotNull public LogSubscriptionDestinationConfig bind(@NotNull Construct _scope, @NotNull ILogGroup _sourceLogGroup)
      Return the properties required to send subscription events to this destination.

      If necessary, the destination can use the properties of the SubscriptionFilter object itself to configure its permissions to allow the subscription to write to it.

      The destination may reconfigure its own permissions in response to this function call.

      Specified by:
      bind in interface ILogSubscriptionDestination
      Parameters:
      _scope - This parameter is required.
      _sourceLogGroup - This parameter is required.
    • getDestinationArn

      @Stability(Stable) @NotNull public String getDestinationArn()
      The ARN of this CrossAccountDestination object.
    • getDestinationName

      @Stability(Stable) @NotNull public String getDestinationName()
      The name of this CrossAccountDestination object.
    • getPolicyDocument

      @Stability(Stable) @NotNull public PolicyDocument getPolicyDocument()
      Policy object of this CrossAccountDestination object.