Class: AWSCDK::EventsTargets::SNSTopicProps
- Inherits:
-
TargetBaseProps
- Object
- TargetBaseProps
- AWSCDK::EventsTargets::SNSTopicProps
- Defined in:
- events_targets/sns_topic_props.rb
Overview
Customize the SNS Topic Event Target.
Instance Attribute Summary collapse
-
#authorize_using_role ⇒ Boolean?
readonly
Specifies whether an IAM role should be used to publish to the topic.
-
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue?
readonly
The SQS queue to be used as deadLetterQueue.
-
#max_event_age ⇒ AWSCDK::Duration?
readonly
The maximum age of a request that Lambda sends to a function for processing.
-
#message ⇒ AWSCDK::Events::RuleTargetInput?
readonly
The message to send to the topic.
-
#retry_attempts ⇒ Numeric?
readonly
The maximum number of times to retry when the function returns an error.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM role to be used to publish to the topic.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, authorize_using_role: nil, message: nil, role: nil) ⇒ SNSTopicProps
constructor
A new instance of SNSTopicProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, authorize_using_role: nil, message: nil, role: nil) ⇒ SNSTopicProps
Returns a new instance of SNSTopicProps.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'events_targets/sns_topic_props.rb', line 13 def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, authorize_using_role: nil, message: nil, role: nil) @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? @max_event_age = max_event_age Jsii::Type.check_type(@max_event_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxEventAge") unless @max_event_age.nil? @retry_attempts = retry_attempts Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil? @authorize_using_role = Jsii::Type.check_type(@authorize_using_role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "authorizeUsingRole") unless @authorize_using_role.nil? @message = Jsii::Type.check_type(@message, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVUYXJnZXRJbnB1dCJ9")), "message") unless @message.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? end |
Instance Attribute Details
#authorize_using_role ⇒ Boolean? (readonly)
Default: - true if role is provided, false otherwise
Specifies whether an IAM role should be used to publish to the topic.
57 58 59 |
# File 'events_targets/sns_topic_props.rb', line 57 def @authorize_using_role end |
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue? (readonly)
Default: - no dead-letter queue
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.
The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
36 37 38 |
# File 'events_targets/sns_topic_props.rb', line 36 def dead_letter_queue @dead_letter_queue end |
#max_event_age ⇒ AWSCDK::Duration? (readonly)
Default: Duration.hours(24)
The maximum age of a request that Lambda sends to a function for processing.
Minimum value of 60. Maximum value of 86400.
44 45 46 |
# File 'events_targets/sns_topic_props.rb', line 44 def max_event_age @max_event_age end |
#message ⇒ AWSCDK::Events::RuleTargetInput? (readonly)
Default: the entire EventBridge event
The message to send to the topic.
62 63 64 |
# File 'events_targets/sns_topic_props.rb', line 62 def @message end |
#retry_attempts ⇒ Numeric? (readonly)
Default: 185
The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.
52 53 54 |
# File 'events_targets/sns_topic_props.rb', line 52 def retry_attempts @retry_attempts end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - a new role will be created if authorizeUsingRole is true
The IAM role to be used to publish to the topic.
67 68 69 |
# File 'events_targets/sns_topic_props.rb', line 67 def role @role end |
Class Method Details
.jsii_properties ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# File 'events_targets/sns_topic_props.rb', line 69 def self.jsii_properties { :dead_letter_queue => "deadLetterQueue", :max_event_age => "maxEventAge", :retry_attempts => "retryAttempts", :authorize_using_role => "authorizeUsingRole", :message => "message", :role => "role", } end |
Instance Method Details
#to_jsii ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'events_targets/sns_topic_props.rb', line 80 def to_jsii result = {} result.merge!(super) result.merge!({ "deadLetterQueue" => @dead_letter_queue, "maxEventAge" => @max_event_age, "retryAttempts" => @retry_attempts, "authorizeUsingRole" => @authorize_using_role, "message" => @message, "role" => @role, }) result.compact end |