LakeFormation / Client / search_tables_by_lf_tags

search_tables_by_lf_tags#

LakeFormation.Client.search_tables_by_lf_tags(**kwargs)#

This operation allows a search on TABLE resources by LFTag``s. This will be used by admins who want to grant user permissions on certain LF-tags. Before making a grant, the admin can use ``SearchTablesByLFTags to find all resources where the given ``LFTag``s are valid to verify whether the returned resources can be shared.

See also: AWS API Documentation

Request Syntax

response = client.search_tables_by_lf_tags(
    NextToken='string',
    MaxResults=123,
    CatalogId='string',
    Expression=[
        {
            'TagKey': 'string',
            'TagValues': [
                'string',
            ]
        },
    ]
)
Parameters:
  • NextToken (string) – A continuation token, if this is not the first call to retrieve this list.

  • MaxResults (integer) – The maximum number of results to return.

  • 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 conditions ( LFTag structures) to search for in table resources.

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

{
    'NextToken': 'string',
    'TableList': [
        {
            'Table': {
                'CatalogId': 'string',
                'DatabaseName': 'string',
                'Name': 'string',
                'TableWildcard': {}
            },
            'LFTagOnDatabase': [
                {
                    'CatalogId': 'string',
                    'TagKey': 'string',
                    'TagValues': [
                        'string',
                    ]
                },
            ],
            'LFTagsOnTable': [
                {
                    'CatalogId': 'string',
                    'TagKey': 'string',
                    'TagValues': [
                        'string',
                    ]
                },
            ],
            'LFTagsOnColumns': [
                {
                    'Name': 'string',
                    'LFTags': [
                        {
                            'CatalogId': 'string',
                            'TagKey': 'string',
                            'TagValues': [
                                'string',
                            ]
                        },
                    ]
                },
            ]
        },
    ]
}

Response Structure

  • (dict) –

    • NextToken (string) –

      A continuation token, present if the current list segment is not the last. On the first run, if you include a not null (a value) token you can get empty pages.

    • TableList (list) –

      A list of tables that meet the LF-tag conditions.

      • (dict) –

        A structure describing a table resource with LF-tags.

        • Table (dict) –

          A table that has LF-tags attached to it.

          • CatalogId (string) –

            The identifier for the Data Catalog. By default, it is the account ID of the caller.

          • DatabaseName (string) –

            The name of the database for the table. Unique to a Data Catalog. A database is a set of associated table definitions organized into a logical group. You can Grant and Revoke database privileges to a principal.

          • Name (string) –

            The name of the table.

          • TableWildcard (dict) –

            A wildcard object representing every table under a database.

            At least one of TableResource$Name or TableResource$TableWildcard is required.

        • LFTagOnDatabase (list) –

          A list of LF-tags attached to the database where the table resides.

          • (dict) –

            A structure containing an LF-tag key-value pair.

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

            • TagKey (string) –

              The key-name for the LF-tag.

            • TagValues (list) –

              A list of possible values an attribute can take.

              • (string) –

        • LFTagsOnTable (list) –

          A list of LF-tags attached to the table.

          • (dict) –

            A structure containing an LF-tag key-value pair.

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

            • TagKey (string) –

              The key-name for the LF-tag.

            • TagValues (list) –

              A list of possible values an attribute can take.

              • (string) –

        • LFTagsOnColumns (list) –

          A list of LF-tags attached to columns in the table.

          • (dict) –

            A structure containing the name of a column resource and the LF-tags attached to it.

            • Name (string) –

              The name of a column resource.

            • LFTags (list) –

              The LF-tags attached to a column resource.

              • (dict) –

                A structure containing an LF-tag key-value pair.

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

                • TagKey (string) –

                  The key-name for the LF-tag.

                • TagValues (list) –

                  A list of possible values an attribute can take.

                  • (string) –

Exceptions

  • LakeFormation.Client.exceptions.EntityNotFoundException

  • LakeFormation.Client.exceptions.InternalServiceException

  • LakeFormation.Client.exceptions.InvalidInputException

  • LakeFormation.Client.exceptions.OperationTimeoutException

  • LakeFormation.Client.exceptions.GlueEncryptionException

  • LakeFormation.Client.exceptions.AccessDeniedException