Show / Hide Table of Contents

Class Rule

Defines an EventBridge Rule in this stack.

Inheritance
System.Object
Construct
Resource
Rule
Implements
IRule
IResource
IConstruct
Constructs.IConstruct
IDependable
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Node
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.AWS.Events.dll
Syntax (csharp)
public class Rule : Resource, IRule, IResource, IConstruct, IConstruct, IDependable
Syntax (vb)
Public Class Rule
    Inherits Resource
    Implements IRule, IResource, IConstruct, IConstruct, IDependable
Remarks

Resource: AWS::Events::Rule

Synopsis

Constructors

Rule(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

Rule(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Rule(Construct, String, IRuleProps)

Properties

RuleArn

The value of the event rule Amazon Resource Name (ARN), such as arn:aws:events:us-east-2:123456789012:rule/example.

RuleName

The name event rule.

Methods

AddEventPattern(IEventPattern)

Adds an event pattern filter to this rule.

AddTarget(IRuleTarget)

Adds a target to the rule. The abstract class RuleTarget can be extended to define new targets.

FromEventRuleArn(Construct, String, String)

Import an existing EventBridge Rule provided an ARN.

Validate()

Validate the current construct.

Constructors

Rule(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected Rule(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

Rule(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected Rule(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Rule(Construct, String, IRuleProps)

public Rule(Construct scope, string id, IRuleProps props = null)
Parameters
scope Constructs.Construct
id System.String
props IRuleProps

Properties

RuleArn

The value of the event rule Amazon Resource Name (ARN), such as arn:aws:events:us-east-2:123456789012:rule/example.

public virtual string RuleArn { get; }
Property Value

System.String

RuleName

The name event rule.

public virtual string RuleName { get; }
Property Value

System.String

Methods

AddEventPattern(IEventPattern)

Adds an event pattern filter to this rule.

public virtual void AddEventPattern(IEventPattern eventPattern = null)
Parameters
eventPattern IEventPattern
Remarks

If a pattern was already specified, these values are merged into the existing pattern.

For example, if the rule already contains the pattern:

{
  "resources": [ "r1" ],
  "detail": {
    "hello": [ 1 ]
  }
}

And addEventPattern is called with the pattern:

{
  "resources": [ "r2" ],
  "detail": {
    "foo": [ "bar" ]
  }
}

The resulting event pattern will be:

{
  "resources": [ "r1", "r2" ],
  "detail": {
    "hello": [ 1 ],
    "foo": [ "bar" ]
  }
}

AddTarget(IRuleTarget)

Adds a target to the rule. The abstract class RuleTarget can be extended to define new targets.

public virtual void AddTarget(IRuleTarget target = null)
Parameters
target IRuleTarget
Remarks

No-op if target is undefined.

FromEventRuleArn(Construct, String, String)

Import an existing EventBridge Rule provided an ARN.

public static IRule FromEventRuleArn(Construct scope, string id, string eventRuleArn)
Parameters
scope Constructs.Construct

The parent creating construct (usually this).

id System.String

The construct's name.

eventRuleArn System.String

Event Rule ARN (i.e. arn:aws:events:<region>:<account-id>:rule/MyScheduledRule).

Returns

IRule

Validate()

Validate the current construct.

protected override string[] Validate()
Returns

System.String[]

Overrides
Construct.Validate()
Remarks

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

Implements

IRule
IResource
IConstruct
Constructs.IConstruct
IDependable
Back to top Generated by DocFX