Skip to main content

layers

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

Overview

Namelayers
TypeResource
Idaws.lambda.layers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
latest_matching_versionobjectDetails about a version of an Lambda layer.
layer_arnstringThe Amazon Resource Name (ARN) of the function 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_namestringThe name 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-]+)|[a-zA-Z0-9-]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_layersselectregionCompatibleArchitecture, CompatibleRuntime, Marker, MaxItemsLists Lambda layers and shows information about the latest version of each. Specify a runtime identifier to list only layers that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layers that are compatible with that instruction set architecture.
publish_layer_versionexeclayer_name, regionCreates an Lambda layer from a ZIP archive. Each time you call PublishLayerVersion with the same layer name, a new version is created. Add layers to your function with CreateFunction or UpdateFunctionConfiguration.

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)
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 layers to return.

SELECT examples

Lists Lambda layers and shows information about the latest version of each. Specify a runtime identifier to list only layers that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layers that are compatible with that instruction set architecture.

SELECT
latest_matching_version,
layer_arn,
layer_name
FROM aws.lambda.layers
WHERE region = '{{ region }}' -- required
AND CompatibleArchitecture = '{{ CompatibleArchitecture }}'
AND CompatibleRuntime = '{{ CompatibleRuntime }}'
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;

Lifecycle Methods

Creates an Lambda layer from a ZIP archive. Each time you call PublishLayerVersion with the same layer name, a new version is created. Add layers to your function with CreateFunction or UpdateFunctionConfiguration.

EXEC aws.lambda.layers.publish_layer_version
@layer_name='{{ layer_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Description": "{{ Description }}",
"Content": "{{ Content }}",
"CompatibleArchitectures": "{{ CompatibleArchitectures }}",
"CompatibleRuntimes": "{{ CompatibleRuntimes }}",
"LicenseInfo": "{{ LicenseInfo }}"
}'
;