# CfnFunction

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

To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html) . 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](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) . 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](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip) . 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](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html) 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](https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunctionConfiguration.html) and [UpdateFunctionCode](https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunctionCode.html) 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](https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html) on a `AWS::Lambda::Version` or a `AWS::Lambda::Alias` .

For a complete introduction to Lambda functions, see [What is Lambda?](https://docs.aws.amazon.com/lambda/latest/dg/lambda-welcome.html) in the *Lambda developer guide.*

Extends: Construct › CfnElement › CfnRefElement › CfnResource › CfnFunction
Implements: IInspectable, ITaggable, IEnvironmentAware, IFunctionRef, IConstruct, IDependable

- CloudFormation: [`AWS::Lambda::Function`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-lambda-function.html)
- Source: Generated code
- Type last changed: v2.252.0 · 30 Apr 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const cfnFunction = new lambda.CfnFunction(this, 'MyCfnFunction', {
  code: {
    imageUri: 'imageUri',
    s3Bucket: 's3Bucket',
    s3Key: 's3Key',
    s3ObjectStorageMode: 's3ObjectStorageMode',
    s3ObjectVersion: 's3ObjectVersion',
    sourceKmsKeyArn: 'sourceKmsKeyArn',
    zipFile: 'zipFile',
  },
  role: 'role',

  // the properties below are optional
  architectures: ['architectures'],
  capacityProviderConfig: {
    lambdaManagedInstancesCapacityProviderConfig: {
      capacityProviderArn: 'capacityProviderArn',

      // the properties below are optional
      executionEnvironmentMemoryGiBPerVCpu: 123,
      perExecutionEnvironmentMaxConcurrency: 123,
    },
  },
  codeSigningConfigArn: 'codeSigningConfigArn',
  deadLetterConfig: {
    targetArn: 'targetArn',
  },
  description: 'description',
  durableConfig: {
    executionTimeout: 123,

    // the properties below are optional
    kmsKeyArn: 'kmsKeyArn',
    retentionPeriodInDays: 123,
  },
  environment: {
    variables: {
      variablesKey: 'variables',
    },
  },
  ephemeralStorage: {
    size: 123,
  },
  fileSystemConfigs: [{
    arn: 'arn',
    localMountPath: 'localMountPath',

    // the properties below are optional
    s3FilesConfig: {
      directS3Read: 'directS3Read',
    },
  }],
  functionName: 'functionName',
  functionScalingConfig: {
    maxExecutionEnvironments: 123,
    minExecutionEnvironments: 123,
  },
  handler: 'handler',
  imageConfig: {
    command: ['command'],
    entryPoint: ['entryPoint'],
    workingDirectory: 'workingDirectory',
  },
  kmsKeyArn: 'kmsKeyArn',
  layers: ['layers'],
  loggingConfig: {
    applicationLogLevel: 'applicationLogLevel',
    logFormat: 'logFormat',
    logGroup: 'logGroup',
    systemLogLevel: 'systemLogLevel',
  },
  memorySize: 123,
  packageType: 'packageType',
  publishToLatestPublished: false,
  recursiveLoop: 'recursiveLoop',
  reservedConcurrentExecutions: 123,
  runtime: 'runtime',
  runtimeManagementConfig: {
    updateRuntimeOn: 'updateRuntimeOn',

    // the properties below are optional
    runtimeVersionArn: 'runtimeVersionArn',
  },
  snapStart: {
    applyOn: 'applyOn',
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
  tenancyConfig: {
    tenantIsolationMode: 'tenantIsolationMode',
  },
  timeout: 123,
  tracingConfig: {
    mode: 'mode',
  },
  vpcConfig: {
    ipv6AllowedForDualStack: false,
    securityGroupIds: ['securityGroupIds'],
    subnetIds: ['subnetIds'],
  },
});
```

## Initializer

```ts
new CfnFunction(scope: Construct, id: string, props: CfnFunctionProps)
```

## Construct Props

- `architectures`: string[] — The instruction set architecture that the function supports.

  Enter a string array with one of the valid values (arm64 or x86_64). The default value is `x86_64` .

- `capacityProviderConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.CapacityProviderConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.CapacityProviderConfigProperty.html) — Configuration for the capacity provider that manages compute resources for Lambda functions.

- `code`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.CodeProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.CodeProperty.html) (required) — The code for the function. You can define your function code in multiple ways:.

  - For .zip deployment packages, you can specify the Amazon S3 location of the .zip file in the `S3Bucket` , `S3Key` , and `S3ObjectVersion` properties.
  - For .zip deployment packages, you can alternatively define the function code inline in the `ZipFile` property. This method works only for Node.js and Python functions.
  - For container images, specify the URI of your container image in the Amazon ECR registry in the `ImageUri` property.

