Class: AWSCDK::Triggers::TriggerProps
- Inherits:
-
TriggerOptions
- Object
- TriggerOptions
- AWSCDK::Triggers::TriggerProps
- Defined in:
- triggers/trigger_props.rb
Overview
Props for Trigger.
Instance Attribute Summary collapse
-
#execute_after ⇒ Array<Constructs::Construct>?
readonly
Adds trigger dependencies.
-
#execute_before ⇒ Array<Constructs::Construct>?
readonly
Adds this trigger as a dependency on other constructs.
-
#execute_on_handler_change ⇒ Boolean?
readonly
Re-executes the trigger every time the handler changes.
-
#handler ⇒ AWSCDK::Lambda::Function
readonly
The AWS Lambda function of the handler to execute.
-
#invocation_type ⇒ AWSCDK::Triggers::InvocationType?
readonly
The invocation type to invoke the Lambda function with.
-
#timeout ⇒ AWSCDK::Duration?
readonly
The timeout of the invocation call of the Lambda function to be triggered.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: nil, handler:, invocation_type: nil, timeout: nil) ⇒ TriggerProps
constructor
A new instance of TriggerProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: nil, handler:, invocation_type: nil, timeout: nil) ⇒ TriggerProps
Returns a new instance of TriggerProps.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'triggers/trigger_props.rb', line 13 def initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: nil, handler:, invocation_type: nil, timeout: nil) @execute_after = execute_after Jsii::Type.check_type(@execute_after, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImNvbnN0cnVjdHMuQ29uc3RydWN0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "executeAfter") unless @execute_after.nil? @execute_before = execute_before Jsii::Type.check_type(@execute_before, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImNvbnN0cnVjdHMuQ29uc3RydWN0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "executeBefore") unless @execute_before.nil? @execute_on_handler_change = execute_on_handler_change Jsii::Type.check_type(@execute_on_handler_change, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "executeOnHandlerChange") unless @execute_on_handler_change.nil? @handler = handler Jsii::Type.check_type(@handler, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLkZ1bmN0aW9uIn0=")), "handler") @invocation_type = invocation_type Jsii::Type.check_type(@invocation_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi50cmlnZ2Vycy5JbnZvY2F0aW9uVHlwZSJ9")), "invocationType") unless @invocation_type.nil? @timeout = timeout Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil? end |
Instance Attribute Details
#execute_after ⇒ Array<Constructs::Construct>? (readonly)
Default: []
Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned.
You can also use trigger.executeAfter() to add additional dependencies.
34 35 36 |
# File 'triggers/trigger_props.rb', line 34 def execute_after @execute_after end |
#execute_before ⇒ Array<Constructs::Construct>? (readonly)
Default: []
Adds this trigger as a dependency on other constructs.
This means that this trigger will get executed before the given construct(s).
You can also use trigger.executeBefore() to add additional dependents.
44 45 46 |
# File 'triggers/trigger_props.rb', line 44 def execute_before @execute_before end |
#execute_on_handler_change ⇒ Boolean? (readonly)
Default: true
Re-executes the trigger every time the handler changes.
This implies that the trigger is associated with the current_version of
the handler, which gets recreated every time the handler or its
configuration is updated.
53 54 55 |
# File 'triggers/trigger_props.rb', line 53 def execute_on_handler_change @execute_on_handler_change end |
#handler ⇒ AWSCDK::Lambda::Function (readonly)
The AWS Lambda function of the handler to execute.
57 58 59 |
# File 'triggers/trigger_props.rb', line 57 def handler @handler end |
#invocation_type ⇒ AWSCDK::Triggers::InvocationType? (readonly)
Default: RequestResponse
The invocation type to invoke the Lambda function with.
62 63 64 |
# File 'triggers/trigger_props.rb', line 62 def invocation_type @invocation_type end |
#timeout ⇒ AWSCDK::Duration? (readonly)
Default: Duration.minutes(2)
The timeout of the invocation call of the Lambda function to be triggered.
67 68 69 |
# File 'triggers/trigger_props.rb', line 67 def timeout @timeout end |
Class Method Details
.jsii_properties ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# File 'triggers/trigger_props.rb', line 69 def self.jsii_properties { :execute_after => "executeAfter", :execute_before => "executeBefore", :execute_on_handler_change => "executeOnHandlerChange", :handler => "handler", :invocation_type => "invocationType", :timeout => "timeout", } end |
Instance Method Details
#to_jsii ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'triggers/trigger_props.rb', line 80 def to_jsii result = {} result.merge!(super) result.merge!({ "executeAfter" => @execute_after, "executeBefore" => @execute_before, "executeOnHandlerChange" => @execute_on_handler_change, "handler" => @handler, "invocationType" => @invocation_type, "timeout" => @timeout, }) result.compact end |