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.KinesisFirehose.Alpha;
DeliveryStream stream;
var topic = new Topic(this, "Topic");
new Subscription(this, "Subscription", new SubscriptionProps {
Topic = topic,
Endpoint = stream.DeliveryStreamArn,
Protocol = SubscriptionProtocol.FIREHOSE,
SubscriptionRoleArn = "SAMPLE_ARN"
});
Synopsis
Constructors
Topic(By |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Topic(Deputy |
Used by jsii to construct an instance of this class from DeputyProps |
Topic(Construct, String, ITopic |
Properties
Auto |
Controls automatic creation of policy objects. |
Content |
Enables content-based deduplication for FIFO topics. |
Fifo | Whether this topic is an Amazon SNS FIFO queue. |
Master |
A KMS Key, either managed by this CDK app, or imported. |
Topic |
The ARN of the topic. |
Topic |
The name of the topic. |
Methods
Add |
Adds a delivery status logging configuration to the topic. |
From |
Import an existing SNS topic provided an ARN. |
From |
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. By Ref Value 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. Deputy Base. Deputy Props The deputy props
Topic(Construct, String, ITopicProps)
public Topic(Construct scope, string id, ITopicProps props = null)
Parameters
- scope Constructs.
Construct - id System.
String - props ITopic
Props
Properties
AutoCreatePolicy
Controls automatic creation of policy objects.
protected override bool AutoCreatePolicy { get; }
Property Value
System.
Overrides
Remarks
Set by subclasses.
ContentBasedDeduplication
Enables content-based deduplication for FIFO topics.
public override bool ContentBasedDeduplication { get; }
Property Value
System.
Overrides
Fifo
Whether this topic is an Amazon SNS FIFO queue.
public override bool Fifo { get; }
Property Value
System.
Overrides
Remarks
If false, this is a standard topic.
MasterKey
A KMS Key, either managed by this CDK app, or imported.
public override IKey MasterKey { get; }
Property Value
Overrides
Remarks
This property applies only to server-side encryption.
TopicArn
The ARN of the topic.
public override string TopicArn { get; }
Property Value
System.
Overrides
TopicName
The name of the topic.
public override string TopicName { get; }
Property Value
System.
Overrides
Methods
AddLoggingConfig(ILoggingConfig)
Adds a delivery status logging configuration to the topic.
public virtual void AddLoggingConfig(ILoggingConfig config)
Parameters
- config ILogging
Config
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 ITopic
Attributes the attributes of the topic to import.
Returns