Class: AWSCDK::Lambda::VersionOptions
- Inherits:
-
EventInvokeConfigOptions
- Object
- EventInvokeConfigOptions
- AWSCDK::Lambda::VersionOptions
- Defined in:
- lambda/version_options.rb
Overview
Options for lambda.Version.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code_sha256 ⇒ String?
readonly
SHA256 of the version of the Lambda source code.
-
#description ⇒ String?
readonly
Description of the version.
-
#max_event_age ⇒ AWSCDK::Duration?
readonly
The maximum age of a request that Lambda sends to a function for processing.
-
#max_execution_environments ⇒ Numeric?
readonly
The maximum number of execution environments allowed for this version when published into a capacity provider.
-
#min_execution_environments ⇒ Numeric?
readonly
The minimum number of execution environments to maintain for this version when published into a capacity provider.
-
#on_failure ⇒ AWSCDK::Lambda::IDestination?
readonly
The destination for failed invocations.
-
#on_success ⇒ AWSCDK::Lambda::IDestination?
readonly
The destination for successful invocations.
-
#provisioned_concurrent_executions ⇒ Numeric?
readonly
Specifies a provisioned concurrency configuration for a function's version.
-
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
Whether to retain old versions of this function when a new version is created.
-
#retry_attempts ⇒ Numeric?
readonly
The maximum number of times to retry when the function returns an error.
Class Method Summary collapse
Instance Method Summary collapse
-
#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) ⇒ VersionOptions
constructor
A new instance of VersionOptions.
- #to_jsii ⇒ Object
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) ⇒ VersionOptions
Returns a new instance of VersionOptions.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lambda/version_options.rb', line 17 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) @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? end |
Instance Attribute Details
#code_sha256 ⇒ String? (readonly)
Default: No validation is performed
SHA256 of the version of the Lambda source code.
Specify to validate that you're deploying the right version.
72 73 74 |
# File 'lambda/version_options.rb', line 72 def code_sha256 @code_sha256 end |
#description ⇒ String? (readonly)
Default: Description of the Lambda
Description of the version.
77 78 79 |
# File 'lambda/version_options.rb', line 77 def description @description end |
#max_event_age ⇒ AWSCDK::Duration? (readonly)
Default: Duration.hours(6)
The maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds Maximum: 6 hours
47 48 49 |
# File 'lambda/version_options.rb', line 47 def max_event_age @max_event_age end |
#max_execution_environments ⇒ Numeric? (readonly)
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.
85 86 87 |
# File 'lambda/version_options.rb', line 85 def max_execution_environments @max_execution_environments end |
#min_execution_environments ⇒ Numeric? (readonly)
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.
93 94 95 |
# File 'lambda/version_options.rb', line 93 def min_execution_environments @min_execution_environments end |
#on_failure ⇒ AWSCDK::Lambda::IDestination? (readonly)
Default: - no destination
The destination for failed invocations.
52 53 54 |
# File 'lambda/version_options.rb', line 52 def on_failure @on_failure end |
#on_success ⇒ AWSCDK::Lambda::IDestination? (readonly)
Default: - no destination
The destination for successful invocations.
57 58 59 |
# File 'lambda/version_options.rb', line 57 def on_success @on_success end |
#provisioned_concurrent_executions ⇒ Numeric? (readonly)
Default: No provisioned concurrency
Specifies a provisioned concurrency configuration for a function's version.
98 99 100 |
# File 'lambda/version_options.rb', line 98 def provisioned_concurrent_executions @provisioned_concurrent_executions end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
Whether to retain old versions of this function when a new version is created.
103 104 105 |
# File 'lambda/version_options.rb', line 103 def removal_policy @removal_policy end |
#retry_attempts ⇒ Numeric? (readonly)
Default: 2
The maximum number of times to retry when the function returns an error.
Minimum: 0 Maximum: 2
65 66 67 |
# File 'lambda/version_options.rb', line 65 def retry_attempts @retry_attempts end |
Class Method Details
.jsii_properties ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lambda/version_options.rb', line 105 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", } end |
Instance Method Details
#to_jsii ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lambda/version_options.rb', line 120 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, }) result.compact end |