TopicArgs

data class TopicArgs(val applicationFailureFeedbackRoleArn: Output<String>? = null, val applicationSuccessFeedbackRoleArn: Output<String>? = null, val applicationSuccessFeedbackSampleRate: Output<Int>? = null, val contentBasedDeduplication: Output<Boolean>? = null, val deliveryPolicy: Output<String>? = null, val displayName: Output<String>? = null, val fifoTopic: Output<Boolean>? = null, val firehoseFailureFeedbackRoleArn: Output<String>? = null, val firehoseSuccessFeedbackRoleArn: Output<String>? = null, val firehoseSuccessFeedbackSampleRate: Output<Int>? = null, val httpFailureFeedbackRoleArn: Output<String>? = null, val httpSuccessFeedbackRoleArn: Output<String>? = null, val httpSuccessFeedbackSampleRate: Output<Int>? = null, val kmsMasterKeyId: Output<String>? = null, val lambdaFailureFeedbackRoleArn: Output<String>? = null, val lambdaSuccessFeedbackRoleArn: Output<String>? = null, val lambdaSuccessFeedbackSampleRate: Output<Int>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val policy: Output<String>? = null, val signatureVersion: Output<Int>? = null, val sqsFailureFeedbackRoleArn: Output<String>? = null, val sqsSuccessFeedbackRoleArn: Output<String>? = null, val sqsSuccessFeedbackSampleRate: Output<Int>? = null, val tags: Output<Map<String, String>>? = null, val tracingConfig: Output<String>? = null) : ConvertibleToJava<TopicArgs>

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 java.util.List;
import java.util.ArrayList;
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");
}
}

Example with Delivery Policy

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const userUpdates = new aws.sns.Topic("userUpdates", {deliveryPolicy: `{
"http": {
"defaultHealthyRetryPolicy": {
"minDelayTarget": 20,
"maxDelayTarget": 20,
"numRetries": 3,
"numMaxDelayRetries": 0,
"numNoDelayRetries": 0,
"numMinDelayRetries": 0,
"backoffFunction": "linear"
},
"disableSubscriptionOverrides": false,
"defaultThrottlePolicy": {
"maxReceivesPerSecond": 1
}
}
}
`});
import pulumi
import pulumi_aws as aws
user_updates = aws.sns.Topic("userUpdates", delivery_policy="""{
"http": {
"defaultHealthyRetryPolicy": {
"minDelayTarget": 20,
"maxDelayTarget": 20,
"numRetries": 3,
"numMaxDelayRetries": 0,
"numNoDelayRetries": 0,
"numMinDelayRetries": 0,
"backoffFunction": "linear"
},
"disableSubscriptionOverrides": false,
"defaultThrottlePolicy": {
"maxReceivesPerSecond": 1
}
}
}
""")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var userUpdates = new Aws.Sns.Topic("userUpdates", new()
{
DeliveryPolicy = @"{
""http"": {
""defaultHealthyRetryPolicy"": {
""minDelayTarget"": 20,
""maxDelayTarget"": 20,
""numRetries"": 3,
""numMaxDelayRetries"": 0,
""numNoDelayRetries"": 0,
""numMinDelayRetries"": 0,
""backoffFunction"": ""linear""
},
""disableSubscriptionOverrides"": false,
""defaultThrottlePolicy"": {
""maxReceivesPerSecond"": 1
}
}
}
",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sns.NewTopic(ctx, "userUpdates", &sns.TopicArgs{
DeliveryPolicy: pulumi.String(`{
"http": {
"defaultHealthyRetryPolicy": {
"minDelayTarget": 20,
"maxDelayTarget": 20,
"numRetries": 3,
"numMaxDelayRetries": 0,
"numNoDelayRetries": 0,
"numMinDelayRetries": 0,
"backoffFunction": "linear"
},
"disableSubscriptionOverrides": false,
"defaultThrottlePolicy": {
"maxReceivesPerSecond": 1
}
}
}
`),
})
if err != nil {
return err
}
return nil
})
}
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.List;
import java.util.ArrayList;
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()
.deliveryPolicy("""
{
"http": {
"defaultHealthyRetryPolicy": {
"minDelayTarget": 20,
"maxDelayTarget": 20,
"numRetries": 3,
"numMaxDelayRetries": 0,
"numNoDelayRetries": 0,
"numMinDelayRetries": 0,
"backoffFunction": "linear"
},
"disableSubscriptionOverrides": false,
"defaultThrottlePolicy": {
"maxReceivesPerSecond": 1
}
}
}
""")
.build());
}
}
resources:
userUpdates:
type: aws:sns:Topic
properties:
deliveryPolicy: |+
{
"http": {
"defaultHealthyRetryPolicy": {
"minDelayTarget": 20,
"maxDelayTarget": 20,
"numRetries": 3,
"numMaxDelayRetries": 0,
"numNoDelayRetries": 0,
"numMinDelayRetries": 0,
"backoffFunction": "linear"
},
"disableSubscriptionOverrides": false,
"defaultThrottlePolicy": {
"maxReceivesPerSecond": 1
}
}
}

