Skip to main content

versions

Creates, updates, deletes or gets a version resource or lists versions in a region

Overview

Nameversions
TypeResource
DescriptionResource Type definition for AWS::Lambda::Version
Idaws.lambda.versions

Fields

NameDatatypeDescription
function_arnstringThe ARN of the version.
versionstringThe version number.
code_sha256stringOnly 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.
descriptionstringA description for the version to override the description in the function configuration. Updates are not supported for this property.
function_namestringThe name of the Lambda function.
policyobjectThe resource policy of your function
provisioned_concurrency_configobjectSpecifies a provisioned concurrency configuration for a function's version. Updates are not supported for this property.
runtime_policyobjectSpecifies the runtime management configuration of a function. Displays runtimeVersionArn only for Manual.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTFunctionName, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all versions in a region.

SELECT
region,
function_arn,
version,
code_sha256,
description,
function_name,
policy,
provisioned_concurrency_config,
runtime_policy
FROM aws.lambda.versions
WHERE region = 'us-east-1';

Gets all properties from an individual version.

SELECT
region,
function_arn,
version,
code_sha256,
description,
function_name,
policy,
provisioned_concurrency_config,
runtime_policy
FROM aws.lambda.versions
WHERE region = 'us-east-1' AND data__Identifier = '<FunctionArn>';

INSERT example

Use the following StackQL query and manifest file to create a new version resource, using stack-deploy.

/*+ create */
INSERT INTO aws.lambda.versions (
FunctionName,
region
)
SELECT
'{{ FunctionName }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.lambda.versions
WHERE data__Identifier = '<FunctionArn>'
AND region = 'us-east-1';

Permissions

To operate on the versions resource, the following permissions are required:

Create

lambda:PublishVersion,
lambda:GetFunctionConfiguration,
lambda:PutProvisionedConcurrencyConfig,
lambda:GetProvisionedConcurrencyConfig,
lambda:PutRuntimeManagementConfig,
lambda:GetRuntimeManagementConfig

Read

lambda:GetFunctionConfiguration,
lambda:GetProvisionedConcurrencyConfig,
lambda:GetRuntimeManagementConfig

Delete

lambda:GetFunctionConfiguration,
lambda:DeleteFunction

List

lambda:ListVersionsByFunction