- `codeSigningConfigArn`: string | [ICodeSigningConfigRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.ICodeSigningConfigRef.html) — To enable code signing for this function, specify the ARN of a code-signing configuration.

  A code-signing configuration
  includes a set of signing profiles, which define the trusted publishers for this function.

- `deadLetterConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.DeadLetterConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.DeadLetterConfigProperty.html) — A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

  For more information, see [Dead-letter queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq) .

- `description`: string — A description of the function.

- `durableConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.DurableConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.DurableConfigProperty.html) — Configuration settings for [durable functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) , including execution timeout and retention period for execution history.

- `environment`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.EnvironmentProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.EnvironmentProperty.html) — Environment variables that are accessible from function code during execution.

- `ephemeralStorage`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.EphemeralStorageProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.EphemeralStorageProperty.html) — 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.

- `fileSystemConfigs`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.FileSystemConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.FileSystemConfigProperty.html)[] — Connection settings for an Amazon EFS file system.

  To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) resource, you must also specify a `DependsOn` attribute to ensure that the mount target is created or updated before the function.

  For more information about using the `DependsOn` attribute, see [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) .

- `functionName`: string — The name of the Lambda function, up to 64 characters in length.

  If you don't specify a name, CloudFormation generates one.

  If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

- `functionScalingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.FunctionScalingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.FunctionScalingConfigProperty.html) — 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.

- `handler`: string — The name of the method within your code that Lambda calls to run your function.

  Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see [Lambda programming model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html) .

- `imageConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.ImageConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.ImageConfigProperty.html) — Configuration values that override the container image Dockerfile settings.

  For more information, see [Container image settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) .

- `kmsKeyArn`: string | [IKeyRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_kms.IKeyRef.html) — The ARN of the AWS Key Management Service ( AWS ) customer managed key that's used to encrypt the following resources:.

  - The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption) .
  - The function's [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) snapshots.
  - When used with `SourceKMSKeyArn` , the unzipped version of the .zip deployment package that's used for function invocations. For more information, see [Specifying a customer managed key for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption) .
  - The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see [Function lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle) .

  If you don't provide a customer managed key, Lambda uses an [AWS owned key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) or an [AWS managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) .

- `layers`: string | [ILayerVersionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.ILayerVersionRef.html)[] — A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment. Specify each layer by its ARN, including the version.

- `loggingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.LoggingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.LoggingConfigProperty.html) — The function's Amazon CloudWatch Logs configuration settings.

- `memorySize`: number — The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB. Note that new AWS accounts have reduced concurrency and memory quotas. AWS raises these quotas automatically based on your usage. You can also request a quota increase.

- `packageType`: string — The type of deployment package.

  Set to `Image` for container image and set `Zip` for .zip file archive.

- `publishToLatestPublished`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)

- `recursiveLoop`: string — The status of your function's recursive loop detection configuration.

  When this value is set to `Allow` and Lambda detects your function being invoked as part of a recursive loop, it doesn't take any action.

  When this value is set to `Terminate` and Lambda detects your function being invoked as part of a recursive loop, it stops your function being invoked and notifies you.

- `reservedConcurrentExecutions`: number — The number of simultaneous executions to reserve for the function.

- `role`: string | [IRoleRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) (required) — The Amazon Resource Name (ARN) of the function's execution role.

- `runtime`: string — The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) . Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.

  The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see [Runtime use after deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels) .

  For a list of all currently supported runtimes, see [Supported runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported) .

- `runtimeManagementConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.RuntimeManagementConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.RuntimeManagementConfigProperty.html) — Sets the runtime management configuration for a function's version.

  For more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html) .

- `snapStart`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.SnapStartProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.SnapStartProperty.html) — The function's [AWS Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.

- `tags`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function.

  > You must have the `lambda:TagResource` , `lambda:UntagResource` , and `lambda:ListTags` permissions for your [IAM principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to manage the CloudFormation stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.

- `tenancyConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.TenancyConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.TenancyConfigProperty.html) — The function's tenant isolation configuration settings.

  Determines whether the Lambda function runs on a shared or dedicated infrastructure per unique tenant.

- `timeout`: number — The amount of time (in seconds) that Lambda allows a function to run before stopping it.

  The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html) .

- `tracingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.TracingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.TracingConfigProperty.html) — Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) .

- `vpcConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.VpcConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.VpcConfigProperty.html) — For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

  When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html) .

## Properties

- `architectures`: string[] — The instruction set architecture that the function supports.

- `attrArn`: string (required) — The Amazon Resource Name (ARN) of the function.

- `attrSnapStartResponse`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) (required) — The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.

- `attrSnapStartResponseApplyOn`: string (required) — When set to ``PublishedVersions``, Lambda creates a snapshot of the execution environment when you publish a function version.

- `attrSnapStartResponseOptimizationStatus`: string (required) — When you provide a [qualified Amazon Resource Name (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), this response element indicates whether SnapStart is activated for the specified function version.

- `capacityProviderConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.CapacityProviderConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.CapacityProviderConfigProperty.html) — Configuration for the capacity provider that manages compute resources for Lambda functions.