Example with Server-side encryption (SSE)

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const userUpdates = new aws.sns.Topic("userUpdates", {kmsMasterKeyId: "alias/aws/sns"});
import pulumi
import pulumi_aws as aws
user_updates = aws.sns.Topic("userUpdates", kms_master_key_id="alias/aws/sns")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var userUpdates = new Aws.Sns.Topic("userUpdates", new()
{
KmsMasterKeyId = "alias/aws/sns",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sns.NewTopic(ctx, "userUpdates", &sns.TopicArgs{
KmsMasterKeyId: pulumi.String("alias/aws/sns"),
})
if err != nil {
return err
}
return nil
})
}
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.List;
import java.util.ArrayList;
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()
.kmsMasterKeyId("alias/aws/sns")
.build());
}
}
resources:
userUpdates:
type: aws:sns:Topic
properties:
kmsMasterKeyId: alias/aws/sns

Example with First-In-First-Out (FIFO)

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const userUpdates = new aws.sns.Topic("userUpdates", {
contentBasedDeduplication: true,
fifoTopic: true,
});
import pulumi
import pulumi_aws as aws
user_updates = aws.sns.Topic("userUpdates",
content_based_deduplication=True,
fifo_topic=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var userUpdates = new Aws.Sns.Topic("userUpdates", new()
{
ContentBasedDeduplication = true,
FifoTopic = true,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sns.NewTopic(ctx, "userUpdates", &sns.TopicArgs{
ContentBasedDeduplication: pulumi.Bool(true),
FifoTopic: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
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.List;
import java.util.ArrayList;
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()
.contentBasedDeduplication(true)
.fifoTopic(true)
.build());
}
}
resources:
userUpdates:
type: aws:sns:Topic
properties:
contentBasedDeduplication: true
fifoTopic: true

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.,

$ pulumi import aws:sns/topic:Topic user_updates arn:aws:sns:us-west-2:0123456789012:my-topic

Constructors

Link copied to clipboard
constructor(applicationFailureFeedbackRoleArn: Output<String>? = null, applicationSuccessFeedbackRoleArn: Output<String>? = null, applicationSuccessFeedbackSampleRate: Output<Int>? = null, contentBasedDeduplication: Output<Boolean>? = null, deliveryPolicy: Output<String>? = null, displayName: Output<String>? = null, fifoTopic: Output<Boolean>? = null, firehoseFailureFeedbackRoleArn: Output<String>? = null, firehoseSuccessFeedbackRoleArn: Output<String>? = null, firehoseSuccessFeedbackSampleRate: Output<Int>? = null, httpFailureFeedbackRoleArn: Output<String>? = null, httpSuccessFeedbackRoleArn: Output<String>? = null, httpSuccessFeedbackSampleRate: Output<Int>? = null, kmsMasterKeyId: Output<String>? = null, lambdaFailureFeedbackRoleArn: Output<String>? = null, lambdaSuccessFeedbackRoleArn: Output<String>? = null, lambdaSuccessFeedbackSampleRate: Output<Int>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, policy: Output<String>? = null, signatureVersion: Output<Int>? = null, sqsFailureFeedbackRoleArn: Output<String>? = null, sqsSuccessFeedbackRoleArn: Output<String>? = null, sqsSuccessFeedbackSampleRate: Output<Int>? = null, tags: Output<Map<String, String>>? = null, tracingConfig: Output<String>? = null)

Properties

Link copied to clipboard

IAM role for failure feedback

Link copied to clipboard

The IAM role permitted to receive success feedback for this topic

Link copied to clipboard

Percentage of success to sample

Link copied to clipboard
val contentBasedDeduplication: Output<Boolean>? = null

Enables content-based deduplication for FIFO topics. For more information, see the related documentation

Link copied to clipboard
val deliveryPolicy: Output<String>? = null

The SNS delivery policy. More on AWS documentation

Link copied to clipboard
val displayName: Output<String>? = null

The display name for the topic

Link copied to clipboard
val fifoTopic: Output<Boolean>? = null

Boolean indicating whether or not to create a FIFO (first-in-first-out) topic (default is false).

Link copied to clipboard

IAM role for failure feedback

Link copied to clipboard

The IAM role permitted to receive success feedback for this topic

Link copied to clipboard

Percentage of success to sample

Link copied to clipboard
val httpFailureFeedbackRoleArn: Output<String>? = null

IAM role for failure feedback

Link copied to clipboard
val httpSuccessFeedbackRoleArn: Output<String>? = null

The IAM role permitted to receive success feedback for this topic

Link copied to clipboard
val httpSuccessFeedbackSampleRate: Output<Int>? = null

Percentage of success to sample

Link copied to clipboard
val kmsMasterKeyId: Output<String>? = null

The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see Key Terms

Link copied to clipboard

IAM role for failure feedback

Link copied to clipboard

The IAM role permitted to receive success feedback for this topic

Link copied to clipboard

Percentage of success to sample

Link copied to clipboard
val name: Output<String>? = null

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 name_prefix

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name

Link copied to clipboard
val policy: Output<String>? = null

The fully-formed AWS policy as JSON.

Link copied to clipboard
val signatureVersion: Output<Int>? = null

If SignatureVersion should be 1 (SHA1) or 2 (SHA256). 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.

Link copied to clipboard
val sqsFailureFeedbackRoleArn: Output<String>? = null

IAM role for failure feedback

Link copied to clipboard
val sqsSuccessFeedbackRoleArn: Output<String>? = null

The IAM role permitted to receive success feedback for this topic

Link copied to clipboard
val sqsSuccessFeedbackSampleRate: Output<Int>? = null

Percentage of success to sample

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tracingConfig: Output<String>? = null

Tracing mode of an Amazon SNS topic. Valid values: "PassThrough", "Active".

Functions

Link copied to clipboard
open override fun toJava(): TopicArgs