layer_versions
Creates, updates, deletes or gets a layer_version
resource or lists layer_versions
in a region
Overview
Name | layer_versions |
Type | Resource |
Description | Resource Type definition for AWS::Lambda::LayerVersion |
Id | aws.lambda.layer_versions |
Fields
Name | Datatype | Description |
---|---|---|
compatible_runtimes | array | A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions. |
license_info | string | The layer's software license. |
description | string | The description of the version. |
layer_name | string | The name or Amazon Resource Name (ARN) of the layer. |
content | object | The function layer archive. |
layer_version_arn | string | |
compatible_architectures | array | A list of compatible instruction set architectures. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Content, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.lambda.layer_versions (
Content,
region
)
SELECT
'{{ Content }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.lambda.layer_versions (
CompatibleRuntimes,
LicenseInfo,
Description,
LayerName,
Content,
CompatibleArchitectures,
region
)
SELECT
'{{ CompatibleRuntimes }}',
'{{ LicenseInfo }}',
'{{ Description }}',
'{{ LayerName }}',
'{{ Content }}',
'{{ CompatibleArchitectures }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: layer_version
props:
- name: CompatibleRuntimes
value:
- '{{ CompatibleRuntimes[0] }}'
- name: LicenseInfo
value: '{{ LicenseInfo }}'
- name: Description
value: '{{ Description }}'
- name: LayerName
value: '{{ LayerName }}'
- name: Content
value:
S3ObjectVersion: '{{ S3ObjectVersion }}'
S3Bucket: '{{ S3Bucket }}'
S3Key: '{{ S3Key }}'
- name: CompatibleArchitectures
value:
- '{{ CompatibleArchitectures[0] }}'
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