LakeFormation / Client / create_lf_tag_expression

create_lf_tag_expression#

LakeFormation.Client.create_lf_tag_expression(**kwargs)#

Creates a new LF-Tag expression with the provided name, description, catalog ID, and expression body. This call fails if a LF-Tag expression with the same name already exists in the caller’s account or if the underlying LF-Tags don’t exist. To call this API operation, caller needs the following Lake Formation permissions:

CREATE_LF_TAG_EXPRESSION on the root catalog resource.

GRANT_WITH_LF_TAG_EXPRESSION on all underlying LF-Tag key:value pairs included in the expression.

See also: AWS API Documentation

Request Syntax

response = client.create_lf_tag_expression(
    Name='string',
    Description='string',
    CatalogId='string',
    Expression=[
        {
            'TagKey': 'string',
            'TagValues': [
                'string',
            ]
        },
    ]
)
Parameters:
  • Name (string) –

    [REQUIRED]

    A name for the expression.

  • Description (string) – A description with information about the LF-Tag expression.

  • CatalogId (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.

  • Expression (list) –

    [REQUIRED]

    A list of LF-Tag conditions (key-value pairs).

    • (dict) –

      A structure that allows an admin to grant user permissions on certain conditions. For example, granting a role access to all columns that do not have the LF-tag ‘PII’ in tables that have the LF-tag ‘Prod’.

      • TagKey (string) – [REQUIRED]

        The key-name for the LF-tag.

      • TagValues (list) – [REQUIRED]

        A list of possible values an attribute can take.

        The maximum number of values that can be defined for a LF-Tag is 1000. A single API call supports 50 values. You can use multiple API calls to add more values.

        • (string) –

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions

  • LakeFormation.Client.exceptions.InvalidInputException

  • LakeFormation.Client.exceptions.ResourceNumberLimitExceededException

  • LakeFormation.Client.exceptions.InternalServiceException

  • LakeFormation.Client.exceptions.OperationTimeoutException

  • LakeFormation.Client.exceptions.AccessDeniedException

  • LakeFormation.Client.exceptions.EntityNotFoundException