CfnTopicProps Struct
Properties for defining a CfnTopic.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sns as sns } from 'aws-cdk-lib';
declare const archivePolicy: any;
declare const dataProtectionPolicy: any;
const cfnTopicProps: sns.CfnTopicProps = {
archivePolicy: archivePolicy,
contentBasedDeduplication: false,
dataProtectionPolicy: dataProtectionPolicy,
deliveryStatusLogging: [{
protocol: 'protocol',
// the properties below are optional
failureFeedbackRoleArn: 'failureFeedbackRoleArn',
successFeedbackRoleArn: 'successFeedbackRoleArn',
successFeedbackSampleRate: 'successFeedbackSampleRate',
}],
displayName: 'displayName',
fifoThroughputScope: 'fifoThroughputScope',
fifoTopic: false,
kmsMasterKeyId: 'kmsMasterKeyId',
maximumMessageSize: 123,
signatureVersion: 'signatureVersion',
subscription: [{
endpoint: 'endpoint',
protocol: 'protocol',
}],
tags: [{
key: 'key',
value: 'value',
}],
topicName: 'topicName',
tracingConfig: 'tracingConfig',
};
Properties
You can set a retention period ranging from 1 to 365 days. This property is only applicable to FIFO topics; attempting to use it with standard topics will result in a creation failure.
contentBasedDeduplicationboolean | IResolvablecontent_based_deduplicationtyping.Union[bool, IResolvable]contentBasedDeduplicationBooleanContentBasedDeduplicationboolContentBasedDeduplicationinterface{}#notes
By default, this property is set to false. If you create a FIFO topic with ContentBasedDeduplication set to false, you must provide a MessageDeduplicationId for each Publish action. When set to true, Amazon automatically generates a MessageDeduplicationId using a SHA-256 hash of the message body (excluding message attributes). You can optionally override this generated value by specifying a MessageDeduplicationId in the Publish action. Note that this property only applies to FIFO topics; using it with standard topics will cause the creation to fail.
dataProtectionPolicyanydata_protection_policyAnydataProtectionPolicyObjectDataProtectionPolicyobjectDataProtectionPolicyinterface{}#You can only add one policy per topic.
The policy must be in JSON string format.
Length Constraints: Maximum length of 30,720.
deliveryStatusLoggingIResolvable | IResolvable | CfnTopic.LoggingConfigProperty[]delivery_status_loggingtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LoggingConfigProperty]]]deliveryStatusLoggingIResolvableDeliveryStatusLoggingIResolvableDeliveryStatusLogginginterface{}#- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
fifoThroughputScopestringfifo_throughput_scopestrfifoThroughputScopeStringFifoThroughputScopestringFifoThroughputScope*string#Valid values are Topic or MessageGroup .
fifoTopicboolean | IResolvablefifo_topictyping.Union[bool, IResolvable]fifoTopicBooleanFifoTopicboolFifoTopicinterface{}#kmsMasterKeyIdstring | IAliasRef | IKeyRefkms_master_key_idtyping.Union[str, IAliasRef, IKeyRef]kmsMasterKeyIdStringKmsMasterKeyIdstringKmsMasterKeyIdinterface{}#notes
For more information, see Key terms . For more examples, see [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) in the AWS Key Management Service API Reference .
This property applies only to server-side-encryption .
maximumMessageSizenumbermaximum_message_sizeint | floatmaximumMessageSizeNumberMaximumMessageSizedoubleMaximumMessageSize*float64#signatureVersionstringsignature_versionstrsignatureVersionStringSignatureVersionstringSignatureVersion*string#By default, SignatureVersion is set to 1 .
subscriptionIResolvable | IResolvable | CfnTopic.SubscriptionProperty[]subscriptiontyping.Union[IResolvable, typing.List[typing.Union[IResolvable, SubscriptionProperty]]]subscriptionIResolvableSubscriptionIResolvableSubscriptioninterface{}#If you specify the
Subscriptionproperty in theAWS::SNS::Topicresource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topicresource is deleted.
To be able to tag a topic on creation, you must have the
sns:CreateTopicandsns:TagResourcepermissions.
notes
Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with .fifo .
If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the topic name. For more information, see Name type .
If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
notes
By default TracingConfig is set to PassThrough , and the topic passes through the tracing header it receives from an Amazon publisher to its subscriptions. If set to Active , Amazon will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.