layer_version_permissions
Creates, updates, deletes or gets a layer_version_permission resource or lists layer_version_permissions in a region
Overview
| Name | layer_version_permissions |
| Type | Resource |
| Description | Schema for Lambda LayerVersionPermission |
| Id | awscc.lambda.layer_version_permissions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | ID generated by service |
action | string | The API action that grants access to the layer. |
layer_version_arn | string | The name or Amazon Resource Name (ARN) of the layer. |
organization_id | string | With the principal set to *, grant permission to all accounts in the specified organization. |
principal | string | An account ID, or * to grant layer usage permission to all accounts in an organization, or all AWS accounts (if organizationId is not specified). |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | ID generated by service |
region | string | AWS region. |
For more information, see AWS::Lambda::LayerVersionPermission.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | layer_version_permissions | INSERT | LayerVersionArn, Action, Principal, region |
delete_resource | layer_version_permissions | DELETE | Identifier, region |
list_resources | layer_version_permissions_list_only | SELECT | region |
get_resource | layer_version_permissions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual layer_version_permission.
SELECT
region,
id,
action,
layer_version_arn,
organization_id,
principal
FROM awscc.lambda.layer_version_permissions
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all layer_version_permissions in a region.
SELECT
region,
id
FROM awscc.lambda.layer_version_permissions_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new layer_version_permission resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lambda.layer_version_permissions (
Action,
LayerVersionArn,
Principal,
region
)
SELECT
'{{ action }}',
'{{ layer_version_arn }}',
'{{ principal }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.lambda.layer_version_permissions (
Action,
LayerVersionArn,
OrganizationId,
Principal,
region
)
SELECT
'{{ action }}',
'{{ layer_version_arn }}',
'{{ organization_id }}',
'{{ principal }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: layer_version_permission
props:
- name: action
value: '{{ action }}'
- name: layer_version_arn
value: '{{ layer_version_arn }}'
- name: organization_id
value: '{{ organization_id }}'
- name: principal
value: '{{ principal }}'
DELETE example
/*+ delete */
DELETE FROM awscc.lambda.layer_version_permissions
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the layer_version_permissions resource, the following permissions are required:
- Create
- Read
- Delete
- List
lambda:AddLayerVersionPermission
lambda:GetLayerVersionPolicy
lambda:GetLayerVersionPolicy,
lambda:RemoveLayerVersionPermission
lambda:GetLayerVersionPolicy