Class TopicRule
(experimental) Defines an AWS IoT Rule in this stack.
Inherited Members
Namespace: Amazon.CDK.AWS.IoT.Alpha
Assembly: Amazon.CDK.AWS.IoT.Alpha.dll
Syntax (csharp)
public class TopicRule : Resource, ITopicRule, IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class TopicRule Inherits Resource Implements ITopicRule, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.SNS;
var topic = new Topic(this, "MyTopic");
var topicRule = new TopicRule(this, "TopicRule", new TopicRuleProps {
Sql = IotSql.FromStringAsVer20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
Actions = new [] {
new SnsTopicAction(topic, new SnsTopicActionProps {
MessageFormat = SnsActionMessageFormat.JSON
}) }
});
Synopsis
Constructors
| TopicRule(Construct, string, ITopicRuleProps) | (experimental) Defines an AWS IoT Rule in this stack. |
Properties
| PROPERTY_INJECTION_ID | (experimental) Uniquely identifies this class. |
| TopicRuleArn | (experimental) Arn of this topic rule. |
| TopicRuleName | (experimental) Name of this topic rule. |
Methods
| AddAction(IAction) | (experimental) Add a action to the topic rule. |
| FromTopicRuleArn(Construct, string, string) | (experimental) Import an existing AWS IoT Rule provided an ARN. |
Constructors
TopicRule(Construct, string, ITopicRuleProps)
(experimental) Defines an AWS IoT Rule in this stack.
public TopicRule(Construct scope, string id, ITopicRuleProps props)
Parameters
- scope Construct
- id string
- props ITopicRuleProps
Remarks
Stability: Experimental
Properties
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Stability: Experimental
TopicRuleArn
(experimental) Arn of this topic rule.
public virtual string TopicRuleArn { get; }
Property Value
Remarks
Stability: Experimental
Attribute: true
TopicRuleName
(experimental) Name of this topic rule.
public virtual string TopicRuleName { get; }
Property Value
Remarks
Stability: Experimental
Attribute: true
Methods
AddAction(IAction)
(experimental) Add a action to the topic rule.
public virtual void AddAction(IAction action)
Parameters
- action IAction
the action to associate with the topic rule.
Remarks
Stability: Experimental
FromTopicRuleArn(Construct, string, string)
(experimental) Import an existing AWS IoT Rule provided an ARN.
public static ITopicRule FromTopicRuleArn(Construct scope, string id, string topicRuleArn)
Parameters
- scope Construct
The parent creating construct (usually
this).- id string
The construct's name.
- topicRuleArn string
AWS IoT Rule ARN (i.e. arn:aws:iot:<region>:<account-id>:rule/MyRule).
Returns
Remarks
Stability: Experimental