CfnTopicProps Struct
Properties for defining a CfnTopic.
| Source | |
|---|---|
| Type last changed |
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',
};
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sns as sns
# archive_policy: Any
# data_protection_policy: Any
cfn_topic_props = sns.CfnTopicProps(
archive_policy=archive_policy,
content_based_deduplication=False,
data_protection_policy=data_protection_policy,
delivery_status_logging=[sns.CfnTopic.LoggingConfigProperty(
protocol="protocol",
# the properties below are optional
failure_feedback_role_arn="failureFeedbackRoleArn",
success_feedback_role_arn="successFeedbackRoleArn",
success_feedback_sample_rate="successFeedbackSampleRate"
)],
display_name="displayName",
fifo_throughput_scope="fifoThroughputScope",
fifo_topic=False,
kms_master_key_id="kmsMasterKeyId",
maximum_message_size=123,
signature_version="signatureVersion",
subscription=[sns.CfnTopic.SubscriptionProperty(
endpoint="endpoint",
protocol="protocol"
)],
tags=[CfnTag(
key="key",
value="value"
)],
topic_name="topicName",
tracing_config="tracingConfig"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sns.*;
Object archivePolicy;
Object dataProtectionPolicy;
CfnTopicProps cfnTopicProps = CfnTopicProps.builder()
.archivePolicy(archivePolicy)
.contentBasedDeduplication(false)
.dataProtectionPolicy(dataProtectionPolicy)
.deliveryStatusLogging(List.of(LoggingConfigProperty.builder()
.protocol("protocol")
// the properties below are optional
.failureFeedbackRoleArn("failureFeedbackRoleArn")
.successFeedbackRoleArn("successFeedbackRoleArn")
.successFeedbackSampleRate("successFeedbackSampleRate")
.build()))
.displayName("displayName")
.fifoThroughputScope("fifoThroughputScope")
.fifoTopic(false)
.kmsMasterKeyId("kmsMasterKeyId")
.maximumMessageSize(123)
.signatureVersion("signatureVersion")
.subscription(List.of(SubscriptionProperty.builder()
.endpoint("endpoint")
.protocol("protocol")
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.topicName("topicName")
.tracingConfig("tracingConfig")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SNS;
var archivePolicy;
var dataProtectionPolicy;
var cfnTopicProps = new CfnTopicProps {
ArchivePolicy = archivePolicy,
ContentBasedDeduplication = false,
DataProtectionPolicy = dataProtectionPolicy,
DeliveryStatusLogging = new [] { new LoggingConfigProperty {
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 = new [] { new SubscriptionProperty {
Endpoint = "endpoint",
Protocol = "protocol"
} },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
TopicName = "topicName",
TracingConfig = "tracingConfig"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var archivePolicy interface{}
var dataProtectionPolicy interface{}
cfnTopicProps := &CfnTopicProps{
ArchivePolicy: archivePolicy,
ContentBasedDeduplication: jsii.Boolean(false),
DataProtectionPolicy: dataProtectionPolicy,
DeliveryStatusLogging: []interface{}{
&LoggingConfigProperty{
Protocol: jsii.String("protocol"),
// the properties below are optional
FailureFeedbackRoleArn: jsii.String("failureFeedbackRoleArn"),
SuccessFeedbackRoleArn: jsii.String("successFeedbackRoleArn"),
SuccessFeedbackSampleRate: jsii.String("successFeedbackSampleRate"),
},
},
DisplayName: jsii.String("displayName"),
FifoThroughputScope: jsii.String("fifoThroughputScope"),
FifoTopic: jsii.Boolean(false),
KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
MaximumMessageSize: jsii.Number(123),
SignatureVersion: jsii.String("signatureVersion"),
Subscription: []interface{}{
&SubscriptionProperty{
Endpoint: jsii.String("endpoint"),
Protocol: jsii.String("protocol"),
},
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
TopicName: jsii.String("topicName"),
TracingConfig: jsii.String("tracingConfig"),
}
Properties
archivePolicyoptionalanyarchive_policyoptionalAnyarchivePolicyoptionalObjectArchivePolicyoptionalobjectArchivePolicyoptionalinterface{} #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.
contentBasedDeduplicationoptionalboolean | IResolvablecontent_based_deduplicationoptionaltyping.Union[bool, IResolvable]contentBasedDeduplicationoptionalBooleanContentBasedDeduplicationoptionalboolContentBasedDeduplicationoptionalinterface{} #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.
dataProtectionPolicyoptionalanydata_protection_policyoptionalAnydataProtectionPolicyoptionalObjectDataProtectionPolicyoptionalobjectDataProtectionPolicyoptionalinterface{} #You can only add one policy per topic.
The policy must be in JSON string format.
Length Constraints: Maximum length of 30,720.
deliveryStatusLoggingoptionalIResolvable | IResolvable | CfnTopic.LoggingConfigProperty[]delivery_status_loggingoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LoggingConfigProperty]]]deliveryStatusLoggingoptionalIResolvableDeliveryStatusLoggingoptionalIResolvableDeliveryStatusLoggingoptionalinterface{} #- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
displayNameoptionalstringdisplay_nameoptionalstrdisplayNameoptionalStringDisplayNameoptionalstringDisplayNameoptional*string #The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
fifoThroughputScopeoptionalstringfifo_throughput_scopeoptionalstrfifoThroughputScopeoptionalStringFifoThroughputScopeoptionalstringFifoThroughputScopeoptional*string #Valid values are Topic or MessageGroup .
fifoTopicoptionalboolean | IResolvablefifo_topicoptionaltyping.Union[bool, IResolvable]fifoTopicoptionalBooleanFifoTopicoptionalboolFifoTopicoptionalinterface{} #kmsMasterKeyIdoptionalstring | IAliasRef | IKeyRefkms_master_key_idoptionaltyping.Union[str, IAliasRef, IKeyRef]kmsMasterKeyIdoptionalStringKmsMasterKeyIdoptionalstringKmsMasterKeyIdoptionalinterface{} #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 .
maximumMessageSizeoptionalnumbermaximum_message_sizeoptionalint | floatmaximumMessageSizeoptionalNumberMaximumMessageSizeoptionaldoubleMaximumMessageSizeoptional*float64 #notes
Valid values are 1024 to 1048576 (1 MiB). When this property is not specified, the topic uses the default SNS message size of 262144 bytes (256 KiB). A topic with MaximumMessageSize above 262144 supports a maximum of 100 subscriptions, all of which must use the SQS, AWS Lambda, or Amazon Data Firehose protocols. For more information, see Publishing large messages with in the Developer Guide.
signatureVersionoptionalstringsignature_versionoptionalstrsignatureVersionoptionalStringSignatureVersionoptionalstringSignatureVersionoptional*string #By default, SignatureVersion is set to 1 .
subscriptionoptionalIResolvable | IResolvable | CfnTopic.SubscriptionProperty[]subscriptionoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, SubscriptionProperty]]]subscriptionoptionalIResolvableSubscriptionoptionalIResolvableSubscriptionoptionalinterface{} #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.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #To be able to tag a topic on creation, you must have the
sns:CreateTopicandsns:TagResourcepermissions.
topicNameoptionalstringtopic_nameoptionalstrtopicNameoptionalStringTopicNameoptionalstringTopicNameoptional*string #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.
tracingConfigoptionalstringtracing_configoptionalstrtracingConfigoptionalStringTracingConfigoptionalstringTracingConfigoptional*string #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.