CfnVersionPropsMixin

class aws_cdk.mixins_preview.aws_lambda.mixins.CfnVersionPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::Lambda::Version resource creates a version from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn’t change.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html

CloudformationResource:

AWS::Lambda::Version

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_lambda import mixins as lambda_mixins

cfn_version_props_mixin = lambda_mixins.CfnVersionPropsMixin(lambda_mixins.CfnVersionMixinProps(
    code_sha256="codeSha256",
    description="description",
    function_name="functionName",
    function_scaling_config=lambda_mixins.CfnVersionPropsMixin.FunctionScalingConfigProperty(
        max_execution_environments=123,
        min_execution_environments=123
    ),
    provisioned_concurrency_config=lambda_mixins.CfnVersionPropsMixin.ProvisionedConcurrencyConfigurationProperty(
        provisioned_concurrent_executions=123
    ),
    runtime_policy=lambda_mixins.CfnVersionPropsMixin.RuntimePolicyProperty(
        runtime_version_arn="runtimeVersionArn",
        update_runtime_on="updateRuntimeOn"
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Lambda::Version.

Parameters:
  • props (Union[CfnVersionMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['codeSha256', 'description', 'functionName', 'functionScalingConfig', 'provisionedConcurrencyConfig', 'runtimePolicy']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

FunctionScalingConfigProperty

class CfnVersionPropsMixin.FunctionScalingConfigProperty(*, max_execution_environments=None, min_execution_environments=None)

Bases: object

Configuration that defines the scaling behavior for a Lambda Managed Instances function, including the minimum and maximum number of execution environments that can be provisioned.

Parameters:
  • max_execution_environments (Union[int, float, None]) – The maximum number of execution environments that can be provisioned for the function.

  • min_execution_environments (Union[int, float, None]) – The minimum number of execution environments to maintain for the function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-functionscalingconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_lambda import mixins as lambda_mixins

function_scaling_config_property = lambda_mixins.CfnVersionPropsMixin.FunctionScalingConfigProperty(
    max_execution_environments=123,
    min_execution_environments=123
)

Attributes

max_execution_environments

The maximum number of execution environments that can be provisioned for the function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-functionscalingconfig.html#cfn-lambda-version-functionscalingconfig-maxexecutionenvironments

min_execution_environments

The minimum number of execution environments to maintain for the function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-functionscalingconfig.html#cfn-lambda-version-functionscalingconfig-minexecutionenvironments

ProvisionedConcurrencyConfigurationProperty

class CfnVersionPropsMixin.ProvisionedConcurrencyConfigurationProperty(*, provisioned_concurrent_executions=None)

Bases: object

A provisioned concurrency configuration for a function’s version.

Parameters:

provisioned_concurrent_executions (Union[int, float, None]) – The amount of provisioned concurrency to allocate for the version.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-provisionedconcurrencyconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_lambda import mixins as lambda_mixins

provisioned_concurrency_configuration_property = lambda_mixins.CfnVersionPropsMixin.ProvisionedConcurrencyConfigurationProperty(
    provisioned_concurrent_executions=123
)

Attributes

provisioned_concurrent_executions

The amount of provisioned concurrency to allocate for the version.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-provisionedconcurrencyconfiguration.html#cfn-lambda-version-provisionedconcurrencyconfiguration-provisionedconcurrentexecutions

RuntimePolicyProperty

class CfnVersionPropsMixin.RuntimePolicyProperty(*, runtime_version_arn=None, update_runtime_on=None)

Bases: object

Sets the runtime management configuration for a function’s version.

For more information, see Runtime updates .

Parameters:
  • runtime_version_arn (Optional[str]) – The ARN of the runtime version you want the function to use. .. epigraph:: This is only required if you’re using the Manual runtime update mode.

  • update_runtime_on (Optional[str]) – Specify the runtime update mode. - Auto (default) - Automatically update to the most recent and secure runtime version using a Two-phase runtime version rollout . This is the best choice for most customers to ensure they always benefit from runtime updates. - FunctionUpdate - Lambda updates the runtime of you function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date. - Manual - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see Roll back a runtime version . Valid Values : Auto | FunctionUpdate | Manual

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-runtimepolicy.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_lambda import mixins as lambda_mixins

runtime_policy_property = lambda_mixins.CfnVersionPropsMixin.RuntimePolicyProperty(
    runtime_version_arn="runtimeVersionArn",
    update_runtime_on="updateRuntimeOn"
)

Attributes

runtime_version_arn

The ARN of the runtime version you want the function to use.

This is only required if you’re using the Manual runtime update mode.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-runtimepolicy.html#cfn-lambda-version-runtimepolicy-runtimeversionarn

update_runtime_on

Specify the runtime update mode.

  • Auto (default) - Automatically update to the most recent and secure runtime version using a Two-phase runtime version rollout . This is the best choice for most customers to ensure they always benefit from runtime updates.

  • FunctionUpdate - Lambda updates the runtime of you function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.

  • Manual - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see Roll back a runtime version .

Valid Values : Auto | FunctionUpdate | Manual

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-runtimepolicy.html#cfn-lambda-version-runtimepolicy-updateruntimeon