:doc:`LakeFormation <../../lakeformation>` / Client / create_lf_tag_expression

************************
create_lf_tag_expression
************************



.. py:method:: 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 <https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/CreateLFTagExpression>`_  


  **Request Syntax**
  ::

    response = client.create_lf_tag_expression(
        Name='string',
        Description='string',
        CatalogId='string',
        Expression=[
            {
                'TagKey': 'string',
                'TagValues': [
                    'string',
                ]
            },
        ]
    )
    
  :type Name: string
  :param Name: **[REQUIRED]** 

    A name for the expression.

    

  
  :type Description: string
  :param Description: 

    A description with information about the LF-Tag expression.

    

  
  :type CatalogId: string
  :param CatalogId: 

    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.

    

  
  :type Expression: list
  :param Expression: **[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) --* 

        
    
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`LakeFormation.Client.exceptions.InvalidInputException`

  
  *   :py:class:`LakeFormation.Client.exceptions.ResourceNumberLimitExceededException`

  
  *   :py:class:`LakeFormation.Client.exceptions.InternalServiceException`

  
  *   :py:class:`LakeFormation.Client.exceptions.OperationTimeoutException`

  
  *   :py:class:`LakeFormation.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`LakeFormation.Client.exceptions.EntityNotFoundException`

  