Class Topic


  • public class Topic
    extends com.pulumi.resources.CustomResource
    Provides an SNS topic resource ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.sns.Topic;
     import com.pulumi.aws.sns.TopicArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var userUpdates = new Topic("userUpdates", TopicArgs.builder()
                 .name("user-updates-topic")
                 .build());
     
         }
     }
     
     
    ### Example with Delivery Policy
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.sns.Topic;
     import com.pulumi.aws.sns.TopicArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var userUpdates = new Topic("userUpdates", TopicArgs.builder()
                 .name("user-updates-topic")
                 .deliveryPolicy("""
     {
       \"http\": {
         \"defaultHealthyRetryPolicy\": {
           \"minDelayTarget\": 20,
           \"maxDelayTarget\": 20,
           \"numRetries\": 3,
           \"numMaxDelayRetries\": 0,
           \"numNoDelayRetries\": 0,
           \"numMinDelayRetries\": 0,
           \"backoffFunction\": \"linear\"
         },
         \"disableSubscriptionOverrides\": false,
         \"defaultThrottlePolicy\": {
           \"maxReceivesPerSecond\": 1
         }
       }
     }
                 """)
                 .build());
     
         }
     }
     
     
    ### Example with Server-side encryption (SSE)
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.sns.Topic;
     import com.pulumi.aws.sns.TopicArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var userUpdates = new Topic("userUpdates", TopicArgs.builder()
                 .name("user-updates-topic")
                 .kmsMasterKeyId("alias/aws/sns")
                 .build());
     
         }
     }
     
     
    ### Example with First-In-First-Out (FIFO)
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.sns.Topic;
     import com.pulumi.aws.sns.TopicArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var userUpdates = new Topic("userUpdates", TopicArgs.builder()
                 .name("user-updates-topic.fifo")
                 .fifoTopic(true)
                 .contentBasedDeduplication(true)
                 .build());
     
         }
     }
     
     
    ### Message Delivery Status Arguments The `<endpoint>_success_feedback_role_arn` and `<endpoint>_failure_feedback_role_arn` arguments are used to give Amazon SNS write access to use CloudWatch Logs on your behalf. The `<endpoint>_success_feedback_sample_rate` argument is for specifying the sample rate percentage (0-100) of successfully delivered messages. After you configure the `<endpoint>_failure_feedback_role_arn` argument, then all failed message deliveries generate CloudWatch Logs. ## Import ### Identity Schema #### Required - `arn` (String) ARN of the SNS topic. Using `pulumi import`, import SNS Topics using the topic `arn`. For example: ```sh $ pulumi import aws:sns/topic:Topic user_updates arn:aws:sns:us-west-2:123456789012:my-topic ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Topic​(java.lang.String name)  
      Topic​(java.lang.String name, TopicArgs args)  
      Topic​(java.lang.String name, TopicArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Constructor Detail

      • Topic

        public Topic​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Topic

        public Topic​(java.lang.String name,
                     @Nullable
                     TopicArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Topic

        public Topic​(java.lang.String name,
                     @Nullable
                     TopicArgs args,
                     @Nullable
                     com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • applicationFailureFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> applicationFailureFeedbackRoleArn()
        Returns:
        IAM role for failure feedback
      • applicationSuccessFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> applicationSuccessFeedbackRoleArn()
        Returns:
        The IAM role permitted to receive success feedback for this topic
      • applicationSuccessFeedbackSampleRate

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> applicationSuccessFeedbackSampleRate()
        Returns:
        Percentage of success to sample
      • archivePolicy

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> archivePolicy()
        Returns:
        The message archive policy for FIFO topics. More details in the [AWS documentation](https://docs.aws.amazon.com/sns/latest/dg/message-archiving-and-replay-topic-owner.html).
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The ARN of the SNS topic, as a more obvious property (clone of `id`)
      • beginningArchiveTime

        public com.pulumi.core.Output<java.lang.String> beginningArchiveTime()
        Returns:
        The oldest timestamp at which a FIFO topic subscriber can start a replay.
      • contentBasedDeduplication

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> contentBasedDeduplication()
        Returns:
        Enables content-based deduplication for FIFO topics. For more information, see the [related documentation](https://docs.aws.amazon.com/sns/latest/dg/fifo-message-dedup.html)
      • deliveryPolicy

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> deliveryPolicy()
        Returns:
        The SNS delivery policy. More details in the [AWS documentation](https://docs.aws.amazon.com/sns/latest/dg/DeliveryPolicies.html).
      • displayName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> displayName()
        Returns:
        The display name for the topic
      • fifoThroughputScope

        public com.pulumi.core.Output<java.lang.String> fifoThroughputScope()
        Returns:
        Enables higher throughput for FIFO topics by adjusting the scope of deduplication. This attribute has two possible values, `Topic` and `MessageGroup`. For more information, see the [related documentation](https://docs.aws.amazon.com/sns/latest/dg/fifo-high-throughput.html#enable-high-throughput-on-fifo-topic).
      • fifoTopic

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> fifoTopic()
        Returns:
        Boolean indicating whether or not to create a FIFO (first-in-first-out) topic. FIFO topics can't deliver messages to customer managed endpoints, such as email addresses, mobile apps, SMS, or HTTP(S) endpoints. These endpoint types aren't guaranteed to preserve strict message ordering. Default is `false`.
      • firehoseFailureFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> firehoseFailureFeedbackRoleArn()
        Returns:
        IAM role for failure feedback
      • firehoseSuccessFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> firehoseSuccessFeedbackRoleArn()
        Returns:
        The IAM role permitted to receive success feedback for this topic
      • firehoseSuccessFeedbackSampleRate

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> firehoseSuccessFeedbackSampleRate()
        Returns:
        Percentage of success to sample
      • httpFailureFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> httpFailureFeedbackRoleArn()
        Returns:
        IAM role for failure feedback
      • httpSuccessFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> httpSuccessFeedbackRoleArn()
        Returns:
        The IAM role permitted to receive success feedback for this topic
      • httpSuccessFeedbackSampleRate

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> httpSuccessFeedbackSampleRate()
        Returns:
        Percentage of success to sample
      • kmsMasterKeyId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsMasterKeyId()
        Returns:
        The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see [Key Terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms)
      • lambdaFailureFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> lambdaFailureFeedbackRoleArn()
        Returns:
        IAM role for failure feedback
      • lambdaSuccessFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> lambdaSuccessFeedbackRoleArn()
        Returns:
        The IAM role permitted to receive success feedback for this topic
      • lambdaSuccessFeedbackSampleRate

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> lambdaSuccessFeedbackSampleRate()
        Returns:
        Percentage of success to sample
      • maximumMessageSize

        public com.pulumi.core.Output<java.lang.Integer> maximumMessageSize()
        Returns:
        The maximum size, in bytes, of a message that can be published to the topic. Valid values are `1024` to `1048576` (1 MiB). The default is `262144` (256 KiB). A topic with a `maximumMessageSize` above 256 KiB must have 100 or fewer subscriptions, and each subscription must be an Amazon SQS, Amazon Data Firehose, or AWS Lambda subscription.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the topic. Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. For a FIFO (first-in-first-out) topic, the name must end with the `.fifo` suffix. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`
      • namePrefix

        public com.pulumi.core.Output<java.lang.String> namePrefix()
        Returns:
        Creates a unique name beginning with the specified prefix. Conflicts with `name`
      • owner

        public com.pulumi.core.Output<java.lang.String> owner()
        Returns:
        The AWS Account ID of the SNS topic owner
      • policy

        public com.pulumi.core.Output<java.lang.String> policy()
        Returns:
        The fully-formed AWS policy as JSON.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • signatureVersion

        public com.pulumi.core.Output<java.lang.Integer> signatureVersion()
        Returns:
        If `SignatureVersion` should be [1 (SHA1) or 2 (SHA256)](https://docs.aws.amazon.com/sns/latest/dg/sns-verify-signature-of-message.html). 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.
      • sqsFailureFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sqsFailureFeedbackRoleArn()
        Returns:
        IAM role for failure feedback
      • sqsSuccessFeedbackRoleArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sqsSuccessFeedbackRoleArn()
        Returns:
        The IAM role permitted to receive success feedback for this topic
      • sqsSuccessFeedbackSampleRate

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> sqsSuccessFeedbackSampleRate()
        Returns:
        Percentage of success to sample
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • tracingConfig

        public com.pulumi.core.Output<java.lang.String> tracingConfig()
        Returns:
        Tracing mode of an Amazon SNS topic. Valid values: `"PassThrough"`, `"Active"`.
      • get

        public static Topic get​(java.lang.String name,
                                com.pulumi.core.Output<java.lang.String> id,
                                @Nullable
                                TopicState state,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.