Class: AWSCDK::Triggers::TriggerOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
triggers/trigger_options.rb

Overview

Options for Trigger.

Direct Known Subclasses

TriggerProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: nil) ⇒ TriggerOptions

Returns a new instance of TriggerOptions.

Parameters:

  • execute_after (Array<Constructs::Construct>, nil) (defaults to: nil)

    Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned.

  • execute_before (Array<Constructs::Construct>, nil) (defaults to: nil)

    Adds this trigger as a dependency on other constructs.

  • execute_on_handler_change (Boolean, nil) (defaults to: nil)

    Re-executes the trigger every time the handler changes.



10
11
12
13
14
15
16
17
# File 'triggers/trigger_options.rb', line 10

def initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: 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?
end

Instance Attribute Details

#execute_afterArray<Constructs::Construct>? (readonly)

Note:

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.

Returns:

  • (Array<Constructs::Construct>, nil)


25
26
27
# File 'triggers/trigger_options.rb', line 25

def execute_after
  @execute_after
end

#execute_beforeArray<Constructs::Construct>? (readonly)

Note:

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.

Returns:

  • (Array<Constructs::Construct>, nil)


35
36
37
# File 'triggers/trigger_options.rb', line 35

def execute_before
  @execute_before
end

#execute_on_handler_changeBoolean? (readonly)

Note:

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.

Returns:

  • (Boolean, nil)


44
45
46
# File 'triggers/trigger_options.rb', line 44

def execute_on_handler_change
  @execute_on_handler_change
end

Class Method Details

.jsii_propertiesObject



46
47
48
49
50
51
52
# File 'triggers/trigger_options.rb', line 46

def self.jsii_properties
  {
    :execute_after => "executeAfter",
    :execute_before => "executeBefore",
    :execute_on_handler_change => "executeOnHandlerChange",
  }
end

Instance Method Details

#to_jsiiObject



54
55
56
57
58
59
60
61
62
# File 'triggers/trigger_options.rb', line 54

def to_jsii
  result = {}
  result.merge!({
    "executeAfter" => @execute_after,
    "executeBefore" => @execute_before,
    "executeOnHandlerChange" => @execute_on_handler_change,
  })
  result.compact
end