Class TopicBase

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IResource, INotificationRuleTarget, ITopic, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct
Direct Known Subclasses:
Topic

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.198Z") @Stability(Stable) public abstract class TopicBase extends Resource implements ITopic
Either a new or imported Topic.
  • Constructor Details

    • TopicBase

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

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

      @Stability(Stable) protected TopicBase(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • TopicBase

      @Stability(Stable) protected TopicBase(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • addSubscription

      @Stability(Stable) public void addSubscription(@NotNull ITopicSubscription subscription)
      Subscribe some endpoint to this topic.

      Specified by:
      addSubscription in interface ITopic
      Parameters:
      subscription - This parameter is required.
    • addToResourcePolicy

      @Stability(Stable) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement)
      Adds a statement to the IAM resource policy associated with this topic.

      If this topic was created in this stack (new Topic), a topic policy will be automatically created upon the first call to addToPolicy. If the topic is imported (Topic.import), then this is a no-op.

      Specified by:
      addToResourcePolicy in interface ITopic
      Parameters:
      statement - This parameter is required.
    • bindAsNotificationRuleTarget

      @Stability(Stable) @NotNull public NotificationRuleTargetConfig bindAsNotificationRuleTarget(@NotNull software.constructs.Construct _scope)
      Represents a notification target That allows SNS topic to associate with this rule target.

      Specified by:
      bindAsNotificationRuleTarget in interface INotificationRuleTarget
      Parameters:
      _scope - This parameter is required.
    • grantPublish

      @Stability(Stable) @NotNull public Grant grantPublish(@NotNull IGrantable grantee)
      Grant topic publishing permissions to the given identity.

      Specified by:
      grantPublish in interface ITopic
      Parameters:
      grantee - This parameter is required.
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this Topic.

      Specified by:
      metric in interface ITopic
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this Topic.

      Specified by:
      metric in interface ITopic
      Parameters:
      metricName - This parameter is required.
    • metricNumberOfMessagesPublished

      @Stability(Stable) @NotNull public Metric metricNumberOfMessagesPublished(@Nullable MetricOptions props)
      The number of messages published to your Amazon SNS topics.

      Sum over 5 minutes

      Specified by:
      metricNumberOfMessagesPublished in interface ITopic
      Parameters:
      props -
    • metricNumberOfMessagesPublished

      @Stability(Stable) @NotNull public Metric metricNumberOfMessagesPublished()
      The number of messages published to your Amazon SNS topics.

      Sum over 5 minutes

      Specified by:
      metricNumberOfMessagesPublished in interface ITopic
    • metricNumberOfNotificationsDelivered

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsDelivered(@Nullable MetricOptions props)
      The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsDelivered in interface ITopic
      Parameters:
      props -
    • metricNumberOfNotificationsDelivered

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsDelivered()
      The number of messages successfully delivered from your Amazon SNS topics to subscribing endpoints.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsDelivered in interface ITopic
    • metricNumberOfNotificationsFailed

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFailed(@Nullable MetricOptions props)
      The number of messages that Amazon SNS failed to deliver.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFailed in interface ITopic
      Parameters:
      props -
    • metricNumberOfNotificationsFailed

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFailed()
      The number of messages that Amazon SNS failed to deliver.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFailed in interface ITopic
    • metricNumberOfNotificationsFilteredOut

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFilteredOut(@Nullable MetricOptions props)
      The number of messages that were rejected by subscription filter policies.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFilteredOut in interface ITopic
      Parameters:
      props -
    • metricNumberOfNotificationsFilteredOut

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFilteredOut()
      The number of messages that were rejected by subscription filter policies.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFilteredOut in interface ITopic
    • metricNumberOfNotificationsFilteredOutInvalidAttributes

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFilteredOutInvalidAttributes(@Nullable MetricOptions props)
      The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFilteredOutInvalidAttributes in interface ITopic
      Parameters:
      props -
    • metricNumberOfNotificationsFilteredOutInvalidAttributes

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFilteredOutInvalidAttributes()
      The number of messages that were rejected by subscription filter policies because the messages' attributes are invalid.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFilteredOutInvalidAttributes in interface ITopic
    • metricNumberOfNotificationsFilteredOutNoMessageAttributes

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFilteredOutNoMessageAttributes(@Nullable MetricOptions props)
      The number of messages that were rejected by subscription filter policies because the messages have no attributes.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFilteredOutNoMessageAttributes in interface ITopic
      Parameters:
      props -
    • metricNumberOfNotificationsFilteredOutNoMessageAttributes

      @Stability(Stable) @NotNull public Metric metricNumberOfNotificationsFilteredOutNoMessageAttributes()
      The number of messages that were rejected by subscription filter policies because the messages have no attributes.

      Sum over 5 minutes

      Specified by:
      metricNumberOfNotificationsFilteredOutNoMessageAttributes in interface ITopic
    • metricPublishSize

      @Stability(Stable) @NotNull public Metric metricPublishSize(@Nullable MetricOptions props)
      Metric for the size of messages published through this topic.

      Average over 5 minutes

      Specified by:
      metricPublishSize in interface ITopic
      Parameters:
      props -
    • metricPublishSize

      @Stability(Stable) @NotNull public Metric metricPublishSize()
      Metric for the size of messages published through this topic.

      Average over 5 minutes

      Specified by:
      metricPublishSize in interface ITopic
    • metricSMSMonthToDateSpentUSD

      @Stability(Stable) @NotNull public Metric metricSMSMonthToDateSpentUSD(@Nullable MetricOptions props)
      The charges you have accrued since the start of the current calendar month for sending SMS messages.

      Maximum over 5 minutes

      Specified by:
      metricSMSMonthToDateSpentUSD in interface ITopic
      Parameters:
      props -
    • metricSMSMonthToDateSpentUSD

      @Stability(Stable) @NotNull public Metric metricSMSMonthToDateSpentUSD()
      The charges you have accrued since the start of the current calendar month for sending SMS messages.

      Maximum over 5 minutes

      Specified by:
      metricSMSMonthToDateSpentUSD in interface ITopic
    • metricSMSSuccessRate

      @Stability(Stable) @NotNull public Metric metricSMSSuccessRate(@Nullable MetricOptions props)
      The rate of successful SMS message deliveries.

      Sum over 5 minutes

      Specified by:
      metricSMSSuccessRate in interface ITopic
      Parameters:
      props -
    • metricSMSSuccessRate

      @Stability(Stable) @NotNull public Metric metricSMSSuccessRate()
      The rate of successful SMS message deliveries.

      Sum over 5 minutes

      Specified by:
      metricSMSSuccessRate in interface ITopic
    • validate

      @Stability(Stable) @NotNull protected List<String> validate()
      Validate the current construct.

      This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

      Overrides:
      validate in class Construct
      Returns:
      An array of validation error messages, or an empty array if the construct is valid.
    • getAutoCreatePolicy

      @Stability(Stable) @NotNull protected abstract Boolean getAutoCreatePolicy()
      Controls automatic creation of policy objects.

      Set by subclasses.

    • getFifo

      @Stability(Stable) @NotNull public abstract Boolean getFifo()
      Whether this topic is an Amazon SNS FIFO queue.

      If false, this is a standard topic.

      Specified by:
      getFifo in interface ITopic
    • getTopicArn

      @Stability(Stable) @NotNull public abstract String getTopicArn()
      The ARN of the topic.
      Specified by:
      getTopicArn in interface ITopic
    • getTopicName

      @Stability(Stable) @NotNull public abstract String getTopicName()
      The name of the topic.
      Specified by:
      getTopicName in interface ITopic