@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.235Z") @Stability(value=Stable) public class CfnTopic extends CfnResource implements IInspectable
The AWS::SNS::Topic resource creates a topic to which notifications can be published.
One account can create a maximum of 100,000 standard topics and 1,000 FIFO topics. For more information, see Amazon SNS endpoints and quotas in the AWS General Reference .
Example:
// 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 dataProtectionPolicy;
CfnTopic cfnTopic = CfnTopic.Builder.create(this, "MyCfnTopic")
.contentBasedDeduplication(false)
.dataProtectionPolicy(dataProtectionPolicy)
.displayName("displayName")
.fifoTopic(false)
.kmsMasterKeyId("kmsMasterKeyId")
.subscription(List.of(SubscriptionProperty.builder()
.endpoint("endpoint")
.protocol("protocol")
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.topicName("topicName")
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnTopic.Builder
A fluent builder for
CfnTopic. |
static interface |
CfnTopic.SubscriptionProperty
`Subscription` is an embedded property that describes the subscription endpoints of an Amazon SNS topic.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnTopic(software.constructs.Construct scope,
String id)
Create a new `AWS::SNS::Topic`.
|
|
CfnTopic(software.constructs.Construct scope,
String id,
CfnTopicProps props)
Create a new `AWS::SNS::Topic`.
|
protected |
CfnTopic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnTopic(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrTopicArn() |
String |
getAttrTopicName()
Returns the name of an Amazon SNS topic.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getContentBasedDeduplication()
Enables content-based deduplication for FIFO topics.
|
Object |
getDataProtectionPolicy()
`AWS::SNS::Topic.DataProtectionPolicy`.
|
String |
getDisplayName()
The display name to use for an Amazon SNS topic with SMS subscriptions.
|
Object |
getFifoTopic()
Set to true to create a FIFO topic.
|
String |
getKmsMasterKeyId()
The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK.
|
Object |
getSubscription()
The Amazon SNS subscriptions (endpoints) for this topic.
|
TagManager |
getTags()
The list of tags to add to a new topic.
|
String |
getTopicName()
The name of the topic you want to create.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setContentBasedDeduplication(Boolean value)
Enables content-based deduplication for FIFO topics.
|
void |
setContentBasedDeduplication(IResolvable value)
Enables content-based deduplication for FIFO topics.
|
void |
setDataProtectionPolicy(Object value)
`AWS::SNS::Topic.DataProtectionPolicy`.
|
void |
setDisplayName(String value)
The display name to use for an Amazon SNS topic with SMS subscriptions.
|
void |
setFifoTopic(Boolean value)
Set to true to create a FIFO topic.
|
void |
setFifoTopic(IResolvable value)
Set to true to create a FIFO topic.
|
void |
setKmsMasterKeyId(String value)
The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK.
|
void |
setSubscription(IResolvable value)
The Amazon SNS subscriptions (endpoints) for this topic.
|
void |
setSubscription(List<Object> value)
The Amazon SNS subscriptions (endpoints) for this topic.
|
void |
setTopicName(String value)
The name of the topic you want to create.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnTopic(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnTopic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnTopic(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
CfnTopicProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties.@Stability(value=Stable)
public CfnTopic(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrTopicArn()
@Stability(value=Stable) @NotNull public String getAttrTopicName()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
To be able to tag a topic on creation, you must have the
sns:CreateTopicandsns:TagResourcepermissions.
@Stability(value=Stable) @NotNull public Object getDataProtectionPolicy()
@Stability(value=Stable)
public void setDataProtectionPolicy(@NotNull
Object value)
@Stability(value=Stable) @Nullable public Object getContentBasedDeduplication()
ContentBasedDeduplication is set to false . If you create a FIFO topic and this attribute is false , you must specify a value for the MessageDeduplicationId parameter for the Publish action.ContentBasedDeduplication to true , Amazon SNS uses a SHA-256 hash to generate the MessageDeduplicationId using the body of the message (but not the attributes of the message).
(Optional) To override the generated value, you can specify a value for the the MessageDeduplicationId parameter for the Publish action.
@Stability(value=Stable)
public void setContentBasedDeduplication(@Nullable
Boolean value)
ContentBasedDeduplication is set to false . If you create a FIFO topic and this attribute is false , you must specify a value for the MessageDeduplicationId parameter for the Publish action.ContentBasedDeduplication to true , Amazon SNS uses a SHA-256 hash to generate the MessageDeduplicationId using the body of the message (but not the attributes of the message).
(Optional) To override the generated value, you can specify a value for the the MessageDeduplicationId parameter for the Publish action.
@Stability(value=Stable)
public void setContentBasedDeduplication(@Nullable
IResolvable value)
ContentBasedDeduplication is set to false . If you create a FIFO topic and this attribute is false , you must specify a value for the MessageDeduplicationId parameter for the Publish action.ContentBasedDeduplication to true , Amazon SNS uses a SHA-256 hash to generate the MessageDeduplicationId using the body of the message (but not the attributes of the message).
(Optional) To override the generated value, you can specify a value for the the MessageDeduplicationId parameter for the Publish action.
@Stability(value=Stable) @Nullable public String getDisplayName()
@Stability(value=Stable)
public void setDisplayName(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getFifoTopic()
@Stability(value=Stable)
public void setFifoTopic(@Nullable
Boolean value)
@Stability(value=Stable)
public void setFifoTopic(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getKmsMasterKeyId()
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 .
@Stability(value=Stable)
public void setKmsMasterKeyId(@Nullable
String value)
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 .
@Stability(value=Stable) @Nullable public Object getSubscription()
@Stability(value=Stable)
public void setSubscription(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setSubscription(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getTopicName()
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, AWS 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.
@Stability(value=Stable)
public void setTopicName(@Nullable
String value)
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, AWS 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.
Copyright © 2022. All rights reserved.