Skip to main content

lf_tags

Creates, updates, deletes, gets or lists a lf_tags resource.

Overview

Namelf_tags
TypeResource
Idaws.lakeformation.lf_tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
catalog_idstringThe 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. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>)
tag_keystringThe key-name for the LF-tag. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@%]*)$</code>)
tag_valuesarrayA list of possible values an attribute can take.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_lf_tagselectregionReturns an LF-tag definition.
list_lf_tagsselectregionLists LF-tags that the requester has permission to view.
create_lf_taginsertregion, TagKey, TagValuesCreates an LF-tag with the specified name and values.
update_lf_tagupdateregion, TagKeyUpdates the list of possible values for the specified LF-tag key. If the LF-tag does not exist, the operation throws an EntityNotFoundException. The values in the delete key values will be deleted from list of possible values. If any value in the delete key values is attached to a resource, then API errors out with a 400 Exception - "Update not allowed". Untag the attribute before deleting the LF-tag key's value.
delete_lf_tagdeleteregionDeletes an LF-tag by its key name. The operation fails if the specified tag key doesn't exist. When you delete an LF-Tag: The associated LF-Tag policy becomes invalid. Resources that had this tag assigned will no longer have the tag policy applied to them.

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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns an LF-tag definition.

SELECT
catalog_id,
tag_key,
tag_values
FROM aws.lakeformation.lf_tags
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an LF-tag with the specified name and values.

INSERT INTO aws.lakeformation.lf_tags (
CatalogId,
TagKey,
TagValues,
region
)
SELECT
'{{ CatalogId }}',
'{{ TagKey }}' /* required */,
'{{ TagValues }}' /* required */,
'{{ region }}'
;

UPDATE examples

Updates the list of possible values for the specified LF-tag key. If the LF-tag does not exist, the operation throws an EntityNotFoundException. The values in the delete key values will be deleted from list of possible values. If any value in the delete key values is attached to a resource, then API errors out with a 400 Exception - "Update not allowed". Untag the attribute before deleting the LF-tag key's value.

UPDATE aws.lakeformation.lf_tags
SET
CatalogId = '{{ CatalogId }}',
TagKey = '{{ TagKey }}',
TagValuesToDelete = '{{ TagValuesToDelete }}',
TagValuesToAdd = '{{ TagValuesToAdd }}'
WHERE
region = '{{ region }}' --required
AND TagKey = '{{ TagKey }}' --required;

DELETE examples

Deletes an LF-tag by its key name. The operation fails if the specified tag key doesn't exist. When you delete an LF-Tag: The associated LF-Tag policy becomes invalid. Resources that had this tag assigned will no longer have the tag policy applied to them.

DELETE FROM aws.lakeformation.lf_tags
WHERE region = '{{ region }}' --required
;