Show / Hide Table of Contents

Class Topic

A new SNS topic.

Inheritance
object
Resource
TopicBase
Topic
Implements
ITopic
IResource
IConstruct
IDependable
INotificationRuleTarget
Inherited Members
TopicBase.AddSSLPolicy()
TopicBase.AddSubscription(ITopicSubscription)
TopicBase.AddToResourcePolicy(PolicyStatement)
TopicBase.BindAsNotificationRuleTarget(Construct)
TopicBase.CreateSSLPolicyDocument()
TopicBase.CreateTopicPolicy()
TopicBase.GrantPublish(IGrantable)
TopicBase.GrantSubscribe(IGrantable)
TopicBase.Metric(string, IMetricOptions)
TopicBase.MetricNumberOfMessagesPublished(IMetricOptions)
TopicBase.MetricNumberOfNotificationsDelivered(IMetricOptions)
TopicBase.MetricNumberOfNotificationsFailed(IMetricOptions)
TopicBase.MetricNumberOfNotificationsFilteredOut(IMetricOptions)
TopicBase.MetricNumberOfNotificationsFilteredOutInvalidAttributes(IMetricOptions)
TopicBase.MetricNumberOfNotificationsFilteredOutNoMessageAttributes(IMetricOptions)
TopicBase.MetricPublishSize(IMetricOptions)
TopicBase.MetricSMSMonthToDateSpentUSD(IMetricOptions)
TopicBase.MetricSMSSuccessRate(IMetricOptions)
TopicBase.EnforceSSL
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.Lib.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.KinesisFirehose;
            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(Construct, string, ITopicProps?)

A new SNS topic.

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.

MasterKey

A KMS Key, either managed by this CDK app, or imported.

PROPERTY_INJECTION_ID

Uniquely identifies this class.

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(Construct, string, ITopicProps?)

A new SNS topic.

public Topic(Construct scope, string id, ITopicProps? props = null)
Parameters
scope Construct
id string
props ITopicProps
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.KinesisFirehose;
            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"
            });

Properties

AutoCreatePolicy

Controls automatic creation of policy objects.

protected override bool AutoCreatePolicy { get; }
Property Value

bool

Overrides
TopicBase.AutoCreatePolicy
Remarks

Set by subclasses.

ContentBasedDeduplication

Enables content-based deduplication for FIFO topics.

public override bool ContentBasedDeduplication { get; }
Property Value

bool

Overrides
TopicBase.ContentBasedDeduplication
Remarks

ExampleMetadata: infused

Fifo

Whether this topic is an Amazon SNS FIFO queue.

public override bool Fifo { get; }
Property Value

bool

Overrides
TopicBase.Fifo
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

IKey

Overrides
TopicBase.MasterKey
Remarks

This property applies only to server-side encryption.

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

ExampleMetadata: infused

TopicArn

The ARN of the topic.

public override string TopicArn { get; }
Property Value

string

Overrides
TopicBase.TopicArn
Remarks

ExampleMetadata: infused

TopicName

The name of the topic.

public override string TopicName { get; }
Property Value

string

Overrides
TopicBase.TopicName
Remarks

ExampleMetadata: infused

Methods

AddLoggingConfig(ILoggingConfig)

Adds a delivery status logging configuration to the topic.

public virtual void AddLoggingConfig(ILoggingConfig config)
Parameters
config ILoggingConfig
Remarks

ExampleMetadata: infused

FromTopicArn(Construct, string, string)

Import an existing SNS topic provided an ARN.

public static ITopic FromTopicArn(Construct scope, string id, string topicArn)
Parameters
scope Construct

The parent creating construct.

id string

The construct's name.

topicArn string

topic ARN (i.e. arn:aws:sns:us-east-2:444455556666:MyTopic).

Returns

ITopic

Remarks

ExampleMetadata: infused

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 Construct

The parent creating construct.

id string

The construct's name.

attrs ITopicAttributes

the attributes of the topic to import.

Returns

ITopic

Remarks

ExampleMetadata: infused

Implements

ITopic
IResource
Constructs.IConstruct
Constructs.IDependable
INotificationRuleTarget
Back to top Generated by DocFX