- `CFN_RESOURCE_TYPE_NAME`: string (required) (static) — The CloudFormation resource type name for this resource class.

- `cfnOptions`: [ICfnResourceOptions](/cdk/api/v2/docs/aws-cdk-lib.ICfnResourceOptions.html) (required) — Options for this resource, such as condition, update policy etc.

- `cfnResourceType`: string (required) — AWS resource type.

- `code`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.CodeProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.CodeProperty.html) (required) — The code for the function.

  You can define your function code in multiple ways:.

- `codeSigningConfigArn`: string — To enable code signing for this function, specify the ARN of a code-signing configuration.

- `creationStack`: string[] (required)

- `deadLetterConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.DeadLetterConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.DeadLetterConfigProperty.html) — A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

- `description`: string — A description of the function.

- `durableConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.DurableConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.DurableConfigProperty.html) — Configuration settings for [durable functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) , including execution timeout and retention period for execution history.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required)

- `environment`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.EnvironmentProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.EnvironmentProperty.html) — Environment variables that are accessible from function code during execution.

- `ephemeralStorage`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.EphemeralStorageProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.EphemeralStorageProperty.html) — The size of the function's `/tmp` directory in MB.

- `fileSystemConfigs`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.FileSystemConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.FileSystemConfigProperty.html)[] — Connection settings for an Amazon EFS file system.

- `functionName`: string — The name of the Lambda function, up to 64 characters in length.

- `functionRef`: [FunctionReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.FunctionReference.html) (required) — A reference to a Function resource.

- `functionScalingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.FunctionScalingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.FunctionScalingConfigProperty.html) — 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.

- `handler`: string — The name of the method within your code that Lambda calls to run your function.

- `imageConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.ImageConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.ImageConfigProperty.html) — Configuration values that override the container image Dockerfile settings.

- `kmsKeyArn`: string — The ARN of the AWS Key Management Service ( AWS ) customer managed key that's used to encrypt the following resources:.

- `layers`: string[] — A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment. Specify each layer by its ARN, including the version.

- `loggingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.LoggingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.LoggingConfigProperty.html) — The function's Amazon CloudWatch Logs configuration settings.

- `logicalId`: string (required) — The logical ID for this CloudFormation stack element.

  The logical ID of the element
  is calculated from the path of the resource node in the construct tree.

  To override this value, use `overrideLogicalId(newLogicalId)`.

- `memorySize`: number — The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB. Note that new AWS accounts have reduced concurrency and memory quotas. AWS raises these quotas automatically based on your usage. You can also request a quota increase.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `packageType`: string — The type of deployment package.

- `publishToLatestPublished`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)

- `recursiveLoop`: string — The status of your function's recursive loop detection configuration.

- `ref`: string (required) — Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

  If, by any chance, the intrinsic reference of a resource is not a string, you could
  coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.

- `reservedConcurrentExecutions`: number — The number of simultaneous executions to reserve for the function.

- `role`: string (required) — The Amazon Resource Name (ARN) of the function's execution role.

- `runtime`: string — The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) . Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.

- `runtimeManagementConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.RuntimeManagementConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.RuntimeManagementConfigProperty.html) — Sets the runtime management configuration for a function's version.

- `snapStart`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.SnapStartProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.SnapStartProperty.html) — The function's [AWS Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this element is defined.

  CfnElements must be defined within a stack scope (directly or indirectly).

- `tags`: [TagManager](/cdk/api/v2/docs/aws-cdk-lib.TagManager.html) (required) — Tag Manager which manages the tags for this resource.

- `tagsRaw`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function.

- `tenancyConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.TenancyConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.TenancyConfigProperty.html) — The function's tenant isolation configuration settings.

- `timeout`: number — The amount of time (in seconds) that Lambda allows a function to run before stopping it.

- `tracingConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.TracingConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.TracingConfigProperty.html) — Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) .

