Skip to main content

layer_versions

Creates, updates, deletes or gets a layer_version resource or lists layer_versions in a region

Overview

Namelayer_versions
TypeResource
DescriptionResource Type definition for AWS::Lambda::LayerVersion
Idaws.lambda.layer_versions

Fields

NameDatatypeDescription
compatible_runtimesarrayA list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.
license_infostringThe layer's software license.
descriptionstringThe description of the version.
layer_namestringThe name or Amazon Resource Name (ARN) of the layer.
contentobjectThe function layer archive.
layer_version_arnstring
compatible_architecturesarrayA list of compatible instruction set architectures.
regionstringAWS region.

Methods

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

SELECT examples

Gets all layer_versions in a region.

SELECT
region,
compatible_runtimes,
license_info,
description,
layer_name,
content,
layer_version_arn,
compatible_architectures
FROM aws.lambda.layer_versions
WHERE region = 'us-east-1';

Gets all properties from an individual layer_version.

SELECT
region,
compatible_runtimes,
license_info,
description,
layer_name,
content,
layer_version_arn,
compatible_architectures
FROM aws.lambda.layer_versions
WHERE region = 'us-east-1' AND data__Identifier = '<LayerVersionArn>';

INSERT example

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

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

DELETE example

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

Permissions

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

Create

lambda:PublishLayerVersion,
s3:GetObject,
s3:GetObjectVersion

Read

lambda:GetLayerVersion

Delete

lambda:GetLayerVersion,
lambda:DeleteLayerVersion

List

lambda:ListLayerVersions