Class: AWSCDK::SNS::SubscriptionProps
- Inherits:
-
SubscriptionOptions
- Object
- SubscriptionOptions
- AWSCDK::SNS::SubscriptionProps
- Defined in:
- sns/subscription_props.rb
Overview
Properties for creating a new subscription.
Instance Attribute Summary collapse
-
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue?
readonly
Queue to be used as dead letter queue.
-
#delivery_policy ⇒ AWSCDK::SNS::DeliveryPolicy?
readonly
The delivery policy.
-
#endpoint ⇒ String
readonly
The subscription endpoint.
-
#filter_policy ⇒ Hash{String => AWSCDK::SNS::SubscriptionFilter}?
readonly
The filter policy.
-
#filter_policy_with_message_body ⇒ Hash{String => AWSCDK::SNS::FilterOrPolicy}?
readonly
The filter policy that is applied on the message body.
-
#protocol ⇒ AWSCDK::SNS::SubscriptionProtocol
readonly
What type of subscription to add.
-
#raw_message_delivery ⇒ Boolean?
readonly
true if raw message delivery is enabled for the subscription.
-
#region ⇒ String?
readonly
The region where the topic resides, in the case of cross-region subscriptions.
-
#subscription_role_arn ⇒ String?
readonly
Arn of role allowing access to firehose delivery stream.
-
#topic ⇒ AWSCDK::SNS::ITopic
readonly
The topic to subscribe to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(endpoint:, protocol:, dead_letter_queue: nil, delivery_policy: nil, filter_policy: nil, filter_policy_with_message_body: nil, raw_message_delivery: nil, region: nil, subscription_role_arn: nil, topic:) ⇒ SubscriptionProps
constructor
A new instance of SubscriptionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(endpoint:, protocol:, dead_letter_queue: nil, delivery_policy: nil, filter_policy: nil, filter_policy_with_message_body: nil, raw_message_delivery: nil, region: nil, subscription_role_arn: nil, topic:) ⇒ SubscriptionProps
Returns a new instance of SubscriptionProps.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'sns/subscription_props.rb', line 17 def initialize(endpoint:, protocol:, dead_letter_queue: nil, delivery_policy: nil, filter_policy: nil, filter_policy_with_message_body: nil, raw_message_delivery: nil, region: nil, subscription_role_arn: nil, topic:) @endpoint = endpoint Jsii::Type.check_type(@endpoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endpoint") @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLlN1YnNjcmlwdGlvblByb3RvY29sIn0=")), "protocol") @dead_letter_queue = dead_letter_queue Jsii::Type.check_type(@dead_letter_queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLklRdWV1ZSJ9")), "deadLetterQueue") unless @dead_letter_queue.nil? @delivery_policy = delivery_policy.is_a?(Hash) ? ::AWSCDK::SNS::DeliveryPolicy.new(**delivery_policy.transform_keys(&:to_sym)) : delivery_policy Jsii::Type.check_type(@delivery_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLkRlbGl2ZXJ5UG9saWN5In0=")), "deliveryPolicy") unless @delivery_policy.nil? @filter_policy = filter_policy Jsii::Type.check_type(@filter_policy, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zbnMuU3Vic2NyaXB0aW9uRmlsdGVyIn0sImtpbmQiOiJtYXAifX0=")), "filterPolicy") unless @filter_policy.nil? @filter_policy_with_message_body = Jsii::Type.check_type(@filter_policy_with_message_body, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zbnMuRmlsdGVyT3JQb2xpY3kifSwia2luZCI6Im1hcCJ9fQ==")), "filterPolicyWithMessageBody") unless @filter_policy_with_message_body.nil? @raw_message_delivery = Jsii::Type.check_type(@raw_message_delivery, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "rawMessageDelivery") unless @raw_message_delivery.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @subscription_role_arn = subscription_role_arn Jsii::Type.check_type(@subscription_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subscriptionRoleArn") unless @subscription_role_arn.nil? @topic = topic Jsii::Type.check_type(@topic, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLklUb3BpYyJ9")), "topic") end |
Instance Attribute Details
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue? (readonly)
Default: - No dead letter queue enabled.
Queue to be used as dead letter queue.
If not passed no dead letter queue is enabled.
56 57 58 |
# File 'sns/subscription_props.rb', line 56 def dead_letter_queue @dead_letter_queue end |
#delivery_policy ⇒ AWSCDK::SNS::DeliveryPolicy? (readonly)
Default: - if the initial delivery of the message fails, three retries with a delay between failed attempts set at 20 seconds
The delivery policy.
61 62 63 |
# File 'sns/subscription_props.rb', line 61 def delivery_policy @delivery_policy end |
#endpoint ⇒ String (readonly)
The subscription endpoint.
The meaning of this value depends on the value for 'protocol'.
45 46 47 |
# File 'sns/subscription_props.rb', line 45 def endpoint @endpoint end |
#filter_policy ⇒ Hash{String => AWSCDK::SNS::SubscriptionFilter}? (readonly)
Default: - all messages are delivered
The filter policy.
66 67 68 |
# File 'sns/subscription_props.rb', line 66 def filter_policy @filter_policy end |
#filter_policy_with_message_body ⇒ Hash{String => AWSCDK::SNS::FilterOrPolicy}? (readonly)
Default: - all messages are delivered
The filter policy that is applied on the message body.
To apply a filter policy to the message attributes, use filter_policy. A maximum of one of filter_policy_with_message_body and filter_policy may be used.
73 74 75 |
# File 'sns/subscription_props.rb', line 73 def @filter_policy_with_message_body end |
#protocol ⇒ AWSCDK::SNS::SubscriptionProtocol (readonly)
What type of subscription to add.
49 50 51 |
# File 'sns/subscription_props.rb', line 49 def protocol @protocol end |
#raw_message_delivery ⇒ Boolean? (readonly)
Default: false
true if raw message delivery is enabled for the subscription.
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.
82 83 84 |
# File 'sns/subscription_props.rb', line 82 def @raw_message_delivery end |
#region ⇒ String? (readonly)
Default: - the region where the CloudFormation stack is being deployed.
The region where the topic resides, in the case of cross-region subscriptions.
87 88 89 |
# File 'sns/subscription_props.rb', line 87 def region @region end |
#subscription_role_arn ⇒ String? (readonly)
Default: - No subscription role is provided
Arn of role allowing access to firehose delivery stream.
Required for a firehose subscription protocol.
94 95 96 |
# File 'sns/subscription_props.rb', line 94 def subscription_role_arn @subscription_role_arn end |
#topic ⇒ AWSCDK::SNS::ITopic (readonly)
The topic to subscribe to.
98 99 100 |
# File 'sns/subscription_props.rb', line 98 def topic @topic end |
Class Method Details
.jsii_properties ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'sns/subscription_props.rb', line 100 def self.jsii_properties { :endpoint => "endpoint", :protocol => "protocol", :dead_letter_queue => "deadLetterQueue", :delivery_policy => "deliveryPolicy", :filter_policy => "filterPolicy", :filter_policy_with_message_body => "filterPolicyWithMessageBody", :raw_message_delivery => "rawMessageDelivery", :region => "region", :subscription_role_arn => "subscriptionRoleArn", :topic => "topic", } end |
Instance Method Details
#to_jsii ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'sns/subscription_props.rb', line 115 def to_jsii result = {} result.merge!(super) result.merge!({ "endpoint" => @endpoint, "protocol" => @protocol, "deadLetterQueue" => @dead_letter_queue, "deliveryPolicy" => @delivery_policy, "filterPolicy" => @filter_policy, "filterPolicyWithMessageBody" => @filter_policy_with_message_body, "rawMessageDelivery" => @raw_message_delivery, "region" => @region, "subscriptionRoleArn" => @subscription_role_arn, "topic" => @topic, }) result.compact end |