Class CloudWatchLogGroup
Use an AWS CloudWatch LogGroup as an event rule target.
Inheritance
System.Object
CloudWatchLogGroup
Implements
Namespace: Amazon.CDK.AWS.Events.Targets
Assembly: Amazon.CDK.AWS.Events.Targets.dll
Syntax (csharp)
public class CloudWatchLogGroup : DeputyBase, IRuleTarget
Syntax (vb)
Public Class CloudWatchLogGroup
Inherits DeputyBase
Implements IRuleTarget
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Logs;
var logGroup = new LogGroup(this, "MyLogGroup", new LogGroupProps {
LogGroupName = "MyLogGroup"
});
var rule = new Rule(this, "rule", new RuleProps {
EventPattern = new EventPattern {
Source = new [] { "aws.ec2" }
}
});
rule.AddTarget(new CloudWatchLogGroup(logGroup));
Synopsis
Constructors
CloudWatchLogGroup(ILogGroup, ILogGroupProps) | |
CloudWatchLogGroup(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CloudWatchLogGroup(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(IRule, String) | Returns a RuleTarget that can be used to log an event into a CloudWatch LogGroup. |
Constructors
CloudWatchLogGroup(ILogGroup, ILogGroupProps)
public CloudWatchLogGroup(ILogGroup logGroup, ILogGroupProps props = null)
Parameters
- logGroup ILogGroup
- props ILogGroupProps
CloudWatchLogGroup(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CloudWatchLogGroup(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CloudWatchLogGroup(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CloudWatchLogGroup(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(IRule, String)
Returns a RuleTarget that can be used to log an event into a CloudWatch LogGroup.
public virtual IRuleTargetConfig Bind(IRule rule, string id = null)
Parameters
- rule IRule
- id System.String
Returns