tag_associations
Creates, updates, deletes or gets a tag_association resource or lists tag_associations in a region
Overview
| Name | tag_associations |
| Type | Resource |
| Description | A resource schema representing a Lake Formation Tag Association. While tag associations are not explicit Lake Formation resources, this CloudFormation resource can be used to associate tags with Lake Formation entities. |
| Id | awscc.lakeformation.tag_associations |
Fields
| Name | Datatype | Description |
|---|---|---|
resource | object | Resource to tag with the Lake Formation Tags |
lf_tags | array | List of Lake Formation Tags to associate with the Lake Formation Resource |
resource_identifier | string | Unique string identifying the resource. Used as primary identifier, which ideally should be a string |
tags_identifier | string | Unique string identifying the resource's tags. Used as primary identifier, which ideally should be a string |
region | string | AWS region. |
For more information, see AWS::LakeFormation::TagAssociation.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | Resource, LFTags, region |
delete_resource | DELETE | Identifier, region |
get_resource | SELECT | Identifier, region |
SELECT examples
Gets all properties from an individual tag_association.
SELECT
region,
resource,
lf_tags,
resource_identifier,
tags_identifier
FROM awscc.lakeformation.tag_associations
WHERE
region = '{{ region }}' AND
Identifier = '{{ resource_identifier }}|{{ tags_identifier }}';
INSERT example
Use the following StackQL query and manifest file to create a new tag_association resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lakeformation.tag_associations (
Resource,
LFTags,
region
)
SELECT
'{{ resource }}',
'{{ lf_tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.lakeformation.tag_associations (
Resource,
LFTags,
region
)
SELECT
'{{ resource }}',
'{{ lf_tags }}',
'{{ 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_association
props:
- name: resource
value:
catalog: {}
database:
catalog_id: '{{ catalog_id }}'
name: '{{ name }}'
table:
catalog_id: null
database_name: null
name: null
table_wildcard: {}
table_with_columns:
catalog_id: null
database_name: null
name: null
column_names:
- null
- name: lf_tags
value:
- catalog_id: null
tag_key: '{{ tag_key }}'
tag_values:
- '{{ tag_values[0] }}'
DELETE example
/*+ delete */
DELETE FROM awscc.lakeformation.tag_associations
WHERE
Identifier = '{{ resource_identifier }}|{{ tags_identifier }}' 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 tag_associations resource, the following permissions are required:
- Create
- Read
- Delete
lakeformation:AddLFTagsToResource,
glue:GetDatabase,
glue:GetTable
lakeformation:GetResourceLFTags,
glue:GetDatabase,
glue:GetTable
lakeformation:RemoveLFTagsFromResource,
glue:GetDatabase,
glue:GetTable