Class: AWSCDK::Lambda::LatestPublishedScalingConfig

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

Overview

The scaling configuration that will be applied to the $LATEST.PUBLISHED version.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_execution_environments: nil, min_execution_environments: nil) ⇒ LatestPublishedScalingConfig

Returns a new instance of LatestPublishedScalingConfig.

Parameters:

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

    The maximum number of execution environments allowed for the $LATEST.PUBLISHED version when published into a capacity provider.

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

    The minimum number of execution environments to maintain for the $LATEST.PUBLISHED version when published into a capacity provider.



9
10
11
12
13
14
# File 'lambda/latest_published_scaling_config.rb', line 9

def initialize(max_execution_environments: nil, min_execution_environments: 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?
end

Instance Attribute Details

#max_execution_environmentsNumeric? (readonly)

Note:

Default: - No maximum specified

The maximum number of execution environments allowed for the $LATEST.PUBLISHED 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)


23
24
25
# File 'lambda/latest_published_scaling_config.rb', line 23

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 the $LATEST.PUBLISHED 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)


31
32
33
# File 'lambda/latest_published_scaling_config.rb', line 31

def min_execution_environments
  @min_execution_environments
end

Class Method Details

.jsii_propertiesObject



33
34
35
36
37
38
# File 'lambda/latest_published_scaling_config.rb', line 33

def self.jsii_properties
  {
    :max_execution_environments => "maxExecutionEnvironments",
    :min_execution_environments => "minExecutionEnvironments",
  }
end

Instance Method Details

#to_jsiiObject



40
41
42
43
44
45
46
47
# File 'lambda/latest_published_scaling_config.rb', line 40

def to_jsii
  result = {}
  result.merge!({
    "maxExecutionEnvironments" => @max_execution_environments,
    "minExecutionEnvironments" => @min_execution_environments,
  })
  result.compact
end