Class CloudWatchLogGroup

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.targets.CloudWatchLogGroup
All Implemented Interfaces:
IRuleTarget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.716Z") @Stability(Stable) public class CloudWatchLogGroup extends software.amazon.jsii.JsiiObject implements IRuleTarget
Use an AWS CloudWatch LogGroup as an event rule target.

Example:

 import software.amazon.awscdk.services.logs.*;
 LogGroup logGroup = LogGroup.Builder.create(this, "MyLogGroup")
         .logGroupName("MyLogGroup")
         .build();
 Rule rule = Rule.Builder.create(this, "rule")
         .eventPattern(EventPattern.builder()
                 .source(List.of("aws.ec2"))
                 .build())
         .build();
 rule.addTarget(new CloudWatchLogGroup(logGroup));
 
  • Constructor Details

    • CloudWatchLogGroup

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

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

      @Stability(Stable) public CloudWatchLogGroup(@NotNull ILogGroup logGroup, @Nullable LogGroupProps props)
      Parameters:
      logGroup - This parameter is required.
      props -
    • CloudWatchLogGroup

      @Stability(Stable) public CloudWatchLogGroup(@NotNull ILogGroup logGroup)
      Parameters:
      logGroup - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule, @Nullable String _id)
      Returns a RuleTarget that can be used to log an event into a CloudWatch LogGroup.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.
      _id -
    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule)
      Returns a RuleTarget that can be used to log an event into a CloudWatch LogGroup.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.