Class TopicSubscriptionConfig
Subscription configuration.
Inheritance
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.AWS.SNS.dll
Syntax (csharp)
public class TopicSubscriptionConfig : Object, ITopicSubscriptionConfig, ISubscriptionOptions
Syntax (vb)
Public Class TopicSubscriptionConfig
Inherits Object
Implements ITopicSubscriptionConfig, ISubscriptionOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SNS;
using Amazon.CDK.AWS.SQS;
using Amazon.CDK;
Construct construct;
Queue queue;
SubscriptionFilter subscriptionFilter;
var topicSubscriptionConfig = new TopicSubscriptionConfig {
Endpoint = "endpoint",
Protocol = SubscriptionProtocol.HTTP,
SubscriberId = "subscriberId",
// the properties below are optional
DeadLetterQueue = queue,
FilterPolicy = new Dictionary<string, SubscriptionFilter> {
{ "filterPolicyKey", subscriptionFilter }
},
RawMessageDelivery = false,
Region = "region",
SubscriberScope = construct,
SubscriptionRoleArn = "subscriptionRoleArn"
};
Synopsis
Constructors
TopicSubscriptionConfig() |
Properties
DeadLetterQueue | Queue to be used as dead letter queue. |
Endpoint | The subscription endpoint. |
FilterPolicy | The filter policy. |
Protocol | What type of subscription to add. |
RawMessageDelivery | true if raw message delivery is enabled for the subscription. |
Region | The region where the topic resides, in the case of cross-region subscriptions. |
SubscriberId | The id of the SNS subscription resource created under |
SubscriberScope | The scope in which to create the SNS subscription resource. |
SubscriptionRoleArn | Arn of role allowing access to firehose delivery stream. |
Constructors
TopicSubscriptionConfig()
public TopicSubscriptionConfig()
Properties
DeadLetterQueue
Queue to be used as dead letter queue.
public IQueue DeadLetterQueue { get; set; }
Property Value
Remarks
If not passed no dead letter queue is enabled.
Default: - No dead letter queue enabled.
Endpoint
The subscription endpoint.
public string Endpoint { get; set; }
Property Value
System.String
Remarks
The meaning of this value depends on the value for 'protocol'.
FilterPolicy
The filter policy.
public IDictionary<string, SubscriptionFilter> FilterPolicy { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, SubscriptionFilter>
Remarks
Default: - all messages are delivered
Protocol
What type of subscription to add.
public SubscriptionProtocol Protocol { get; set; }
Property Value
RawMessageDelivery
true if raw message delivery is enabled for the subscription.
public Nullable<bool> RawMessageDelivery { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Raw messages are free of JSON formatting and can be sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple Notification Service API Reference.
Default: false
Region
The region where the topic resides, in the case of cross-region subscriptions.
public string Region { get; set; }
Property Value
System.String
Remarks
Default: - the region where the CloudFormation stack is being deployed.
SubscriberId
The id of the SNS subscription resource created under scope
.
public string SubscriberId { get; set; }
Property Value
System.String
Remarks
In most
cases, it is recommended to use the uniqueId
of the topic you are
subscribing to.
SubscriberScope
The scope in which to create the SNS subscription resource.
public Construct SubscriberScope { get; set; }
Property Value
Remarks
Normally you'd want the subscription to be created on the consuming stack because the topic is usually referenced by the consumer's resource policy (e.g. SQS queue policy). Otherwise, it will cause a cyclic reference.
If this is undefined, the subscription will be created on the topic's stack.
Default: - use the topic as the scope of the subscription, in which case subscriberId
must be defined.
SubscriptionRoleArn
Arn of role allowing access to firehose delivery stream.
public string SubscriptionRoleArn { get; set; }
Property Value
System.String
Remarks
Required for a firehose subscription protocol.
Default: - No subscription role is provided