Class Topic
A new SNS topic.
Inherited Members
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.AWS.SNS.dll
Syntax (csharp)
public class Topic : TopicBase, ITopic, IResource, IConstruct, IDependable, INotificationRuleTarget
Syntax (vb)
Public Class Topic
Inherits TopicBase
Implements ITopic, IResource, IConstruct, IDependable, INotificationRuleTarget
Remarks
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
Topic(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Topic(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Topic(Construct, String, ITopicProps) |
Properties
AutoCreatePolicy | Controls automatic creation of policy objects. |
Fifo | Whether this topic is an Amazon SNS FIFO queue. |
TopicArn | The ARN of the topic. |
TopicName | The name of the topic. |
Methods
FromTopicArn(Construct, String, String) | Import an existing SNS topic provided an ARN. |
Constructors
Topic(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Topic(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Topic(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Topic(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Topic(Construct, String, ITopicProps)
public Topic(Construct scope, string id, ITopicProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props ITopicProps
Properties
AutoCreatePolicy
Controls automatic creation of policy objects.
protected override bool AutoCreatePolicy { get; }
Property Value
System.Boolean
Overrides
Remarks
Set by subclasses.
Fifo
Whether this topic is an Amazon SNS FIFO queue.
public override bool Fifo { get; }
Property Value
System.Boolean
Overrides
Remarks
If false, this is a standard topic.
TopicArn
The ARN of the topic.
public override string TopicArn { get; }
Property Value
System.String
Overrides
TopicName
The name of the topic.
public override string TopicName { get; }
Property Value
System.String
Overrides
Methods
FromTopicArn(Construct, String, String)
Import an existing SNS topic provided an ARN.
public static ITopic FromTopicArn(Construct scope, string id, string topicArn)
Parameters
- scope Constructs.Construct
The parent creating construct.
- id System.String
The construct's name.
- topicArn System.String
topic ARN (i.e. arn:aws:sns:us-east-2:444455556666:MyTopic).
Returns