Class: AWSCDK::EventsTargets::SNSTopic
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::EventsTargets::SNSTopic
- Includes:
- AWSCDK::Events::IRuleTarget
- Defined in:
- events_targets/sns_topic.rb
Overview
Use an SNS topic as a target for Amazon EventBridge rules.
If the topic is imported the required permissions to publish to that topic need to be set manually.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(rule, _id = nil) ⇒ AWSCDK::Events::RuleTargetConfig
Returns a RuleTarget that can be used to trigger this SNS topic as a result from an EventBridge event.
-
#initialize(topic, props = nil) ⇒ SNSTopic
constructor
A new instance of SNSTopic.
- #topic ⇒ AWSCDK::SNS::ITopic
Constructor Details
#initialize(topic, props = nil) ⇒ SNSTopic
Returns a new instance of SNSTopic.
18 19 20 21 22 23 |
# File 'events_targets/sns_topic.rb', line 18 def initialize(topic, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::EventsTargets::SNSTopicProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(topic, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLklUb3BpYyJ9")), "topic") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzX3RhcmdldHMuU25zVG9waWNQcm9wcyJ9")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(topic, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
25 26 27 28 29 30 |
# File 'events_targets/sns_topic.rb', line 25 def self.jsii_overridable_methods { :topic => { kind: :property, name: "topic", is_optional: false }, :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind(rule, _id = nil) ⇒ AWSCDK::Events::RuleTargetConfig
Returns a RuleTarget that can be used to trigger this SNS topic as a result from an EventBridge event.
43 44 45 46 47 |
# File 'events_targets/sns_topic.rb', line 43 def bind(rule, _id = nil) Jsii::Type.check_type(rule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19ldmVudHMuSVJ1bGVSZWYifQ==")), "rule") Jsii::Type.check_type(_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "_id") unless _id.nil? jsii_call_method("bind", [rule, _id]) end |
#topic ⇒ AWSCDK::SNS::ITopic
33 34 35 |
# File 'events_targets/sns_topic.rb', line 33 def topic() jsii_get_property("topic") end |