tags
Creates, updates, deletes or gets a tag resource or lists tags in a region
Overview
| Name | tags |
| Type | Resource |
| Description | A resource schema representing a Lake Formation Tag. |
| Id | awscc.lakeformation.tags |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
catalog_id | string | The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment. |
tag_key | string | The key-name for the LF-tag. |
tag_values | array | A list of possible values an attribute can take. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
tag_key | string | The key-name for the LF-tag. |
region | string | AWS region. |
For more information, see AWS::LakeFormation::Tag.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | tags | INSERT | TagKey, TagValues, region |
delete_resource | tags | DELETE | Identifier, region |
update_resource | tags | UPDATE | Identifier, PatchDocument, region |
list_resources | tags_list_only | SELECT | region |
get_resource | tags | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual tag.
SELECT
region,
catalog_id,
tag_key,
tag_values
FROM awscc.lakeformation.tags
WHERE
region = '{{ region }}' AND
Identifier = '{{ tag_key }}';
Lists all tags in a region.
SELECT
region,
tag_key
FROM awscc.lakeformation.tags_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new tag resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lakeformation.tags (
TagKey,
TagValues,
region
)
SELECT
'{{ tag_key }}',
'{{ tag_values }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.lakeformation.tags (
CatalogId,
TagKey,
TagValues,
region
)
SELECT
'{{ catalog_id }}',
'{{ tag_key }}',
'{{ tag_values }}',
'{{ 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: tag
props:
- name: catalog_id
value: '{{ catalog_id }}'
- name: tag_key
value: '{{ tag_key }}'
- name: tag_values
value:
- '{{ tag_values[0] }}'
UPDATE example
Use the following StackQL query and manifest file to update a tag resource, using stack-deploy.
/*+ update */
UPDATE awscc.lakeformation.tags
SET PatchDocument = string('{{ {
"TagValues": tag_values
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ tag_key }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.lakeformation.tags
WHERE
Identifier = '{{ tag_key }}' 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 tags resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
lakeformation:CreateLFTag,
lakeformation:GetLFTag
lakeformation:GetLFTag
lakeformation:UpdateLFTag,
lakeformation:GetLFTag
lakeformation:DeleteLFTag
lakeformation:ListLFTags