AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

Topic

A new SNS topic.

Import

import { Topic } from 'aws-cdk-lib/aws-sns';

Or use the module namespace:

import * as sns from 'aws-cdk-lib/aws-sns';
// sns.Topic

Properties

Configuration passed to the constructor as TopicProps.

contentBasedDeduplicationOptional
boolean

Enables content-based deduplication for FIFO topics.

Default: None

displayNameOptional
string

A developer-defined string that can be used to identify this SNS topic. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.

Default: None

enforceSSLOptional
boolean

Adds a statement to enforce encryption of data in transit when publishing to the topic.

Default: false

fifoOptional
boolean

Set to true to create a FIFO topic.

Default: None

fifoThroughputScopeOptional
FifoThroughputScope

Specifies the throughput quota and deduplication behavior to apply for the FIFO topic. You can only set this property when `fifo` is `true`.

Default: undefined - SNS default setting is FifoThroughputScope.TOPIC

loggingConfigsOptional
LoggingConfig[]

The list of delivery status logging configurations for the topic.

Default: None

masterKeyOptional
IKey

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

Default: None

messageRetentionPeriodInDaysOptional
number

The number of days Amazon SNS retains messages. It can only be set for FIFO topics.

Default: - do not archive messages

signatureVersionOptional
string

The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS.

Default: 1

topicNameOptional
string

A name for the topic. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the topic name. For more information, see Name Type.

Default: Generated name

tracingConfigOptional
TracingConfig

Tracing mode of an Amazon SNS topic.

Default: TracingConfig.PASS_THROUGH

Get the Amazon SNS Cheat Sheet

Everything you need to know about Amazon SNS on one page. HD quality, print-friendly.

Download Free Infographic