Class Topic


  • public class Topic
    extends com.pulumi.resources.CustomResource
    Provides an SNS topic resource ## Example Usage ### Basic Example ```java package generated_program; import java.util.*; import java.io.*; import java.nio.*; import com.pulumi.*; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var userUpdates = new Topic("userUpdates"); } } ``` ### Example with Delivery Policy ```java package generated_program; import java.util.*; import java.io.*; import java.nio.*; import com.pulumi.*; 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() .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) ```java package generated_program; import java.util.*; import java.io.*; import java.nio.*; import com.pulumi.*; 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() .kmsMasterKeyId("alias/aws/sns") .build()); } } ``` ### Example with First-In-First-Out (FIFO) ```java package generated_program; import java.util.*; import java.io.*; import java.nio.*; import com.pulumi.*; 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() .contentBasedDeduplication(true) .fifoTopic(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 SNS Topics can be imported using the `topic arn`, e.g., ```sh $ pulumi import aws:sns/topic:Topic user_updates arn:aws:sns:us-west-2:0123456789012: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
      • 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)
      • 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 on [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
      • 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 (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
      • 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, this provider will assign a random, unique name. Conflicts with `name_prefix`
      • 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.
      • 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 .
      • 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.