Class: AWSCDK::Events::RuleProps
- Inherits:
-
EventCommonOptions
- Object
- EventCommonOptions
- AWSCDK::Events::RuleProps
- Defined in:
- events/rule_props.rb
Overview
Properties for defining an EventBridge Rule.
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.
-
#enabled ⇒ Boolean?
readonly
Indicates whether the rule is enabled.
-
#event_bus ⇒ AWSCDK::Interfaces::AWSEvents::IEventBusRef?
readonly
The event bus to associate with this rule.
-
#event_pattern ⇒ AWSCDK::Events::EventPattern?
readonly
Additional restrictions for the event to route to the specified target.
-
#role ⇒ AWSCDK::Interfaces::AWSIAM::IRoleRef?
readonly
The role that is used for target invocation.
-
#rule_name ⇒ String?
readonly
A name for the rule.
-
#schedule ⇒ AWSCDK::Events::Schedule?
readonly
The schedule or rate (frequency) that determines when EventBridge runs the rule.
-
#targets ⇒ Array<AWSCDK::Events::IRuleTarget>?
readonly
Targets to invoke when this rule matches an event.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, enabled: nil, event_bus: nil, role: nil, schedule: nil, targets: nil) ⇒ RuleProps
constructor
A new instance of RuleProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, enabled: nil, event_bus: nil, role: nil, schedule: nil, targets: nil) ⇒ RuleProps
Returns a new instance of RuleProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'events/rule_props.rb', line 16 def initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, enabled: nil, event_bus: nil, role: nil, schedule: nil, targets: 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? @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil? @event_bus = event_bus Jsii::Type.check_type(@event_bus, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19ldmVudHMuSUV2ZW50QnVzUmVmIn0=")), "eventBus") unless @event_bus.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifQ==")), "role") unless @role.nil? @schedule = schedule Jsii::Type.check_type(@schedule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlNjaGVkdWxlIn0=")), "schedule") unless @schedule.nil? @targets = targets Jsii::Type.check_type(@targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHMuSVJ1bGVUYXJnZXQifSwia2luZCI6ImFycmF5In19")), "targets") unless @targets.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.
43 44 45 |
# File 'events/rule_props.rb', line 43 def cross_stack_scope @cross_stack_scope end |
#description ⇒ String? (readonly)
Default: - No description
A description of the rule's purpose.
48 49 50 |
# File 'events/rule_props.rb', line 48 def description @description end |
#enabled ⇒ Boolean? (readonly)
Default: true
Indicates whether the rule is enabled.
68 69 70 |
# File 'events/rule_props.rb', line 68 def enabled @enabled end |
#event_bus ⇒ AWSCDK::Interfaces::AWSEvents::IEventBusRef? (readonly)
Default: - The default event bus.
The event bus to associate with this rule.
73 74 75 |
# File 'events/rule_props.rb', line 73 def event_bus @event_bus 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.
58 59 60 |
# File 'events/rule_props.rb', line 58 def event_pattern @event_pattern end |
#role ⇒ AWSCDK::Interfaces::AWSIAM::IRoleRef? (readonly)
Default: - No role associated
The role that is used for target invocation.
Must be assumable by principal events.amazonaws.com.
80 81 82 |
# File 'events/rule_props.rb', line 80 def role @role end |
#rule_name ⇒ String? (readonly)
Default: AWS CloudFormation generates a unique physical ID.
A name for the rule.
63 64 65 |
# File 'events/rule_props.rb', line 63 def rule_name @rule_name end |
#schedule ⇒ AWSCDK::Events::Schedule? (readonly)
Default: - None.
The schedule or rate (frequency) that determines when EventBridge runs the rule.
You must specify this property, the event_pattern property, or both.
For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide.
91 92 93 |
# File 'events/rule_props.rb', line 91 def schedule @schedule end |
#targets ⇒ Array<AWSCDK::Events::IRuleTarget>? (readonly)
Default: - No targets.
Targets to invoke when this rule matches an event.
Input will be the full matched event. If you wish to specify custom
target input, use addTarget(target[, inputOptions]).
99 100 101 |
# File 'events/rule_props.rb', line 99 def targets @targets end |
Class Method Details
.jsii_properties ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'events/rule_props.rb', line 101 def self.jsii_properties { :cross_stack_scope => "crossStackScope", :description => "description", :event_pattern => "eventPattern", :rule_name => "ruleName", :enabled => "enabled", :event_bus => "eventBus", :role => "role", :schedule => "schedule", :targets => "targets", } end |
Instance Method Details
#to_jsii ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'events/rule_props.rb', line 115 def to_jsii result = {} result.merge!(super) result.merge!({ "crossStackScope" => @cross_stack_scope, "description" => @description, "eventPattern" => @event_pattern, "ruleName" => @rule_name, "enabled" => @enabled, "eventBus" => @event_bus, "role" => @role, "schedule" => @schedule, "targets" => @targets, }) result.compact end |