We recommend new projects start with resources from the AWS provider.
aws-native.sns.Topic
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
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 endpoints and quotas in the General Reference.
The structure of AUTHPARAMS
depends on the .signature of the API request. For more information, see Examples of the complete Signature Version 4 signing process in the General Reference.
Example Usage
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var carSalesTopic = new AwsNative.Sns.Topic("carSalesTopic");
var erpIntegrationQueue = new AwsNative.Sqs.Queue("erpIntegrationQueue");
var erpSubscription = new AwsNative.Sns.Subscription("erpSubscription", new()
{
TopicArn = carSalesTopic.Id,
Endpoint = erpIntegrationQueue.Arn,
Protocol = "sqs",
RawMessageDelivery = true,
});
var crmIntegrationQueue = new AwsNative.Sqs.Queue("crmIntegrationQueue");
var crmSubscription = new AwsNative.Sns.Subscription("crmSubscription", new()
{
TopicArn = carSalesTopic.Id,
Endpoint = crmIntegrationQueue.Arn,
Protocol = "sqs",
RawMessageDelivery = true,
FilterPolicy = new Dictionary<string, object?>
{
["buyer-class"] = new[]
{
"vip",
},
},
});
var config = new Config();
var myHttpEndpoint = config.Require("myHttpEndpoint");
var scmSubscription = new AwsNative.Sns.Subscription("scmSubscription", new()
{
TopicArn = carSalesTopic.Id,
Endpoint = myHttpEndpoint,
Protocol = "https",
DeliveryPolicy = new Dictionary<string, object?>
{
["healthyRetryPolicy"] = new Dictionary<string, object?>
{
["numRetries"] = 20,
["minDelayTarget"] = 10,
["maxDelayTarget"] = 30,
["numMinDelayRetries"] = 3,
["numMaxDelayRetries"] = 17,
["numNoDelayRetries"] = 0,
["backoffFunction"] = "exponential",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/sns"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/sqs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
carSalesTopic, err := sns.NewTopic(ctx, "carSalesTopic", nil)
if err != nil {
return err
}
erpIntegrationQueue, err := sqs.NewQueue(ctx, "erpIntegrationQueue", nil)
if err != nil {
return err
}
_, err = sns.NewSubscription(ctx, "erpSubscription", &sns.SubscriptionArgs{
TopicArn: carSalesTopic.ID(),
Endpoint: erpIntegrationQueue.Arn,
Protocol: pulumi.String("sqs"),
RawMessageDelivery: pulumi.Bool(true),
})
if err != nil {
return err
}
crmIntegrationQueue, err := sqs.NewQueue(ctx, "crmIntegrationQueue", nil)
if err != nil {
return err
}
_, err = sns.NewSubscription(ctx, "crmSubscription", &sns.SubscriptionArgs{
TopicArn: carSalesTopic.ID(),
Endpoint: crmIntegrationQueue.Arn,
Protocol: pulumi.String("sqs"),
RawMessageDelivery: pulumi.Bool(true),
FilterPolicy: pulumi.Any(map[string]interface{}{
"buyer-class": []string{
"vip",
},
}),
})
if err != nil {
return err
}
cfg := config.New(ctx, "")
myHttpEndpoint := cfg.Require("myHttpEndpoint")
_, err = sns.NewSubscription(ctx, "scmSubscription", &sns.SubscriptionArgs{
TopicArn: carSalesTopic.ID(),
Endpoint: pulumi.String(myHttpEndpoint),
Protocol: pulumi.String("https"),
DeliveryPolicy: pulumi.Any(map[string]interface{}{
"healthyRetryPolicy": map[string]interface{}{
"numRetries": 20,
"minDelayTarget": 10,
"maxDelayTarget": 30,
"numMinDelayRetries": 3,
"numMaxDelayRetries": 17,
"numNoDelayRetries": 0,
"backoffFunction": "exponential",
},
}),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
car_sales_topic = aws_native.sns.Topic("carSalesTopic")
erp_integration_queue = aws_native.sqs.Queue("erpIntegrationQueue")
erp_subscription = aws_native.sns.Subscription("erpSubscription",
topic_arn=car_sales_topic.id,
endpoint=erp_integration_queue.arn,
protocol="sqs",
raw_message_delivery=True)
crm_integration_queue = aws_native.sqs.Queue("crmIntegrationQueue")
crm_subscription = aws_native.sns.Subscription("crmSubscription",
topic_arn=car_sales_topic.id,
endpoint=crm_integration_queue.arn,
protocol="sqs",
raw_message_delivery=True,
filter_policy={
"buyer-class": ["vip"],
})
config = pulumi.Config()
my_http_endpoint = config.require("myHttpEndpoint")
scm_subscription = aws_native.sns.Subscription("scmSubscription",
topic_arn=car_sales_topic.id,
endpoint=my_http_endpoint,
protocol="https",
delivery_policy={
"healthyRetryPolicy": {
"numRetries": 20,
"minDelayTarget": 10,
"maxDelayTarget": 30,
"numMinDelayRetries": 3,
"numMaxDelayRetries": 17,
"numNoDelayRetries": 0,
"backoffFunction": "exponential",
},
})
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const carSalesTopic = new aws_native.sns.Topic("carSalesTopic", {});
const erpIntegrationQueue = new aws_native.sqs.Queue("erpIntegrationQueue", {});
const erpSubscription = new aws_native.sns.Subscription("erpSubscription", {
topicArn: carSalesTopic.id,
endpoint: erpIntegrationQueue.arn,
protocol: "sqs",
rawMessageDelivery: true,
});
const crmIntegrationQueue = new aws_native.sqs.Queue("crmIntegrationQueue", {});
const crmSubscription = new aws_native.sns.Subscription("crmSubscription", {
topicArn: carSalesTopic.id,
endpoint: crmIntegrationQueue.arn,
protocol: "sqs",
rawMessageDelivery: true,
filterPolicy: {
"buyer-class": ["vip"],
},
});
const config = new pulumi.Config();
const myHttpEndpoint = config.require("myHttpEndpoint");
const scmSubscription = new aws_native.sns.Subscription("scmSubscription", {
topicArn: carSalesTopic.id,
endpoint: myHttpEndpoint,
protocol: "https",
deliveryPolicy: {
healthyRetryPolicy: {
numRetries: 20,
minDelayTarget: 10,
maxDelayTarget: 30,
numMinDelayRetries: 3,
numMaxDelayRetries: 17,
numNoDelayRetries: 0,
backoffFunction: "exponential",
},
},
});
Coming soon!
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var carSalesTopic = new AwsNative.Sns.Topic("carSalesTopic");
var erpIntegrationQueue = new AwsNative.Sqs.Queue("erpIntegrationQueue");
var erpSubscription = new AwsNative.Sns.Subscription("erpSubscription", new()
{
TopicArn = carSalesTopic.Id,
Endpoint = erpIntegrationQueue.Arn,
Protocol = "sqs",
RawMessageDelivery = true,
});
var crmIntegrationQueue = new AwsNative.Sqs.Queue("crmIntegrationQueue");
var crmSubscription = new AwsNative.Sns.Subscription("crmSubscription", new()
{
TopicArn = carSalesTopic.Id,
Endpoint = crmIntegrationQueue.Arn,
Protocol = "sqs",
RawMessageDelivery = true,
FilterPolicy = new Dictionary<string, object?>
{
["buyer-class"] = new[]
{
"vip",
},
},
});
var config = new Config();
var myHttpEndpoint = config.Require("myHttpEndpoint");
var scmSubscription = new AwsNative.Sns.Subscription("scmSubscription", new()
{
TopicArn = carSalesTopic.Id,
Endpoint = myHttpEndpoint,
Protocol = "https",
DeliveryPolicy = new Dictionary<string, object?>
{
["healthyRetryPolicy"] = new Dictionary<string, object?>
{
["numRetries"] = 20,
["minDelayTarget"] = 10,
["maxDelayTarget"] = 30,
["numMinDelayRetries"] = 3,
["numMaxDelayRetries"] = 17,
["numNoDelayRetries"] = 0,
["backoffFunction"] = "exponential",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/sns"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/sqs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
carSalesTopic, err := sns.NewTopic(ctx, "carSalesTopic", nil)
if err != nil {
return err
}
erpIntegrationQueue, err := sqs.NewQueue(ctx, "erpIntegrationQueue", nil)
if err != nil {
return err
}
_, err = sns.NewSubscription(ctx, "erpSubscription", &sns.SubscriptionArgs{
TopicArn: carSalesTopic.ID(),
Endpoint: erpIntegrationQueue.Arn,
Protocol: pulumi.String("sqs"),
RawMessageDelivery: pulumi.Bool(true),
})
if err != nil {
return err
}
crmIntegrationQueue, err := sqs.NewQueue(ctx, "crmIntegrationQueue", nil)
if err != nil {
return err
}
_, err = sns.NewSubscription(ctx, "crmSubscription", &sns.SubscriptionArgs{
TopicArn: carSalesTopic.ID(),
Endpoint: crmIntegrationQueue.Arn,
Protocol: pulumi.String("sqs"),
RawMessageDelivery: pulumi.Bool(true),
FilterPolicy: pulumi.Any(map[string]interface{}{
"buyer-class": []string{
"vip",
},
}),
})
if err != nil {
return err
}
cfg := config.New(ctx, "")
myHttpEndpoint := cfg.Require("myHttpEndpoint")
_, err = sns.NewSubscription(ctx, "scmSubscription", &sns.SubscriptionArgs{
TopicArn: carSalesTopic.ID(),
Endpoint: pulumi.String(myHttpEndpoint),
Protocol: pulumi.String("https"),
DeliveryPolicy: pulumi.Any(map[string]interface{}{
"healthyRetryPolicy": map[string]interface{}{
"numRetries": 20,
"minDelayTarget": 10,
"maxDelayTarget": 30,
"numMinDelayRetries": 3,
"numMaxDelayRetries": 17,
"numNoDelayRetries": 0,
"backoffFunction": "exponential",
},
}),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
car_sales_topic = aws_native.sns.Topic("carSalesTopic")
erp_integration_queue = aws_native.sqs.Queue("erpIntegrationQueue")
erp_subscription = aws_native.sns.Subscription("erpSubscription",
topic_arn=car_sales_topic.id,
endpoint=erp_integration_queue.arn,
protocol="sqs",
raw_message_delivery=True)
crm_integration_queue = aws_native.sqs.Queue("crmIntegrationQueue")
crm_subscription = aws_native.sns.Subscription("crmSubscription",
topic_arn=car_sales_topic.id,
endpoint=crm_integration_queue.arn,
protocol="sqs",
raw_message_delivery=True,
filter_policy={
"buyer-class": ["vip"],
})
config = pulumi.Config()
my_http_endpoint = config.require("myHttpEndpoint")
scm_subscription = aws_native.sns.Subscription("scmSubscription",
topic_arn=car_sales_topic.id,
endpoint=my_http_endpoint,
protocol="https",
delivery_policy={
"healthyRetryPolicy": {
"numRetries": 20,
"minDelayTarget": 10,
"maxDelayTarget": 30,
"numMinDelayRetries": 3,
"numMaxDelayRetries": 17,
"numNoDelayRetries": 0,
"backoffFunction": "exponential",
},
})
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const carSalesTopic = new aws_native.sns.Topic("carSalesTopic", {});
const erpIntegrationQueue = new aws_native.sqs.Queue("erpIntegrationQueue", {});
const erpSubscription = new aws_native.sns.Subscription("erpSubscription", {
topicArn: carSalesTopic.id,
endpoint: erpIntegrationQueue.arn,
protocol: "sqs",
rawMessageDelivery: true,
});
const crmIntegrationQueue = new aws_native.sqs.Queue("crmIntegrationQueue", {});
const crmSubscription = new aws_native.sns.Subscription("crmSubscription", {
topicArn: carSalesTopic.id,
endpoint: crmIntegrationQueue.arn,
protocol: "sqs",
rawMessageDelivery: true,
filterPolicy: {
"buyer-class": ["vip"],
},
});
const config = new pulumi.Config();
const myHttpEndpoint = config.require("myHttpEndpoint");
const scmSubscription = new aws_native.sns.Subscription("scmSubscription", {
topicArn: carSalesTopic.id,
endpoint: myHttpEndpoint,
protocol: "https",
deliveryPolicy: {
healthyRetryPolicy: {
numRetries: 20,
minDelayTarget: 10,
maxDelayTarget: 30,
numMinDelayRetries: 3,
numMaxDelayRetries: 17,
numNoDelayRetries: 0,
backoffFunction: "exponential",
},
},
});
Coming soon!
Create Topic Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Topic(name: string, args?: TopicArgs, opts?: CustomResourceOptions);
@overload
def Topic(resource_name: str,
args: Optional[TopicArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Topic(resource_name: str,
opts: Optional[ResourceOptions] = None,
archive_policy: Optional[Any] = None,
content_based_deduplication: Optional[bool] = None,
data_protection_policy: Optional[Any] = None,
delivery_status_logging: Optional[Sequence[TopicLoggingConfigArgs]] = None,
display_name: Optional[str] = None,
fifo_topic: Optional[bool] = None,
kms_master_key_id: Optional[str] = None,
signature_version: Optional[str] = None,
subscription: Optional[Sequence[TopicSubscriptionArgs]] = None,
tags: Optional[Sequence[_root_inputs.TagArgs]] = None,
topic_name: Optional[str] = None,
tracing_config: Optional[str] = None)
func NewTopic(ctx *Context, name string, args *TopicArgs, opts ...ResourceOption) (*Topic, error)
public Topic(string name, TopicArgs? args = null, CustomResourceOptions? opts = null)
type: aws-native:sns:Topic
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Topic Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Topic resource accepts the following input properties:
- Archive
Policy object The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Content
Based boolDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- Data
Protection objectPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Delivery
Status List<Pulumi.Logging Aws Native. Sns. Inputs. Topic Logging Config> 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:- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
- Display
Name string - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- Fifo
Topic bool - Set to true to create a FIFO topic.
- Kms
Master stringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - Signature
Version string - 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. By default,
SignatureVersion
is set to1
. - Subscription
List<Pulumi.
Aws Native. Sns. Inputs. Topic Subscription> - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - List<Pulumi.
Aws Native. Inputs. Tag> - The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - Topic
Name string - The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with
.fifo
. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the topic name. For more information, see Name type. If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. - Tracing
Config string - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- Archive
Policy interface{} The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Content
Based boolDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- Data
Protection interface{}Policy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Delivery
Status []TopicLogging Logging Config Args 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:- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
- Display
Name string - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- Fifo
Topic bool - Set to true to create a FIFO topic.
- Kms
Master stringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - Signature
Version string - 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. By default,
SignatureVersion
is set to1
. - Subscription
[]Topic
Subscription Args - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - Tag
Args - The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - Topic
Name string - The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with
.fifo
. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the topic name. For more information, see Name type. If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. - Tracing
Config string - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive
Policy Object The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content
Based BooleanDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data
Protection ObjectPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery
Status List<TopicLogging Logging Config> 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:- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
- display
Name String - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- fifo
Topic Boolean - Set to true to create a FIFO topic.
- kms
Master StringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature
Version String - 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. By default,
SignatureVersion
is set to1
. - subscription
List<Topic
Subscription> - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - List<Tag>
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic
Name String - The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with
.fifo
. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the topic name. For more information, see Name type. If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. - tracing
Config String - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive
Policy any The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content
Based booleanDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data
Protection anyPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery
Status TopicLogging Logging Config[] 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:- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
- display
Name string - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- fifo
Topic boolean - Set to true to create a FIFO topic.
- kms
Master stringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature
Version string - 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. By default,
SignatureVersion
is set to1
. - subscription
Topic
Subscription[] - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - Tag[]
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic
Name string - The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with
.fifo
. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the topic name. For more information, see Name type. If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. - tracing
Config string - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive_
policy Any The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content_
based_ booldeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data_
protection_ Anypolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery_
status_ Sequence[Topiclogging Logging Config Args] 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:- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
- display_
name str - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- fifo_
topic bool - Set to true to create a FIFO topic.
- kms_
master_ strkey_ id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature_
version str - 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. By default,
SignatureVersion
is set to1
. - subscription
Sequence[Topic
Subscription Args] - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - Sequence[Tag
Args] - The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic_
name str - The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with
.fifo
. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the topic name. For more information, see Name type. If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. - tracing_
config str - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive
Policy Any The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content
Based BooleanDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data
Protection AnyPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery
Status List<Property Map>Logging 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:- HTTP
- Amazon Kinesis Data Firehose
- AWS Lambda
- Platform application endpoint
- Amazon Simple Queue Service
Once configured, log entries are sent to Amazon CloudWatch Logs.
- display
Name String - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- fifo
Topic Boolean - Set to true to create a FIFO topic.
- kms
Master StringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature
Version String - 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. By default,
SignatureVersion
is set to1
. - subscription List<Property Map>
- The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - List<Property Map>
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic
Name String - The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with
.fifo
. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the topic name. For more information, see Name type. If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. - tracing
Config String - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
Outputs
All input properties are implicitly available as output properties. Additionally, the Topic resource produces the following output properties:
Supporting Types
Tag, TagArgs
TopicLoggingConfig, TopicLoggingConfigArgs
- Protocol
Pulumi.
Aws Native. Sns. Topic Logging Config Protocol - Indicates one of the supported protocols for the Amazon SNS topic.
At least one of the other three
LoggingConfig
properties is recommend along withProtocol
. - Failure
Feedback stringRole Arn - The IAM role ARN to be used when logging failed message deliveries in Amazon CloudWatch.
- Success
Feedback stringRole Arn - The IAM role ARN to be used when logging successful message deliveries in Amazon CloudWatch.
- Success
Feedback stringSample Rate - The percentage of successful message deliveries to be logged in Amazon CloudWatch. Valid percentage values range from 0 to 100.
- Protocol
Topic
Logging Config Protocol - Indicates one of the supported protocols for the Amazon SNS topic.
At least one of the other three
LoggingConfig
properties is recommend along withProtocol
. - Failure
Feedback stringRole Arn - The IAM role ARN to be used when logging failed message deliveries in Amazon CloudWatch.
- Success
Feedback stringRole Arn - The IAM role ARN to be used when logging successful message deliveries in Amazon CloudWatch.
- Success
Feedback stringSample Rate - The percentage of successful message deliveries to be logged in Amazon CloudWatch. Valid percentage values range from 0 to 100.
- protocol
Topic
Logging Config Protocol - Indicates one of the supported protocols for the Amazon SNS topic.
At least one of the other three
LoggingConfig
properties is recommend along withProtocol
. - failure
Feedback StringRole Arn - The IAM role ARN to be used when logging failed message deliveries in Amazon CloudWatch.
- success
Feedback StringRole Arn - The IAM role ARN to be used when logging successful message deliveries in Amazon CloudWatch.
- success
Feedback StringSample Rate - The percentage of successful message deliveries to be logged in Amazon CloudWatch. Valid percentage values range from 0 to 100.
- protocol
Topic
Logging Config Protocol - Indicates one of the supported protocols for the Amazon SNS topic.
At least one of the other three
LoggingConfig
properties is recommend along withProtocol
. - failure
Feedback stringRole Arn - The IAM role ARN to be used when logging failed message deliveries in Amazon CloudWatch.
- success
Feedback stringRole Arn - The IAM role ARN to be used when logging successful message deliveries in Amazon CloudWatch.
- success
Feedback stringSample Rate - The percentage of successful message deliveries to be logged in Amazon CloudWatch. Valid percentage values range from 0 to 100.
- protocol
Topic
Logging Config Protocol - Indicates one of the supported protocols for the Amazon SNS topic.
At least one of the other three
LoggingConfig
properties is recommend along withProtocol
. - failure_
feedback_ strrole_ arn - The IAM role ARN to be used when logging failed message deliveries in Amazon CloudWatch.
- success_
feedback_ strrole_ arn - The IAM role ARN to be used when logging successful message deliveries in Amazon CloudWatch.
- success_
feedback_ strsample_ rate - The percentage of successful message deliveries to be logged in Amazon CloudWatch. Valid percentage values range from 0 to 100.
- protocol "http/s" | "sqs" | "lambda" | "firehose" | "application"
- Indicates one of the supported protocols for the Amazon SNS topic.
At least one of the other three
LoggingConfig
properties is recommend along withProtocol
. - failure
Feedback StringRole Arn - The IAM role ARN to be used when logging failed message deliveries in Amazon CloudWatch.
- success
Feedback StringRole Arn - The IAM role ARN to be used when logging successful message deliveries in Amazon CloudWatch.
- success
Feedback StringSample Rate - The percentage of successful message deliveries to be logged in Amazon CloudWatch. Valid percentage values range from 0 to 100.
TopicLoggingConfigProtocol, TopicLoggingConfigProtocolArgs
- Https
- http/s
- Sqs
- sqs
- Lambda
- lambda
- Firehose
- firehose
- Application
- application
- Topic
Logging Config Protocol Https - http/s
- Topic
Logging Config Protocol Sqs - sqs
- Topic
Logging Config Protocol Lambda - lambda
- Topic
Logging Config Protocol Firehose - firehose
- Topic
Logging Config Protocol Application - application
- Https
- http/s
- Sqs
- sqs
- Lambda
- lambda
- Firehose
- firehose
- Application
- application
- Https
- http/s
- Sqs
- sqs
- Lambda
- lambda
- Firehose
- firehose
- Application
- application
- HTTPS
- http/s
- SQS
- sqs
- LAMBDA_
- lambda
- FIREHOSE
- firehose
- APPLICATION
- application
- "http/s"
- http/s
- "sqs"
- sqs
- "lambda"
- lambda
- "firehose"
- firehose
- "application"
- application
TopicSubscription, TopicSubscriptionArgs
- Endpoint string
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - Protocol string
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- Endpoint string
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - Protocol string
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint String
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol String
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint string
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol string
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint str
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol str
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint String
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol String
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.