LakeFormation / Client / search_databases_by_lf_tags

search_databases_by_lf_tags#

LakeFormation.Client.search_databases_by_lf_tags(**kwargs)#

This operation allows a search on DATABASE resources by TagCondition. This operation is used by admins who want to grant user permissions on certain TagConditions. Before making a grant, the admin can use SearchDatabasesByTags to find all resources where the given TagConditions are valid to verify whether the returned resources can be shared.

See also: AWS API Documentation

Request Syntax

response = client.search_databases_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 database 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',
    'DatabaseList': [
        {
            'Database': {
                'CatalogId': 'string',
                '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.

    • DatabaseList (list) –

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

      • (dict) –

        A structure describing a database resource with LF-tags.

        • Database (dict) –

          A database 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.

          • Name (string) –

            The name of the database resource. Unique to the Data Catalog.

        • LFTags (list) –

          A list of LF-tags attached to the database.

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