Skip to content
v2.276.0

CfnVersionProps Struct ​

Properties for defining a CfnVersion.

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 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
# 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
// 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();
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"
    }
};
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 ​

codeSha256optionalstringcode_sha256optionalstrcodeSha256optionalStringCodeSha256optionalstringCodeSha256optional*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.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
A description for the version to override the description in the function configuration.

Updates are not supported for this property.

functionNamestring | IFunctionReffunction_nametyping.Union[str, IFunctionRef]functionNameStringFunctionNamestringFunctionNameinterface{}required#
The name or ARN of the Lambda function.
notes

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.

functionScalingConfigoptionalIResolvable | CfnVersion.FunctionScalingConfigPropertyfunction_scaling_configoptionaltyping.Union[IResolvable, FunctionScalingConfigProperty]functionScalingConfigoptionalIResolvableFunctionScalingConfigoptionalIResolvableFunctionScalingConfigoptionalinterface{}#
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.
provisionedConcurrencyConfigoptionalIResolvable | CfnVersion.ProvisionedConcurrencyConfigurationPropertyprovisioned_concurrency_configoptionaltyping.Union[IResolvable, ProvisionedConcurrencyConfigurationProperty]provisionedConcurrencyConfigoptionalIResolvableProvisionedConcurrencyConfigoptionalIResolvableProvisionedConcurrencyConfigoptionalinterface{}#
Specifies a provisioned concurrency configuration for a function's version.

Updates are not supported for this property.

runtimePolicyoptionalIResolvable | CfnVersion.RuntimePolicyPropertyruntime_policyoptionaltyping.Union[IResolvable, RuntimePolicyProperty]runtimePolicyoptionalIResolvableRuntimePolicyoptionalIResolvableRuntimePolicyoptionalinterface{}#
Runtime Management Config of a function.