Class TopicSubscription
Provides a resource for subscribing to SNS topics. Requires that an SNS topic exist for the subscription to attach to. This resource allows you to automatically place messages sent to SNS topics in SQS queues, send them as HTTP(S) POST requests to a given endpoint, send SMS messages, or notify devices / applications. The most likely use case will probably be SQS queues.
NOTE: If the SNS topic and SQS queue are in different AWS regions, it is important for the "aws.sns.TopicSubscription" to use an AWS provider that is in the same region of the SNS topic. If the "aws.sns.TopicSubscription" is using a provider with a different region than the SNS topic, the subscription will fail to create.
NOTE: Setup of cross-account subscriptions from SNS topics to SQS queues requires the provider to have access to BOTH accounts.
NOTE: If SNS topic and SQS queue are in different AWS accounts but the same region it is important for the "aws.sns.TopicSubscription" to use the AWS provider of the account with the SQS queue. If "aws.sns.TopicSubscription" is using a Provider with a different account than the SQS queue, the provider creates the subscriptions but does not keep state and tries to re-create the subscription at every apply.
NOTE: If SNS topic and SQS queue are in different AWS accounts and different AWS regions it is important to recognize that the subscription needs to be initiated from the account with the SQS queue but in the region of the SNS topic.
Inherited Members
Namespace: Pulumi.Aws.Sns
Assembly: Pulumi.Aws.dll
Syntax
public class TopicSubscription : CustomResource
Constructors
View SourceTopicSubscription(String, TopicSubscriptionArgs, CustomResourceOptions)
Create a TopicSubscription resource with the given unique name, arguments, and options.
Declaration
public TopicSubscription(string name, TopicSubscriptionArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| TopicSubscriptionArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArn
The ARN of the subscription stored as a more user-friendly property
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ConfirmationTimeoutInMinutes
Integer indicating number of minutes to wait in retying mode for fetching subscription arn before marking it as failure. Only applicable for http and https protocols (default is 1 minute).
Declaration
public Output<int?> ConfirmationTimeoutInMinutes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
DeliveryPolicy
JSON String with the delivery policy (retries, backoff, etc.) that will be used in the subscription - this only applies to HTTP/S subscriptions. Refer to the SNS docs for more details.
Declaration
public Output<string> DeliveryPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Endpoint
The endpoint to send data to, the contents will vary with the protocol. (see below for more information)
Declaration
public Output<string> Endpoint { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EndpointAutoConfirms
Boolean indicating whether the end point is capable of auto confirming subscription e.g., PagerDuty (default is false)
Declaration
public Output<bool?> EndpointAutoConfirms { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
FilterPolicy
JSON String with the filter policy that will be used in the subscription to filter messages seen by the target resource. Refer to the SNS docs for more details.
Declaration
public Output<string> FilterPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Protocol
The protocol to use. The possible values for this are: sqs, sms, lambda, application. (http or https are partially supported, see below) (email is an option but is unsupported, see below).
Declaration
public Output<string> Protocol { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RawMessageDelivery
Boolean indicating whether or not to enable raw message delivery (the original message is directly passed, not wrapped in JSON with the original message in the message property) (default is false).
Declaration
public Output<bool?> RawMessageDelivery { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Topic
The ARN of the SNS topic to subscribe to
Declaration
public Output<string> Topic { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, TopicSubscriptionState, CustomResourceOptions)
Get an existing TopicSubscription resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static TopicSubscription Get(string name, Input<string> id, TopicSubscriptionState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| TopicSubscriptionState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| TopicSubscription |