layers
Creates, updates, deletes, gets or lists a layers resource.
Overview
| Name | layers |
| Type | Resource |
| Id | aws.lambda.layers |
Fields
The following fields are returned by SELECT queries:
- list_layers
| Name | Datatype | Description |
|---|---|---|
latest_matching_version | object | Details about a version of an Lambda layer. |
layer_arn | string | The 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_name | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_layers | select | region | CompatibleArchitecture, CompatibleRuntime, Marker, MaxItems | 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. |
publish_layer_version | exec | layer_name, region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
layer_name | string | The name or Amazon Resource Name (ARN) of the layer. |
region | string | AWS region (default: us-east-1) |
CompatibleArchitecture | string | The compatible instruction set architecture. |
CompatibleRuntime | string | A 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. |
Marker | string | A pagination token returned by a previous call. |
MaxItems | integer | The maximum number of layers to return. |
SELECT examples
- list_layers
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
- publish_layer_version
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 }}"
}'
;