Class CfnTopic

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-22T22:42:58.557Z") @Stability(Stable) public class CfnTopic extends CfnResource implements IInspectable, ITaggable
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 archivePolicy;
 Object dataProtectionPolicy;
 CfnTopic cfnTopic = CfnTopic.Builder.create(this, "MyCfnTopic")
         .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")
         .fifoTopic(false)
         .kmsMasterKeyId("kmsMasterKeyId")
         .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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnTopic

      protected CfnTopic(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnTopic

      protected CfnTopic(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnTopic

      @Stability(Stable) public CfnTopic(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnTopicProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnTopic

      @Stability(Stable) public CfnTopic(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrTopicArn

      @Stability(Stable) @NotNull public String getAttrTopicArn()
      Returns the ARN of an Amazon SNS topic.
    • getAttrTopicName

      @Stability(Stable) @NotNull public String getAttrTopicName()
      Returns the name of an Amazon SNS topic.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getArchivePolicy

      @Stability(Stable) @Nullable public Object getArchivePolicy()
      The archive policy determines the number of days Amazon SNS retains messages.
    • setArchivePolicy

      @Stability(Stable) public void setArchivePolicy(@Nullable Object value)
      The archive policy determines the number of days Amazon SNS retains messages.
    • getContentBasedDeduplication

      @Stability(Stable) @Nullable public Object getContentBasedDeduplication()
      Enables content-based deduplication for FIFO topics.
    • setContentBasedDeduplication

      @Stability(Stable) public void setContentBasedDeduplication(@Nullable Boolean value)
      Enables content-based deduplication for FIFO topics.
    • setContentBasedDeduplication

      @Stability(Stable) public void setContentBasedDeduplication(@Nullable IResolvable value)
      Enables content-based deduplication for FIFO topics.
    • getDataProtectionPolicy

      @Stability(Stable) @Nullable public Object getDataProtectionPolicy()
      The body of the policy document you want to use for this topic.
    • setDataProtectionPolicy

      @Stability(Stable) public void setDataProtectionPolicy(@Nullable Object value)
      The body of the policy document you want to use for this topic.
    • getDeliveryStatusLogging

      @Stability(Stable) @Nullable public Object getDeliveryStatusLogging()
      The DeliveryStatusLogging configuration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.
    • setDeliveryStatusLogging

      @Stability(Stable) public void setDeliveryStatusLogging(@Nullable IResolvable value)
      The DeliveryStatusLogging configuration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.
    • setDeliveryStatusLogging

      @Stability(Stable) public void setDeliveryStatusLogging(@Nullable List<Object> value)
      The DeliveryStatusLogging configuration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.
    • getDisplayName

      @Stability(Stable) @Nullable public String getDisplayName()
      The display name to use for an Amazon SNS topic with SMS subscriptions.
    • setDisplayName

      @Stability(Stable) public void setDisplayName(@Nullable String value)
      The display name to use for an Amazon SNS topic with SMS subscriptions.
    • getFifoTopic

      @Stability(Stable) @Nullable public Object getFifoTopic()
      Set to true to create a FIFO topic.
    • setFifoTopic

      @Stability(Stable) public void setFifoTopic(@Nullable Boolean value)
      Set to true to create a FIFO topic.
    • setFifoTopic

      @Stability(Stable) public void setFifoTopic(@Nullable IResolvable value)
      Set to true to create a FIFO topic.
    • getKmsMasterKeyId

      @Stability(Stable) @Nullable public String getKmsMasterKeyId()
      The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK.
    • setKmsMasterKeyId

      @Stability(Stable) public void setKmsMasterKeyId(@Nullable String value)
      The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK.
    • getSignatureVersion

      @Stability(Stable) @Nullable public String getSignatureVersion()
      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.
    • setSignatureVersion

      @Stability(Stable) public void setSignatureVersion(@Nullable String value)
      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.
    • getSubscription

      @Stability(Stable) @Nullable public Object getSubscription()
      The Amazon SNS subscriptions (endpoints) for this topic.
    • setSubscription

      @Stability(Stable) public void setSubscription(@Nullable IResolvable value)
      The Amazon SNS subscriptions (endpoints) for this topic.
    • setSubscription

      @Stability(Stable) public void setSubscription(@Nullable List<Object> value)
      The Amazon SNS subscriptions (endpoints) for this topic.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The list of tags to add to a new topic.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The list of tags to add to a new topic.
    • getTopicName

      @Stability(Stable) @Nullable public String getTopicName()
      The name of the topic you want to create.
    • setTopicName

      @Stability(Stable) public void setTopicName(@Nullable String value)
      The name of the topic you want to create.
    • getTracingConfig

      @Stability(Stable) @Nullable public String getTracingConfig()
      Tracing mode of an Amazon SNS topic.
    • setTracingConfig

      @Stability(Stable) public void setTracingConfig(@Nullable String value)
      Tracing mode of an Amazon SNS topic.