TopicProps

class aws_cdk.aws_sns.TopicProps(*, content_based_deduplication=None, display_name=None, enforce_ssl=None, fifo=None, logging_configs=None, master_key=None, message_retention_period_in_days=None, signature_version=None, topic_name=None)

Bases: object

Properties for a new SNS topic.

Parameters:
  • content_based_deduplication (Optional[bool]) – Enables content-based deduplication for FIFO topics. Default: None

  • display_name (Optional[str]) – A developer-defined string that can be used to identify this SNS topic. Default: None

  • enforce_ssl (Optional[bool]) – Adds a statement to enforce encryption of data in transit when publishing to the topic. Default: false

  • fifo (Optional[bool]) – Set to true to create a FIFO topic. Default: None

  • logging_configs (Optional[Sequence[Union[LoggingConfig, Dict[str, Any]]]]) – The list of delivery status logging configurations for the topic. Default: None

  • master_key (Optional[IKey]) – A KMS Key, either managed by this CDK app, or imported. Default: None

  • message_retention_period_in_days (Union[int, float, None]) – The number of days Amazon SNS retains messages. It can only be set for FIFO topics. Default: - do not archive messages

  • signature_version (Optional[str]) – 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

  • topic_name (Optional[str]) – 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

ExampleMetadata:

infused

Example:

topic = sns.Topic(self, "Topic",
    content_based_deduplication=True,
    display_name="Customer subscription topic",
    fifo=True
)

Attributes

content_based_deduplication

Enables content-based deduplication for FIFO topics.

Default:

None

display_name

A developer-defined string that can be used to identify this SNS topic.

Default:

None

enforce_ssl

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

Default:

false

See:

https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.

fifo

Set to true to create a FIFO topic.

Default:

None

logging_configs

The list of delivery status logging configurations for the topic.

Default:

None

See:

https://docs.aws.amazon.com/sns/latest/dg/sns-topic-attributes.html.

master_key

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

Default:

None

message_retention_period_in_days

The number of days Amazon SNS retains messages.

It can only be set for FIFO topics.

Default:
  • do not archive messages

See:

https://docs.aws.amazon.com/sns/latest/dg/fifo-message-archiving-replay.html

signature_version

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

See:

https://docs.aws.amazon.com/sns/latest/dg/sns-verify-signature-of-message.html.

topic_name

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