Class: AWSCDK::Lambda::EventInvokeConfigOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lambda/event_invoke_config_options.rb

Overview

Options to add an EventInvokeConfig to a function.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_event_age: nil, on_failure: nil, on_success: nil, retry_attempts: nil) ⇒ EventInvokeConfigOptions

Returns a new instance of EventInvokeConfigOptions.

Parameters:

  • max_event_age (AWSCDK::Duration, nil) (defaults to: nil)

    The maximum age of a request that Lambda sends to a function for processing.

  • on_failure (AWSCDK::Lambda::IDestination, nil) (defaults to: nil)

    The destination for failed invocations.

  • on_success (AWSCDK::Lambda::IDestination, nil) (defaults to: nil)

    The destination for successful invocations.

  • retry_attempts (Numeric, nil) (defaults to: nil)

    The maximum number of times to retry when the function returns an error.



11
12
13
14
15
16
17
18
19
20
# File 'lambda/event_invoke_config_options.rb', line 11

def initialize(max_event_age: nil, on_failure: nil, on_success: nil, retry_attempts: nil)
  @max_event_age = max_event_age
  Jsii::Type.check_type(@max_event_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxEventAge") unless @max_event_age.nil?
  @on_failure = on_failure
  Jsii::Type.check_type(@on_failure, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklEZXN0aW5hdGlvbiJ9")), "onFailure") unless @on_failure.nil?
  @on_success = on_success
  Jsii::Type.check_type(@on_success, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklEZXN0aW5hdGlvbiJ9")), "onSuccess") unless @on_success.nil?
  @retry_attempts = retry_attempts
  Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil?
end

Instance Attribute Details

#max_event_ageAWSCDK::Duration? (readonly)

Note:

Default: Duration.hours(6)

The maximum age of a request that Lambda sends to a function for processing.

Minimum: 60 seconds Maximum: 6 hours

Returns:



29
30
31
# File 'lambda/event_invoke_config_options.rb', line 29

def max_event_age
  @max_event_age
end

#on_failureAWSCDK::Lambda::IDestination? (readonly)

Note:

Default: - no destination

The destination for failed invocations.



34
35
36
# File 'lambda/event_invoke_config_options.rb', line 34

def on_failure
  @on_failure
end

#on_successAWSCDK::Lambda::IDestination? (readonly)

Note:

Default: - no destination

The destination for successful invocations.



39
40
41
# File 'lambda/event_invoke_config_options.rb', line 39

def on_success
  @on_success
end

#retry_attemptsNumeric? (readonly)

Note:

Default: 2

The maximum number of times to retry when the function returns an error.

Minimum: 0 Maximum: 2

Returns:

  • (Numeric, nil)


47
48
49
# File 'lambda/event_invoke_config_options.rb', line 47

def retry_attempts
  @retry_attempts
end

Class Method Details

.jsii_propertiesObject



49
50
51
52
53
54
55
56
# File 'lambda/event_invoke_config_options.rb', line 49

def self.jsii_properties
  {
    :max_event_age => "maxEventAge",
    :on_failure => "onFailure",
    :on_success => "onSuccess",
    :retry_attempts => "retryAttempts",
  }
end

Instance Method Details

#to_jsiiObject



58
59
60
61
62
63
64
65
66
67
# File 'lambda/event_invoke_config_options.rb', line 58

def to_jsii
  result = {}
  result.merge!({
    "maxEventAge" => @max_event_age,
    "onFailure" => @on_failure,
    "onSuccess" => @on_success,
    "retryAttempts" => @retry_attempts,
  })
  result.compact
end