Class Topic
A new SNS topic.
Inherited Members
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Topic : TopicBase, ITopic, IResource, INotificationRuleTarget
Syntax (vb)
Public Class Topic
Inherits TopicBase
Implements ITopic, IResource, 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. |
ContentBasedDeduplication | Enables content-based deduplication for FIFO topics. |
Fifo | Whether this topic is an Amazon SNS FIFO queue. |
TopicArn | The ARN of the topic. |
TopicName | The name of the topic. |
Methods
AddLoggingConfig(ILoggingConfig) | Adds a delivery status logging configuration to the topic. |
FromTopicArn(Construct, String, String) | Import an existing SNS topic provided an ARN. |
FromTopicAttributes(Construct, String, ITopicAttributes) | Import an existing SNS topic provided a topic attributes. |
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.
ContentBasedDeduplication
Enables content-based deduplication for FIFO topics.
public override bool ContentBasedDeduplication { get; }
Property Value
System.Boolean
Overrides
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
AddLoggingConfig(ILoggingConfig)
Adds a delivery status logging configuration to the topic.
public virtual void AddLoggingConfig(ILoggingConfig config)
Parameters
- config ILoggingConfig
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
FromTopicAttributes(Construct, String, ITopicAttributes)
Import an existing SNS topic provided a topic attributes.
public static ITopic FromTopicAttributes(Construct scope, string id, ITopicAttributes attrs)
Parameters
- scope Constructs.Construct
The parent creating construct.
- id System.String
The construct's name.
- attrs ITopicAttributes
the attributes of the topic to import.
Returns