# CfnVersionProps

Properties for defining a `CfnVersion`.

Used as props by: [CfnVersion](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnVersion.html)

- Source: Generated at build time
- Type last changed: v2.231.0 · 1 Dec 2025

## Example

TypeScript:

```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 cfnVersionProps: lambda.CfnVersionProps = {
  functionName: 'functionName',

  // the properties below are optional
  codeSha256: 'codeSha256',
  description: 'description',
  functionScalingConfig: {
    maxExecutionEnvironments: 123,
    minExecutionEnvironments: 123,
  },
  provisionedConcurrencyConfig: {
    provisionedConcurrentExecutions: 123,
  },
  runtimePolicy: {
    updateRuntimeOn: 'updateRuntimeOn',

    // the properties below are optional
    runtimeVersionArn: 'runtimeVersionArn',
  },
};
```

Python:

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

cfn_version_props = lambda.CfnVersionProps(
    function_name="functionName",

    # the properties below are optional
    code_sha256="codeSha256",
    description="description",
    function_scaling_config=lambda.CfnVersion.FunctionScalingConfigProperty(
        max_execution_environments=123,
        min_execution_environments=123
    ),
    provisioned_concurrency_config=lambda.CfnVersion.ProvisionedConcurrencyConfigurationProperty(
        provisioned_concurrent_executions=123
    ),
    runtime_policy=lambda.CfnVersion.RuntimePolicyProperty(
        update_runtime_on="updateRuntimeOn",

        # the properties below are optional
        runtime_version_arn="runtimeVersionArn"
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;

CfnVersionProps cfnVersionProps = CfnVersionProps.builder()
        .functionName("functionName")

        // the properties below are optional
        .codeSha256("codeSha256")
        .description("description")
        .functionScalingConfig(FunctionScalingConfigProperty.builder()
                .maxExecutionEnvironments(123)
                .minExecutionEnvironments(123)
                .build())
        .provisionedConcurrencyConfig(ProvisionedConcurrencyConfigurationProperty.builder()
                .provisionedConcurrentExecutions(123)
                .build())
        .runtimePolicy(RuntimePolicyProperty.builder()
                .updateRuntimeOn("updateRuntimeOn")

                // the properties below are optional
                .runtimeVersionArn("runtimeVersionArn")
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;

var cfnVersionProps = new CfnVersionProps {
    FunctionName = "functionName",

    // the properties below are optional
    CodeSha256 = "codeSha256",
    Description = "description",
    FunctionScalingConfig = new FunctionScalingConfigProperty {
        MaxExecutionEnvironments = 123,
        MinExecutionEnvironments = 123
    },
    ProvisionedConcurrencyConfig = new ProvisionedConcurrencyConfigurationProperty {
        ProvisionedConcurrentExecutions = 123
    },
    RuntimePolicy = new RuntimePolicyProperty {
        UpdateRuntimeOn = "updateRuntimeOn",

        // the properties below are optional
        RuntimeVersionArn = "runtimeVersionArn"
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnVersionProps := &CfnVersionProps{
	FunctionName: jsii.String("functionName"),

	// the properties below are optional
	CodeSha256: jsii.String("codeSha256"),
	Description: jsii.String("description"),
	FunctionScalingConfig: &FunctionScalingConfigProperty{
		MaxExecutionEnvironments: jsii.Number(123),
		MinExecutionEnvironments: jsii.Number(123),
	},
	ProvisionedConcurrencyConfig: &ProvisionedConcurrencyConfigurationProperty{
		ProvisionedConcurrentExecutions: jsii.Number(123),
	},
	RuntimePolicy: &RuntimePolicyProperty{
		UpdateRuntimeOn: jsii.String("updateRuntimeOn"),

		// the properties below are optional
		RuntimeVersionArn: jsii.String("runtimeVersionArn"),
	},
}
```

## Properties

- `codeSha256`: string — Only publish a version if the hash value matches the value that's specified.

  Use this option to avoid publishing a version if the function code has changed since you last updated it. Updates are not supported for this property.

- `description`: string — A description for the version to override the description in the function configuration.

  Updates are not supported for this property.

- `functionName`: string | [IFunctionRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_lambda.IFunctionRef.html) (required) — The name or ARN of the Lambda function.

  **Name formats** - *Function name* - `MyFunction` .
  - *Function ARN* - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction` .
  - *Partial ARN* - `123456789012:function:MyFunction` .

  The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

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

- `provisionedConcurrencyConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVersion.ProvisionedConcurrencyConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnVersion.ProvisionedConcurrencyConfigurationProperty.html) — Specifies a provisioned concurrency configuration for a function's version.

  Updates are not supported for this property.

- `runtimePolicy`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVersion.RuntimePolicyProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.CfnVersion.RuntimePolicyProperty.html) — Runtime Management Config of a function.