- `vpcConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnFunction.VpcConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnFunction.VpcConfigProperty.html) — For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

## Methods

- `addDeletionOverride(path: string): void` — Syntactic sugar for `addOverride(path, undefined)`.

  **Parameters**

  - `path` — The path of the value to delete.

- `addDependency(target: CfnResource): void` — Use `addResourceDependency` instead.

  This method has been renamed to `addResourceDependency` to more clearly
  set it apart from `construct.node.addDependency`. See the documentation
  of that function for more details.

- `addDependsOn(target: CfnResource): void` — Use `addResourceDependency` instead.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method has been renamed to `addResourceDependency`, which makes it
  more clear that this method operates at a different level from the
  construct-level `construct.node.addDependency()` mechanism.

- `addMetadata(key: string, value: any): void` — Add a value to the CloudFormation Resource Metadata.

- `addOverride(path: string, value: any): void` — Adds an override to the synthesized CloudFormation resource.

  To add a
  property override, either use `addPropertyOverride` or prefix `path` with
  "Properties." (i.e. `Properties.TopicName`).

  If the override is nested, separate each nested level using a dot (.) in the path parameter.
  If there is an array as part of the nesting, specify the index in the path.

  To include a literal `.` in the property name, prefix with a `\`. In most
  programming languages you will need to write this as `"\\."` because the
  `\` itself will need to be escaped.

  For example,
  ```typescript
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
  ```
  would add the overrides
  ```json
  "Properties": {
    "GlobalSecondaryIndexes": [
      {
        "Projection": {
          "NonKeyAttributes": [ "myattribute" ]
          ...
        }
        ...
      },
      {
        "ProjectionType": "INCLUDE"
        ...
      },
    ]
    ...
  }
  ```

  The `value` argument to `addOverride` will not be processed or translated
  in any way. Pass raw JSON values in here with the correct capitalization
  for CloudFormation. If you pass CDK classes or structs, they will be
  rendered with lowercased key names, and CloudFormation will reject the
  template.

  **Parameters**

  - `path` — - The path of the property, you can use dot notation to override values in complex types.
  - `value` — - The value.

- `addPropertyDeletionOverride(propertyPath: string): void` — Adds an override that deletes the value of a property from the resource definition.

  **Parameters**

  - `propertyPath` — The path to the property.

- `addPropertyOverride(propertyPath: string, value: any): void` — Adds an override to a resource property.

  Syntactic sugar for `addOverride("Properties.<...>", value)`.

  **Parameters**

  - `propertyPath` — The path of the property.
  - `value` — The value.

- `addResourceDependency(target: CfnResource, reason?: string): void` — Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method only adds dependencies between L1 resources. If you are
  looking for a generic construct-to-construct dependency mechanism that works
  for all constructs including L2s, use `construct.node.addDependency` instead.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Sets the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  strength instead of the global default from the consuming stack's context.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void` — Sets the deletion policy of the resource based on the removal policy specified.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
  cases, a snapshot can be taken of the resource prior to deletion
  (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
  can be found in the following link:

- `arnForFunction(resource: IFunctionRef): string` (static)

- `cfnPropertyName(cdkPropertyName: string): string`

- `fromFunctionArn(scope: Construct, id: string, arn: string): IFunctionRef` (static) — Creates a new IFunctionRef from an ARN.

- `fromFunctionName(scope: Construct, id: string, functionName: string): IFunctionRef` (static) — Creates a new IFunctionRef from a functionName.

- `getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference` — Returns a token for an runtime attribute of this resource.

  Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
  in case there is no generated attribute.

  **Parameters**

  - `attributeName` — The name of the attribute.

- `getMetadata(key: string): any` — Retrieve a value value from the CloudFormation Resource Metadata.

- `inspect(inspector: TreeInspector): void` — Examines the CloudFormation resource and discloses attributes.

  **Parameters**

  - `inspector` — tree inspector to collect and process attributes.

- `isCfnElement(x: any): boolean` (static) — Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

  Uses duck-typing instead of `instanceof` to allow stack elements from different
  versions of this library to be included in the same stack.

  **Returns:** The construct as a stack element or undefined if it is not a stack element.

- `isCfnFunction(x: any): boolean` (static) — Checks whether the given object is a CfnFunction.

- `isCfnResource(x: any): boolean` (static) — Check whether the given object is a CfnResource.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `obtainDependencies(): Stack | CfnResource[]` — Retrieves an array of resources and stacks this resource depends on.

  For resources depended on directly, returns the `CfnResource` object. For
  dependencies on other stacks, returns the `Stack` object. The order of the
  array is not guaranteed.

- `overrideLogicalId(newLogicalId: string): void` — Overrides the auto-generated logical ID with a specific ID.

  **Parameters**

  - `newLogicalId` — The new logical ID to use for this stack element.

- `removeDependency(target: CfnResource): void` — Use `removeResourceDependency` instead

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `removeResourceDependency(target: CfnResource): void` — Indicates that this resource no longer depends on another resource.

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `replaceDependency(target: CfnResource, newTarget: CfnResource): void` — Replaces one dependency with another.

  **Parameters**

  - `target` — The dependency to replace.
  - `newTarget` — The new dependency to add.

- `toString(): string` — Returns a string representation of this construct.

  **Returns:** a string representation of this resource

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
