Class CfnSubscription
A CloudFormation AWS::SNS::Subscription
.
Inherited Members
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.AWS.SNS.dll
Syntax (csharp)
public class CfnSubscription : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnSubscription
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::SNS::Subscription
resource subscribes an endpoint to an Amazon SNS topic. For a subscription to be created, the owner of the endpoint must confirm the subscription.
CloudformationResource: AWS::SNS::Subscription
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html
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;
var deliveryPolicy;
var filterPolicy;
var redrivePolicy;
var cfnSubscription = new CfnSubscription(this, "MyCfnSubscription", new CfnSubscriptionProps {
Protocol = "protocol",
TopicArn = "topicArn",
// the properties below are optional
DeliveryPolicy = deliveryPolicy,
Endpoint = "endpoint",
FilterPolicy = filterPolicy,
FilterPolicyScope = "filterPolicyScope",
RawMessageDelivery = false,
RedrivePolicy = redrivePolicy,
Region = "region",
SubscriptionRoleArn = "subscriptionRoleArn"
});
Synopsis
Constructors
CfnSubscription(Construct, String, ICfnSubscriptionProps) | Create a new |
CfnSubscription(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnSubscription(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DeliveryPolicy | The delivery policy JSON assigned to the subscription. |
Endpoint | The subscription's endpoint. |
FilterPolicy | The filter policy JSON assigned to the subscription. |
FilterPolicyScope | This attribute lets you choose the filtering scope by using one of the following string value types:. |
Protocol | The subscription's protocol. |
RawMessageDelivery | When set to |
RedrivePolicy | When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. |
Region | For cross-region subscriptions, the region in which the topic resides. |
SubscriptionRoleArn | This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions. |
TopicArn | The ARN of the topic to subscribe to. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnSubscription(Construct, String, ICfnSubscriptionProps)
Create a new AWS::SNS::Subscription
.
public CfnSubscription(Construct scope, string id, ICfnSubscriptionProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnSubscriptionProps
- resource properties.
CfnSubscription(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnSubscription(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnSubscription(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnSubscription(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DeliveryPolicy
The delivery policy JSON assigned to the subscription.
public virtual object DeliveryPolicy { get; set; }
Property Value
System.Object
Remarks
Enables the subscriber to define the message delivery retry strategy in the case of an HTTP/S endpoint subscribed to the topic. For more information, see GetSubscriptionAttributes
in the Amazon SNS API Reference and Message delivery retries in the Amazon SNS Developer Guide .
Endpoint
The subscription's endpoint.
public virtual string Endpoint { get; set; }
Property Value
System.String
Remarks
The endpoint value depends on the protocol that you specify. For more information, see the Endpoint
parameter of the Subscribe
action in the Amazon SNS API Reference .
FilterPolicy
The filter policy JSON assigned to the subscription.
public virtual object FilterPolicy { get; set; }
Property Value
System.Object
Remarks
Enables the subscriber to filter out unwanted messages. For more information, see GetSubscriptionAttributes
in the Amazon SNS API Reference and Message filtering in the Amazon SNS Developer Guide .
FilterPolicyScope
This attribute lets you choose the filtering scope by using one of the following string value types:.
public virtual string FilterPolicyScope { get; set; }
Property Value
System.String
Remarks
Protocol
The subscription's protocol.
public virtual string Protocol { get; set; }
Property Value
System.String
Remarks
For more information, see the Protocol
parameter of the Subscribe
action in the Amazon SNS API Reference .
RawMessageDelivery
When set to true
, enables raw message delivery.
public virtual object RawMessageDelivery { get; set; }
Property Value
System.Object
Remarks
Raw messages don't contain any JSON formatting and can be sent to Amazon SQS and HTTP/S endpoints. For more information, see GetSubscriptionAttributes
in the Amazon SNS API Reference .
RedrivePolicy
When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.
public virtual object RedrivePolicy { get; set; }
Property Value
System.Object
Remarks
Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.
For more information about the redrive policy and dead-letter queues, see Amazon SQS dead-letter queues in the Amazon SQS Developer Guide .
Region
For cross-region subscriptions, the region in which the topic resides.
public virtual string Region { get; set; }
Property Value
System.String
Remarks
If no region is specified, AWS CloudFormation uses the region of the caller as the default.
If you perform an update operation that only updates the Region
property of a AWS::SNS::Subscription
resource, that operation will fail unless you are either:
SubscriptionRoleArn
This property applies only to Amazon Kinesis Data Firehose delivery stream subscriptions.
public virtual string SubscriptionRoleArn { get; set; }
Property Value
System.String
Remarks
Specify the ARN of the IAM role that has the following:
Specifying a valid ARN for this attribute is required for Kinesis Data Firehose delivery stream subscriptions. For more information, see Fanout to Amazon Kinesis Data Firehose delivery streams in the Amazon SNS Developer Guide.
TopicArn
The ARN of the topic to subscribe to.
public virtual string TopicArn { get; set; }
Property Value
System.String
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>