Skip to main content

layer_versions

Creates, updates, deletes, gets or lists a layer_versions resource.

Overview

Namelayer_versions
TypeResource
Idaws.lambda.layer_versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
compatible_architecturesarrayA list of compatible instruction set architectures.
compatible_runtimesarrayThe layer's compatible runtimes. The following list includes deprecated runtimes. For more information, see Runtime use after deprecation. For a list of all currently supported runtimes, see Supported runtimes.
contentobjectDetails about the layer version.
created_datestringThe date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD). (pattern: <code>.*</code>)
descriptionstringThe description of the version.
layer_arnstringThe ARN of the layer. (pattern: <code>arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:layer:[a-zA-Z0-9-_]+</code>)
layer_version_arnstringThe ARN of the layer version. (pattern: <code>((arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:layer:[a-zA-Z0-9-]+:[0-9]+)|(arn:[a-zA-Z0-9-]+:lambda:::awslayer:[a-zA-Z0-9-]+))</code>)
license_infostringThe layer's software license. (pattern: <code>.*</code>)
versioninteger (int64)The version number.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_layer_versionselectlayer_name, version_number, regionReturns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
list_layer_versionsselectlayer_name, regionCompatibleArchitecture, CompatibleRuntime, Marker, MaxItemsLists the versions of an Lambda layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.
add_layer_version_permissionupdatelayer_name, version_number, region, StatementId, Action, PrincipalRevisionIdAdds permissions to the resource-based policy of a version of an Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all accounts in an organization, or all Amazon Web Services accounts. To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you added it.
remove_layer_version_permissionupdatelayer_name, version_number, statement_id, regionRevisionIdRemoves a statement from the permissions policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.
delete_layer_versiondeletelayer_name, version_number, regionDeletes a version of an Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
layer_namestringThe name or Amazon Resource Name (ARN) of the layer.
regionstringAWS region (default: us-east-1)
statement_idstringThe identifier that was specified when the statement was added.
version_numberinteger (int64)The version number.
CompatibleArchitecturestringThe compatible instruction set architecture.
CompatibleRuntimestringA runtime identifier. The following list includes deprecated runtimes. For more information, see Runtime use after deprecation. For a list of all currently supported runtimes, see Supported runtimes.
MarkerstringA pagination token returned by a previous call.
MaxItemsintegerThe maximum number of versions to return.
RevisionIdstringOnly update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.

SELECT examples

Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.

SELECT
compatible_architectures,
compatible_runtimes,
content,
created_date,
description,
layer_arn,
layer_version_arn,
license_info,
version
FROM aws.lambda.layer_versions
WHERE layer_name = '{{ layer_name }}' -- required
AND version_number = '{{ version_number }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Adds permissions to the resource-based policy of a version of an Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all accounts in an organization, or all Amazon Web Services accounts. To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you added it.

UPDATE aws.lambda.layer_versions
SET
StatementId = '{{ StatementId }}',
Action = '{{ Action }}',
Principal = '{{ Principal }}',
OrganizationId = '{{ OrganizationId }}'
WHERE
layer_name = '{{ layer_name }}' --required
AND version_number = '{{ version_number }}' --required
AND region = '{{ region }}' --required
AND StatementId = '{{ StatementId }}' --required
AND Action = '{{ Action }}' --required
AND Principal = '{{ Principal }}' --required
AND RevisionId = '{{ RevisionId}}'
RETURNING
revision_id,
statement;

DELETE examples

Deletes a version of an Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it.

DELETE FROM aws.lambda.layer_versions
WHERE layer_name = '{{ layer_name }}' --required
AND version_number = '{{ version_number }}' --required
AND region = '{{ region }}' --required
;