Class: AWSCDK::Triggers::Trigger
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::Triggers::Trigger
- Includes:
- ITrigger
- Defined in:
- triggers/trigger.rb
Overview
Triggers an AWS Lambda function during deployment.
Class Method Summary collapse
Instance Method Summary collapse
-
#execute_after(*scopes) ⇒ void
Adds trigger dependencies.
-
#execute_before(*scopes) ⇒ void
Adds this trigger as a dependency on other constructs.
-
#initialize(scope, id, props) ⇒ Trigger
constructor
A new instance of Trigger.
-
#node ⇒ Constructs::Node
The tree node.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ Trigger
Returns a new instance of Trigger.
12 13 14 15 16 17 18 |
# File 'triggers/trigger.rb', line 12 def initialize(scope, id, props) props = props.is_a?(Hash) ? ::AWSCDK::Triggers::TriggerProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi50cmlnZ2Vycy5UcmlnZ2VyUHJvcHMifQ==")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'triggers/trigger.rb', line 20 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :execute_after => { kind: :method, name: "executeAfter", is_optional: false }, :execute_before => { kind: :method, name: "executeBefore", is_optional: false }, } end |
Instance Method Details
#execute_after(*scopes) ⇒ void
This method returns an undefined value.
Adds trigger dependencies.
Execute this trigger only after these construct scopes have been provisioned.
67 68 69 70 71 72 |
# File 'triggers/trigger.rb', line 67 def execute_after(*scopes) scopes.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scopes[#{index}]") end jsii_call_method("executeAfter", [*scopes]) end |
#execute_before(*scopes) ⇒ void
This method returns an undefined value.
Adds this trigger as a dependency on other constructs.
This means that this trigger will get executed before the given construct(s).
81 82 83 84 85 86 |
# File 'triggers/trigger.rb', line 81 def execute_before(*scopes) scopes.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scopes[#{index}]") end jsii_call_method("executeBefore", [*scopes]) end |
#node ⇒ Constructs::Node
The tree node.
33 34 35 |
# File 'triggers/trigger.rb', line 33 def node() jsii_get_property("node") end |
#to_string ⇒ String
Returns a string representation of this construct.
40 41 42 |
# File 'triggers/trigger.rb', line 40 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
53 54 55 56 57 58 |
# File 'triggers/trigger.rb', line 53 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |