Class: OpenStax::Aws::EventRule
- Inherits:
-
Object
- Object
- OpenStax::Aws::EventRule
- Defined in:
- lib/openstax/aws/event_rule.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#raw_rule ⇒ Object
readonly
Returns the value of attribute raw_rule.
Class Method Summary collapse
Instance Method Summary collapse
- #add_tags_not_handled_by_cloudformation(stack_tags) ⇒ Object
-
#initialize(name:, region:) ⇒ EventRule
constructor
A new instance of EventRule.
- #tag_resource(new_tags) ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(name:, region:) ⇒ EventRule
Returns a new instance of EventRule.
11 12 13 14 15 |
# File 'lib/openstax/aws/event_rule.rb', line 11 def initialize(name:, region:) @client = Aws::EventBridge::Client.new region: region # There is no real rule wrapper in the SDK but the DescribeRuleResponse can be used @raw_rule = client.describe_rule name: name end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/openstax/aws/event_rule.rb', line 3 def client @client end |
#raw_rule ⇒ Object (readonly)
Returns the value of attribute raw_rule.
3 4 5 |
# File 'lib/openstax/aws/event_rule.rb', line 3 def raw_rule @raw_rule end |
Class Method Details
.physical_resource_id_attribute ⇒ Object
7 8 9 |
# File 'lib/openstax/aws/event_rule.rb', line 7 def self.physical_resource_id_attribute :name end |
Instance Method Details
#add_tags_not_handled_by_cloudformation(stack_tags) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/openstax/aws/event_rule.rb', line 25 def () = .map(&:to_h) - .map(&:to_h) return if .empty? OpenStax::Aws.configuration.logger.debug "Tagging #{name}..." tag_resource end |
#tag_resource(new_tags) ⇒ Object
21 22 23 |
# File 'lib/openstax/aws/event_rule.rb', line 21 def tag_resource() client.tag_resource resource_arn: raw_rule.arn, tags: end |
#tags ⇒ Object
17 18 19 |
# File 'lib/openstax/aws/event_rule.rb', line 17 def client.(resource_arn: raw_rule.arn). end |