layer_versions
Creates, updates, deletes, gets or lists a layer_versions resource.
Overview
| Name | layer_versions |
| Type | Resource |
| Id | aws.lambda.layer_versions |
Fields
The following fields are returned by SELECT queries:
- get_layer_version
- list_layer_versions
| Name | Datatype | Description |
|---|---|---|
compatible_architectures | array | A list of compatible instruction set architectures. |
compatible_runtimes | array | The 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. |
content | object | Details about the layer version. |
created_date | string | The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD). (pattern: <code>.*</code>) |
description | string | The description of the version. |
layer_arn | string | The 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_arn | string | The 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_info | string | The layer's software license. (pattern: <code>.*</code>) |
version | integer (int64) | The version number. |
| Name | Datatype | Description |
|---|---|---|
compatible_architectures | array | A list of compatible instruction set architectures. |
compatible_runtimes | array | The 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. |
created_date | string | The date that the version was created, in ISO 8601 format. For example, 2018-11-27T15:10:45.123+0000. (pattern: <code>.*</code>) |
description | string | The description of the version. |
layer_version_arn | string | The 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_info | string | The layer's open-source license. (pattern: <code>.*</code>) |
version | integer (int64) | The version number. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_layer_version | select | layer_name, version_number, region | Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes. | |
list_layer_versions | select | layer_name, region | CompatibleArchitecture, CompatibleRuntime, Marker, MaxItems | Lists 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_permission | update | layer_name, version_number, region, StatementId, Action, Principal | RevisionId | 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. |
remove_layer_version_permission | update | layer_name, version_number, statement_id, region | RevisionId | Removes a statement from the permissions policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission. |
delete_layer_version | delete | layer_name, version_number, region | 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. |
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) |
statement_id | string | The identifier that was specified when the statement was added. |
version_number | integer (int64) | The version number. |
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 versions to return. |
RevisionId | string | Only 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
- get_layer_version
- list_layer_versions
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
;
Lists 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.
SELECT
compatible_architectures,
compatible_runtimes,
created_date,
description,
layer_version_arn,
license_info,
version
FROM aws.lambda.layer_versions
WHERE layer_name = '{{ layer_name }}' -- required
AND region = '{{ region }}' -- required
AND CompatibleArchitecture = '{{ CompatibleArchitecture }}'
AND CompatibleRuntime = '{{ CompatibleRuntime }}'
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;
UPDATE examples
- add_layer_version_permission
- remove_layer_version_permission
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;
Removes a statement from the permissions policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.
UPDATE aws.lambda.layer_versions
SET
-- No updatable properties
WHERE
layer_name = '{{ layer_name }}' --required
AND version_number = '{{ version_number }}' --required
AND statement_id = '{{ statement_id }}' --required
AND region = '{{ region }}' --required
AND RevisionId = '{{ RevisionId}}';
DELETE examples
- delete_layer_version
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
;