Class: AWSCDK::Lambda::VersionProps

Inherits:
VersionOptions
  • Object
show all
Defined in:
lambda/version_props.rb

Overview

Properties for a new Lambda version.

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, code_sha256: nil, description: nil, max_execution_environments: nil, min_execution_environments: nil, provisioned_concurrent_executions: nil, removal_policy: nil, lambda:) ⇒ VersionProps

Returns a new instance of VersionProps.

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.

  • code_sha256 (String, nil) (defaults to: nil)

    SHA256 of the version of the Lambda source code.

  • description (String, nil) (defaults to: nil)

    Description of the version.

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

    The maximum number of execution environments allowed for this version when published into a capacity provider.

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

    The minimum number of execution environments to maintain for this version when published into a capacity provider.

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

    Specifies a provisioned concurrency configuration for a function's version.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    Whether to retain old versions of this function when a new version is created.

  • lambda (AWSCDK::Lambda::IFunction)

    Function to get the value of.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lambda/version_props.rb', line 18

def initialize(max_event_age: nil, on_failure: nil, on_success: nil, retry_attempts: nil, code_sha256: nil, description: nil, max_execution_environments: nil, min_execution_environments: nil, provisioned_concurrent_executions: nil, removal_policy: nil, lambda:)
  @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?
  @code_sha256 = code_sha256
  Jsii::Type.check_type(@code_sha256, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "codeSha256") unless @code_sha256.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @max_execution_environments = max_execution_environments
  Jsii::Type.check_type(@max_execution_environments, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxExecutionEnvironments") unless @max_execution_environments.nil?
  @min_execution_environments = min_execution_environments
  Jsii::Type.check_type(@min_execution_environments, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minExecutionEnvironments") unless @min_execution_environments.nil?
  @provisioned_concurrent_executions = provisioned_concurrent_executions
  Jsii::Type.check_type(@provisioned_concurrent_executions, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "provisionedConcurrentExecutions") unless @provisioned_concurrent_executions.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
  @lambda = lambda
  Jsii::Type.check_type(@lambda, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "lambda")
end

Instance Attribute Details

#code_sha256String? (readonly)

Note:

Default: No validation is performed

SHA256 of the version of the Lambda source code.

Specify to validate that you're deploying the right version.

Returns:

  • (String, nil)


75
76
77
# File 'lambda/version_props.rb', line 75

def code_sha256
  @code_sha256
end

#descriptionString? (readonly)

Note:

Default: Description of the Lambda

Description of the version.

Returns:

  • (String, nil)


80
81
82
# File 'lambda/version_props.rb', line 80

def description
  @description
end

#lambdaAWSCDK::Lambda::IFunction (readonly)

Function to get the value of.



110
111
112
# File 'lambda/version_props.rb', line 110

def lambda
  @lambda
end

#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:



50
51
52
# File 'lambda/version_props.rb', line 50

def max_event_age
  @max_event_age
end

#max_execution_environmentsNumeric? (readonly)

Note:

Default: - No maximum specified

The maximum number of execution environments allowed for this version when published into a capacity provider.

This setting limits the total number of execution environments that can be created to handle concurrent invocations of this specific version.

Returns:

  • (Numeric, nil)


88
89
90
# File 'lambda/version_props.rb', line 88

def max_execution_environments
  @max_execution_environments
end

#min_execution_environmentsNumeric? (readonly)

Note:

Default: - 3 execution environments are set to be the minimum

The minimum number of execution environments to maintain for this version when published into a capacity provider.

This setting ensures that at least this many execution environments are always available to handle function invocations for this specific version, reducing cold start latency.

Returns:

  • (Numeric, nil)


96
97
98
# File 'lambda/version_props.rb', line 96

def min_execution_environments
  @min_execution_environments
end

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

Note:

Default: - no destination

The destination for failed invocations.



55
56
57
# File 'lambda/version_props.rb', line 55

def on_failure
  @on_failure
end

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

Note:

Default: - no destination

The destination for successful invocations.



60
61
62
# File 'lambda/version_props.rb', line 60

def on_success
  @on_success
end

#provisioned_concurrent_executionsNumeric? (readonly)

Note:

Default: No provisioned concurrency

Specifies a provisioned concurrency configuration for a function's version.

Returns:

  • (Numeric, nil)


101
102
103
# File 'lambda/version_props.rb', line 101

def provisioned_concurrent_executions
  @provisioned_concurrent_executions
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: RemovalPolicy.DESTROY

Whether to retain old versions of this function when a new version is created.

Returns:



106
107
108
# File 'lambda/version_props.rb', line 106

def removal_policy
  @removal_policy
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)


68
69
70
# File 'lambda/version_props.rb', line 68

def retry_attempts
  @retry_attempts
end

Class Method Details

.jsii_propertiesObject



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lambda/version_props.rb', line 112

def self.jsii_properties
  {
    :max_event_age => "maxEventAge",
    :on_failure => "onFailure",
    :on_success => "onSuccess",
    :retry_attempts => "retryAttempts",
    :code_sha256 => "codeSha256",
    :description => "description",
    :max_execution_environments => "maxExecutionEnvironments",
    :min_execution_environments => "minExecutionEnvironments",
    :provisioned_concurrent_executions => "provisionedConcurrentExecutions",
    :removal_policy => "removalPolicy",
    :lambda => "lambda",
  }
end

Instance Method Details

#to_jsiiObject



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lambda/version_props.rb', line 128

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "maxEventAge" => @max_event_age,
    "onFailure" => @on_failure,
    "onSuccess" => @on_success,
    "retryAttempts" => @retry_attempts,
    "codeSha256" => @code_sha256,
    "description" => @description,
    "maxExecutionEnvironments" => @max_execution_environments,
    "minExecutionEnvironments" => @min_execution_environments,
    "provisionedConcurrentExecutions" => @provisioned_concurrent_executions,
    "removalPolicy" => @removal_policy,
    "lambda" => @lambda,
  })
  result.compact
end