AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::Lambda::Version

CfnVersion

The `AWS::Lambda::Version` resource creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) 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.

Import

import { CfnVersion } from 'aws-cdk-lib/aws-lambda';

Or use the module namespace:

import * as lambda from 'aws-cdk-lib/aws-lambda';
// lambda.CfnVersion

Properties

Configuration passed to the constructor as CfnVersionProps.

functionNameRequired
string | IFunctionRef

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.

codeSha256Optional
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.

descriptionOptional
string

A description for the version to override the description in the function configuration. Updates are not supported for this property.

functionScalingConfigOptional
IResolvable | FunctionScalingConfigProperty

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.

provisionedConcurrencyConfigOptional
IResolvable | ProvisionedConcurrencyConfigurationProperty

Specifies a provisioned concurrency configuration for a function's version. Updates are not supported for this property.

runtimePolicyOptional
IResolvable | RuntimePolicyProperty

Runtime Management Config of a function.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the AWS Lambda Cheat Sheet

Everything you need to know about AWS Lambda on one page. HD quality, print-friendly.

Download Free Infographic