CfnFunctionPropsMixin

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

Bases: Mixin

The AWS::Lambda::Function resource creates a Lambda function.

To create a function, you need a deployment package and an execution role . The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing.

You set the package type to Image if the deployment package is a container image . For these functions, include the URI of the container image in the Amazon ECR registry in the `ImageUri property of the Code property <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-imageuri>`_ . You do not need to specify the handler and runtime properties.

You set the package type to Zip if the deployment package is a .zip file archive . For these functions, specify the Amazon S3 location of your .zip file in the Code property. Alternatively, for Node.js and Python functions, you can define your function inline in the `ZipFile property of the Code property <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile>`_ . In both cases, you must also specify the handler and runtime properties.

You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with UpdateFunctionCode , Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.

When you update a AWS::Lambda::Function resource, CloudFormation calls the UpdateFunctionConfiguration and UpdateFunctionCode Lambda APIs under the hood. Because these calls happen sequentially, and invocations can happen between these calls, your function may encounter errors in the time between the calls. For example, if you remove an environment variable, and the code that references that environment variable in the same CloudFormation update, you may see invocation errors related to a missing environment variable. To work around this, you can invoke your function against a version or alias by default, rather than the $LATEST version.

Note that you configure provisioned concurrency on a AWS::Lambda::Version or a AWS::Lambda::Alias .

For a complete introduction to Lambda functions, see What is Lambda? in the Lambda developer guide.

See:

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

CloudformationResource:

AWS::Lambda::Function

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_function_props_mixin = lambda_mixins.CfnFunctionPropsMixin(lambda_mixins.CfnFunctionMixinProps(
    architectures=["architectures"],
    capacity_provider_config=lambda_mixins.CfnFunctionPropsMixin.CapacityProviderConfigProperty(
        lambda_managed_instances_capacity_provider_config=lambda_mixins.CfnFunctionPropsMixin.LambdaManagedInstancesCapacityProviderConfigProperty(
            capacity_provider_arn="capacityProviderArn",
            execution_environment_memory_gi_bPer_vCpu=123,
            per_execution_environment_max_concurrency=123
        )
    ),
    code=lambda_mixins.CfnFunctionPropsMixin.CodeProperty(
        image_uri="imageUri",
        s3_bucket="s3Bucket",
        s3_key="s3Key",
        s3_object_version="s3ObjectVersion",
        source_kms_key_arn="sourceKmsKeyArn",
        zip_file="zipFile"
    ),
    code_signing_config_arn="codeSigningConfigArn",
    dead_letter_config=lambda_mixins.CfnFunctionPropsMixin.DeadLetterConfigProperty(
        target_arn="targetArn"
    ),
    description="description",
    environment=lambda_mixins.CfnFunctionPropsMixin.EnvironmentProperty(
        variables={
            "variables_key": "variables"
        }
    ),
    ephemeral_storage=lambda_mixins.CfnFunctionPropsMixin.EphemeralStorageProperty(
        size=123
    ),
    file_system_configs=[lambda_mixins.CfnFunctionPropsMixin.FileSystemConfigProperty(
        arn="arn",
        local_mount_path="localMountPath"
    )],
    function_name="functionName",
    function_scaling_config=lambda_mixins.CfnFunctionPropsMixin.FunctionScalingConfigProperty(
        max_execution_environments=123,
        min_execution_environments=123
    ),
    handler="handler",
    image_config=lambda_mixins.CfnFunctionPropsMixin.ImageConfigProperty(
        command=["command"],
        entry_point=["entryPoint"],
        working_directory="workingDirectory"
    ),
    kms_key_arn="kmsKeyArn",
    layers=["layers"],
    logging_config=lambda_mixins.CfnFunctionPropsMixin.LoggingConfigProperty(
        application_log_level="applicationLogLevel",
        log_format="logFormat",
        log_group="logGroup",
        system_log_level="systemLogLevel"
    ),
    memory_size=123,
    package_type="packageType",
    publish_to_latest_published=False,
    recursive_loop="recursiveLoop",
    reserved_concurrent_executions=123,
    role="role",
    runtime="runtime",
    runtime_management_config=lambda_mixins.CfnFunctionPropsMixin.RuntimeManagementConfigProperty(
        runtime_version_arn="runtimeVersionArn",
        update_runtime_on="updateRuntimeOn"
    ),
    snap_start=lambda_mixins.CfnFunctionPropsMixin.SnapStartProperty(
        apply_on="applyOn"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    tenancy_config=lambda_mixins.CfnFunctionPropsMixin.TenancyConfigProperty(
        tenant_isolation_mode="tenantIsolationMode"
    ),
    timeout=123,
    tracing_config=lambda_mixins.CfnFunctionPropsMixin.TracingConfigProperty(
        mode="mode"
    ),
    vpc_config=lambda_mixins.CfnFunctionPropsMixin.VpcConfigProperty(
        ipv6_allowed_for_dual_stack=False,
        security_group_ids=["securityGroupIds"],
        subnet_ids=["subnetIds"]
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

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

Parameters:
  • props (Union[CfnFunctionMixinProps, 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 = ['architectures', 'capacityProviderConfig', 'code', 'codeSigningConfigArn', 'deadLetterConfig', 'description', 'environment', 'ephemeralStorage', 'fileSystemConfigs', 'functionName', 'functionScalingConfig', 'handler', 'imageConfig', 'kmsKeyArn', 'layers', 'loggingConfig', 'memorySize', 'packageType', 'publishToLatestPublished', 'recursiveLoop', 'reservedConcurrentExecutions', 'role', 'runtime', 'runtimeManagementConfig', 'snapStart', 'tags', 'tenancyConfig', 'timeout', 'tracingConfig', 'vpcConfig']

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

CapacityProviderConfigProperty

class CfnFunctionPropsMixin.CapacityProviderConfigProperty(*, lambda_managed_instances_capacity_provider_config=None)

Bases: object

Parameters:

lambda_managed_instances_capacity_provider_config (Union[IResolvable, LambdaManagedInstancesCapacityProviderConfigProperty, Dict[str, Any], None])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-capacityproviderconfig.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

capacity_provider_config_property = lambda_mixins.CfnFunctionPropsMixin.CapacityProviderConfigProperty(
    lambda_managed_instances_capacity_provider_config=lambda_mixins.CfnFunctionPropsMixin.LambdaManagedInstancesCapacityProviderConfigProperty(
        capacity_provider_arn="capacityProviderArn",
        execution_environment_memory_gi_bPer_vCpu=123,
        per_execution_environment_max_concurrency=123
    )
)

Attributes

lambda_managed_instances_capacity_provider_config

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-capacityproviderconfig.html#cfn-lambda-function-capacityproviderconfig-lambdamanagedinstancescapacityproviderconfig

Type:

see

CodeProperty

class CfnFunctionPropsMixin.CodeProperty(*, image_uri=None, s3_bucket=None, s3_key=None, s3_object_version=None, source_kms_key_arn=None, zip_file=None)

Bases: object

The deployment package for a Lambda function. To deploy a function defined as a container image, you specify the location of a container image in the Amazon ECR registry. For a .zip file deployment package, you can specify the location of an object in Amazon S3. For Node.js and Python functions, you can specify the function code inline in the template.

When you specify source code inline for a Node.js function, the index file that CloudFormation creates uses the extension .js . This means that Node.js treats the file as a CommonJS module.

Changes to a deployment package in Amazon S3 or a container image in ECR are not detected automatically during stack updates. To update the function code, change the object key or version in the template.

Parameters:
  • image_uri (Optional[str]) –

    URI of a container image in the Amazon ECR registry.

  • s3_bucket (Optional[str]) – An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account .

  • s3_key (Optional[str]) – The Amazon S3 key of the deployment package.

  • s3_object_version (Optional[str]) – For versioned objects, the version of the deployment package object to use.

  • source_kms_key_arn (Optional[str]) – The ARN of the AWS Key Management Service ( AWS ) customer managed key that’s used to encrypt your function’s .zip deployment package. If you don’t provide a customer managed key, Lambda uses an AWS owned key .

  • zip_file (Optional[str]) –

    (Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, CloudFormation places it in a file named index and zips it to create a deployment package . This zip file cannot exceed 4MB. For the Handler property, the first part of the handler identifier must be index . For example, index.handler . .. epigraph:: When you specify source code inline for a Node.js function, the index file that CloudFormation creates uses the extension .js . This means that Node.js treats the file as a CommonJS module. When using Node.js 24 or later, Node.js can automatically detect if a .js file should be treated as CommonJS or as an ES module. To enable auto-detection, add the --experimental-detect-module flag to the NODE_OPTIONS environment variable. For more information, see Experimental Node.js features . For JSON, you must escape quotes and special characters such as newline ( \n ) with a backslash. If you specify a function that interacts with an AWS CloudFormation custom resource, you don’t have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ( cfn-response ) that simplifies sending responses. See Using AWS Lambda with AWS CloudFormation for details.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.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

code_property = lambda_mixins.CfnFunctionPropsMixin.CodeProperty(
    image_uri="imageUri",
    s3_bucket="s3Bucket",
    s3_key="s3Key",
    s3_object_version="s3ObjectVersion",
    source_kms_key_arn="sourceKmsKeyArn",
    zip_file="zipFile"
)

Attributes

image_uri

URI of a container image in the Amazon ECR registry.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-imageuri

s3_bucket

An Amazon S3 bucket in the same AWS Region as your function.

The bucket can be in a different AWS account .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket

s3_key

The Amazon S3 key of the deployment package.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3key

s3_object_version

For versioned objects, the version of the deployment package object to use.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3objectversion

source_kms_key_arn

The ARN of the AWS Key Management Service ( AWS ) customer managed key that’s used to encrypt your function’s .zip deployment package. If you don’t provide a customer managed key, Lambda uses an AWS owned key .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-sourcekmskeyarn

zip_file

(Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, CloudFormation places it in a file named index and zips it to create a deployment package . This zip file cannot exceed 4MB. For the Handler property, the first part of the handler identifier must be index . For example, index.handler .

When you specify source code inline for a Node.js function, the index file that CloudFormation creates uses the extension .js . This means that Node.js treats the file as a CommonJS module.

When using Node.js 24 or later, Node.js can automatically detect if a .js file should be treated as CommonJS or as an ES module. To enable auto-detection, add the --experimental-detect-module flag to the NODE_OPTIONS environment variable. For more information, see Experimental Node.js features .

For JSON, you must escape quotes and special characters such as newline ( \n ) with a backslash.

If you specify a function that interacts with an AWS CloudFormation custom resource, you don’t have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ( cfn-response ) that simplifies sending responses. See Using AWS Lambda with AWS CloudFormation for details.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile

DeadLetterConfigProperty

class CfnFunctionPropsMixin.DeadLetterConfigProperty(*, target_arn=None)

Bases: object

The dead-letter queue for failed asynchronous invocations.

Parameters:

target_arn (Optional[str]) – The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.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

dead_letter_config_property = lambda_mixins.CfnFunctionPropsMixin.DeadLetterConfigProperty(
    target_arn="targetArn"
)

Attributes

target_arn

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn

EnvironmentProperty

class CfnFunctionPropsMixin.EnvironmentProperty(*, variables=None)

Bases: object

A function’s environment variable settings.

You can use environment variables to adjust your function’s behavior without updating code. An environment variable is a pair of strings that are stored in a function’s version-specific configuration.

Parameters:

variables (Union[Mapping[str, str], IResolvable, None]) – Environment variable key-value pairs. For more information, see Using Lambda environment variables . If the value of the environment variable is a time or a duration, enclose the value in quotes.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.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

environment_property = lambda_mixins.CfnFunctionPropsMixin.EnvironmentProperty(
    variables={
        "variables_key": "variables"
    }
)

Attributes

variables

Environment variable key-value pairs. For more information, see Using Lambda environment variables .

If the value of the environment variable is a time or a duration, enclose the value in quotes.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html#cfn-lambda-function-environment-variables

EphemeralStorageProperty

class CfnFunctionPropsMixin.EphemeralStorageProperty(*, size=None)

Bases: object

The size of the function’s /tmp directory in MB.

The default value is 512, but it can be any whole number between 512 and 10,240 MB.

Parameters:

size (Union[int, float, None]) – The size of the function’s /tmp directory.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-ephemeralstorage.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

ephemeral_storage_property = lambda_mixins.CfnFunctionPropsMixin.EphemeralStorageProperty(
    size=123
)

Attributes

size

The size of the function’s /tmp directory.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-ephemeralstorage.html#cfn-lambda-function-ephemeralstorage-size

FileSystemConfigProperty

class CfnFunctionPropsMixin.FileSystemConfigProperty(*, arn=None, local_mount_path=None)

Bases: object

Details about the connection between a Lambda function and an Amazon EFS file system .

Parameters:
  • arn (Optional[str]) – The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.

  • local_mount_path (Optional[str]) – The path where the function can access the file system, starting with /mnt/ .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.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

file_system_config_property = lambda_mixins.CfnFunctionPropsMixin.FileSystemConfigProperty(
    arn="arn",
    local_mount_path="localMountPath"
)

Attributes

arn

The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html#cfn-lambda-function-filesystemconfig-arn

local_mount_path

The path where the function can access the file system, starting with /mnt/ .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html#cfn-lambda-function-filesystemconfig-localmountpath

FunctionScalingConfigProperty

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

Bases: object

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-function-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.CfnFunctionPropsMixin.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-function-functionscalingconfig.html#cfn-lambda-function-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-function-functionscalingconfig.html#cfn-lambda-function-functionscalingconfig-minexecutionenvironments

ImageConfigProperty

class CfnFunctionPropsMixin.ImageConfigProperty(*, command=None, entry_point=None, working_directory=None)

Bases: object

Configuration values that override the container image Dockerfile settings.

For more information, see Container image settings .

Parameters:
  • command (Optional[Sequence[str]]) – Specifies parameters that you want to pass in with ENTRYPOINT. You can specify a maximum of 1,500 parameters in the list.

  • entry_point (Optional[Sequence[str]]) – Specifies the entry point to their application, which is typically the location of the runtime executable. You can specify a maximum of 1,500 string entries in the list.

  • working_directory (Optional[str]) – Specifies the working directory. The length of the directory string cannot exceed 1,000 characters.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.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

image_config_property = lambda_mixins.CfnFunctionPropsMixin.ImageConfigProperty(
    command=["command"],
    entry_point=["entryPoint"],
    working_directory="workingDirectory"
)

Attributes

command

Specifies parameters that you want to pass in with ENTRYPOINT.

You can specify a maximum of 1,500 parameters in the list.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-command

entry_point

Specifies the entry point to their application, which is typically the location of the runtime executable.

You can specify a maximum of 1,500 string entries in the list.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-entrypoint

working_directory

Specifies the working directory.

The length of the directory string cannot exceed 1,000 characters.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-workingdirectory

LambdaManagedInstancesCapacityProviderConfigProperty

class CfnFunctionPropsMixin.LambdaManagedInstancesCapacityProviderConfigProperty(*, capacity_provider_arn=None, execution_environment_memory_gib_per_v_cpu=None, per_execution_environment_max_concurrency=None)

Bases: object

Parameters:
  • capacity_provider_arn (Optional[str]) – The Amazon Resource Name (ARN) of the capacity provider.

  • execution_environment_memory_gib_per_v_cpu (Union[int, float, None]) – The amount of memory in GiB allocated per vCPU for execution environments.

  • per_execution_environment_max_concurrency (Union[int, float, None]) – The maximum number of concurrent execution environments that can run on each compute instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-lambdamanagedinstancescapacityproviderconfig.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

lambda_managed_instances_capacity_provider_config_property = lambda_mixins.CfnFunctionPropsMixin.LambdaManagedInstancesCapacityProviderConfigProperty(
    capacity_provider_arn="capacityProviderArn",
    execution_environment_memory_gi_bPer_vCpu=123,
    per_execution_environment_max_concurrency=123
)

Attributes

capacity_provider_arn

The Amazon Resource Name (ARN) of the capacity provider.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-lambdamanagedinstancescapacityproviderconfig.html#cfn-lambda-function-lambdamanagedinstancescapacityproviderconfig-capacityproviderarn

execution_environment_memory_gib_per_v_cpu

The amount of memory in GiB allocated per vCPU for execution environments.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-lambdamanagedinstancescapacityproviderconfig.html#cfn-lambda-function-lambdamanagedinstancescapacityproviderconfig-executionenvironmentmemorygibpervcpu

per_execution_environment_max_concurrency

The maximum number of concurrent execution environments that can run on each compute instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-lambdamanagedinstancescapacityproviderconfig.html#cfn-lambda-function-lambdamanagedinstancescapacityproviderconfig-perexecutionenvironmentmaxconcurrency

LoggingConfigProperty

class CfnFunctionPropsMixin.LoggingConfigProperty(*, application_log_level=None, log_format=None, log_group=None, system_log_level=None)

Bases: object

The function’s Amazon CloudWatch Logs configuration settings.

Parameters:
  • application_log_level (Optional[str]) – Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest.

  • log_format (Optional[str]) – The format in which Lambda sends your function’s application and system logs to CloudWatch. Select between plain text and structured JSON.

  • log_group (Optional[str]) – The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named /aws/lambda/<function name> . To use a different log group, enter an existing log group or enter a new log group name.

  • system_log_level (Optional[str]) – Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-loggingconfig.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

logging_config_property = lambda_mixins.CfnFunctionPropsMixin.LoggingConfigProperty(
    application_log_level="applicationLogLevel",
    log_format="logFormat",
    log_group="logGroup",
    system_log_level="systemLogLevel"
)

Attributes

application_log_level

Set this property to filter the application logs for your function that Lambda sends to CloudWatch.

Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-loggingconfig.html#cfn-lambda-function-loggingconfig-applicationloglevel

log_format

The format in which Lambda sends your function’s application and system logs to CloudWatch.

Select between plain text and structured JSON.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-loggingconfig.html#cfn-lambda-function-loggingconfig-logformat

log_group

The name of the Amazon CloudWatch log group the function sends logs to.

By default, Lambda functions send logs to a default log group named /aws/lambda/<function name> . To use a different log group, enter an existing log group or enter a new log group name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-loggingconfig.html#cfn-lambda-function-loggingconfig-loggroup

system_log_level

Set this property to filter the system logs for your function that Lambda sends to CloudWatch.

Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-loggingconfig.html#cfn-lambda-function-loggingconfig-systemloglevel

RuntimeManagementConfigProperty

class CfnFunctionPropsMixin.RuntimeManagementConfigProperty(*, 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-function-runtimemanagementconfig.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_management_config_property = lambda_mixins.CfnFunctionPropsMixin.RuntimeManagementConfigProperty(
    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-function-runtimemanagementconfig.html#cfn-lambda-function-runtimemanagementconfig-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-function-runtimemanagementconfig.html#cfn-lambda-function-runtimemanagementconfig-updateruntimeon

SnapStartProperty

class CfnFunctionPropsMixin.SnapStartProperty(*, apply_on=None)

Bases: object

The function’s AWS Lambda SnapStart setting.

Parameters:

apply_on (Optional[str]) – Set ApplyOn to PublishedVersions to create a snapshot of the initialized execution environment when you publish a function version.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.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

snap_start_property = lambda_mixins.CfnFunctionPropsMixin.SnapStartProperty(
    apply_on="applyOn"
)

Attributes

apply_on

Set ApplyOn to PublishedVersions to create a snapshot of the initialized execution environment when you publish a function version.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html#cfn-lambda-function-snapstart-applyon

SnapStartResponseProperty

class CfnFunctionPropsMixin.SnapStartResponseProperty(*, apply_on=None, optimization_status=None)

Bases: object

The function’s SnapStart setting.

Parameters:
  • apply_on (Optional[str]) – When set to PublishedVersions , Lambda creates a snapshot of the execution environment when you publish a function version.

  • optimization_status (Optional[str]) – When you provide a qualified Amazon Resource Name (ARN) , this response element indicates whether SnapStart is activated for the specified function version.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstartresponse.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

snap_start_response_property = lambda_mixins.CfnFunctionPropsMixin.SnapStartResponseProperty(
    apply_on="applyOn",
    optimization_status="optimizationStatus"
)

Attributes

apply_on

When set to PublishedVersions , Lambda creates a snapshot of the execution environment when you publish a function version.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstartresponse.html#cfn-lambda-function-snapstartresponse-applyon

optimization_status

When you provide a qualified Amazon Resource Name (ARN) , this response element indicates whether SnapStart is activated for the specified function version.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstartresponse.html#cfn-lambda-function-snapstartresponse-optimizationstatus

TenancyConfigProperty

class CfnFunctionPropsMixin.TenancyConfigProperty(*, tenant_isolation_mode=None)

Bases: object

Specifies the tenant isolation mode configuration for a Lambda function.

This allows you to configure specific tenant isolation strategies for your function invocations. Tenant isolation configuration cannot be modified after function creation.

Parameters:

tenant_isolation_mode (Optional[str]) – Tenant isolation mode allows for invocation to be sent to a corresponding execution environment dedicated to a specific tenant ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tenancyconfig.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

tenancy_config_property = lambda_mixins.CfnFunctionPropsMixin.TenancyConfigProperty(
    tenant_isolation_mode="tenantIsolationMode"
)

Attributes

tenant_isolation_mode

Tenant isolation mode allows for invocation to be sent to a corresponding execution environment dedicated to a specific tenant ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tenancyconfig.html#cfn-lambda-function-tenancyconfig-tenantisolationmode

TracingConfigProperty

class CfnFunctionPropsMixin.TracingConfigProperty(*, mode=None)

Bases: object

The function’s AWS X-Ray tracing configuration. To sample and record incoming requests, set Mode to Active .

Parameters:

mode (Optional[str]) – The tracing mode.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.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

tracing_config_property = lambda_mixins.CfnFunctionPropsMixin.TracingConfigProperty(
    mode="mode"
)

Attributes

mode

The tracing mode.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html#cfn-lambda-function-tracingconfig-mode

VpcConfigProperty

class CfnFunctionPropsMixin.VpcConfigProperty(*, ipv6_allowed_for_dual_stack=None, security_group_ids=None, subnet_ids=None)

Bases: object

The VPC security groups and subnets that are attached to a Lambda function.

When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of security group and subnet in the function’s VPC configuration. The function can only access resources and the internet through that VPC. For more information, see VPC Settings . .. epigraph:

When you delete a function, CloudFormation monitors the state of its network interfaces and waits for Lambda to delete them before proceeding. If the VPC is defined in the same stack, the network interfaces need to be deleted by Lambda before CloudFormation can delete the VPC's resources.

To monitor network interfaces, CloudFormation needs the ``ec2:DescribeNetworkInterfaces`` permission. It obtains this from the user or role that modifies the stack. If you don't provide this permission, CloudFormation does not wait for network interfaces to be deleted.
Parameters:
  • ipv6_allowed_for_dual_stack (Union[bool, IResolvable, None]) – Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

  • security_group_ids (Optional[Sequence[str]]) – A list of VPC security group IDs.

  • subnet_ids (Optional[Sequence[str]]) – A list of VPC subnet IDs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.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

vpc_config_property = lambda_mixins.CfnFunctionPropsMixin.VpcConfigProperty(
    ipv6_allowed_for_dual_stack=False,
    security_group_ids=["securityGroupIds"],
    subnet_ids=["subnetIds"]
)

Attributes

ipv6_allowed_for_dual_stack

Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-ipv6allowedfordualstack

security_group_ids

A list of VPC security group IDs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-securitygroupids

subnet_ids

A list of VPC subnet IDs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-subnetids