Class: AWSCDK::Events::OnEventOptions
- Inherits:
-
EventCommonOptions
- Object
- EventCommonOptions
- AWSCDK::Events::OnEventOptions
- Defined in:
- events/on_event_options.rb
Overview
Standard set of options for onXxx event handlers on construct.
Direct Known Subclasses
Codecommit::OnCommitOptions, AWSCDK::ECR::OnCloudTrailImagePushedOptions, AWSCDK::ECR::OnImageScanCompletedOptions, S3::OnCloudTrailBucketEventOptions
Instance Attribute Summary collapse
-
#cross_stack_scope ⇒ Constructs::Construct?
readonly
The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
-
#description ⇒ String?
readonly
A description of the rule's purpose.
-
#event_pattern ⇒ AWSCDK::Events::EventPattern?
readonly
Additional restrictions for the event to route to the specified target.
-
#rule_name ⇒ String?
readonly
A name for the rule.
-
#target ⇒ AWSCDK::Events::IRuleTarget?
readonly
The target to register for the event.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, target: nil) ⇒ OnEventOptions
constructor
A new instance of OnEventOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, target: nil) ⇒ OnEventOptions
Returns a new instance of OnEventOptions.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'events/on_event_options.rb', line 12 def initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, target: nil) @cross_stack_scope = cross_stack_scope Jsii::Type.check_type(@cross_stack_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "crossStackScope") unless @cross_stack_scope.nil? @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @event_pattern = event_pattern.is_a?(Hash) ? ::AWSCDK::Events::EventPattern.new(**event_pattern.transform_keys(&:to_sym)) : event_pattern Jsii::Type.check_type(@event_pattern, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLkV2ZW50UGF0dGVybiJ9")), "eventPattern") unless @event_pattern.nil? @rule_name = rule_name Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName") unless @rule_name.nil? @target = target Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLklSdWxlVGFyZ2V0In0=")), "target") unless @target.nil? end |
Instance Attribute Details
#cross_stack_scope ⇒ Constructs::Construct? (readonly)
Default: - none (the main scope will be used, even for cross-stack Events)
The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
This helps dealing with cycles that often arise in these situations.
31 32 33 |
# File 'events/on_event_options.rb', line 31 def cross_stack_scope @cross_stack_scope end |
#description ⇒ String? (readonly)
Default: - No description
A description of the rule's purpose.
36 37 38 |
# File 'events/on_event_options.rb', line 36 def description @description end |
#event_pattern ⇒ AWSCDK::Events::EventPattern? (readonly)
Default: - No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering.
46 47 48 |
# File 'events/on_event_options.rb', line 46 def event_pattern @event_pattern end |
#rule_name ⇒ String? (readonly)
Default: AWS CloudFormation generates a unique physical ID.
A name for the rule.
51 52 53 |
# File 'events/on_event_options.rb', line 51 def rule_name @rule_name end |
#target ⇒ AWSCDK::Events::IRuleTarget? (readonly)
Default: - No target is added to the rule. Use addTarget() to add a target.
The target to register for the event.
56 57 58 |
# File 'events/on_event_options.rb', line 56 def target @target end |
Class Method Details
.jsii_properties ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'events/on_event_options.rb', line 58 def self.jsii_properties { :cross_stack_scope => "crossStackScope", :description => "description", :event_pattern => "eventPattern", :rule_name => "ruleName", :target => "target", } end |
Instance Method Details
#to_jsii ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'events/on_event_options.rb', line 68 def to_jsii result = {} result.merge!(super) result.merge!({ "crossStackScope" => @cross_stack_scope, "description" => @description, "eventPattern" => @event_pattern, "ruleName" => @rule_name, "target" => @target, }) result.compact end |