:doc:`CostExplorer <../../ce>` / Client / list_cost_allocation_tags

*************************
list_cost_allocation_tags
*************************



.. py:method:: CostExplorer.Client.list_cost_allocation_tags(**kwargs)

  

  Get a list of cost allocation tags. All inputs in the API are optional and serve as filters. By default, all cost allocation tags are returned.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/ListCostAllocationTags>`_  


  **Request Syntax**
  ::

    response = client.list_cost_allocation_tags(
        Status='Active'|'Inactive',
        TagKeys=[
            'string',
        ],
        Type='AWSGenerated'|'UserDefined',
        NextToken='string',
        MaxResults=123
    )
    
  :type Status: string
  :param Status: 

    The status of cost allocation tag keys that are returned for this request.

    

  
  :type TagKeys: list
  :param TagKeys: 

    The list of cost allocation tag keys that are returned for this request.

    

  
    - *(string) --* 

    

  :type Type: string
  :param Type: 

    The type of ``CostAllocationTag`` object that are returned for this request. The ``AWSGenerated`` type tags are tags that Amazon Web Services defines and applies to support Amazon Web Services resources for cost allocation purposes. The ``UserDefined`` type tags are tags that you define, create, and apply to resources.

    

  
  :type NextToken: string
  :param NextToken: 

    The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of objects that are returned for this request. By default, the request returns 100 results.

    

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

    
    ::

      {
          'CostAllocationTags': [
              {
                  'TagKey': 'string',
                  'Type': 'AWSGenerated'|'UserDefined',
                  'Status': 'Active'|'Inactive',
                  'LastUpdatedDate': 'string',
                  'LastUsedDate': 'string'
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **CostAllocationTags** *(list) --* 

        A list of cost allocation tags that includes the detailed metadata for each one.

        
        

        - *(dict) --* 

          The cost allocation tag structure. This includes detailed metadata for the ``CostAllocationTag`` object.

          
          

          - **TagKey** *(string) --* 

            The key for the cost allocation tag.

            
          

          - **Type** *(string) --* 

            The type of cost allocation tag. You can use ``AWSGenerated`` or ``UserDefined`` type tags. ``AWSGenerated`` type tags are tags that Amazon Web Services defines and applies to support Amazon Web Services resources for cost allocation purposes. ``UserDefined`` type tags are tags that you define, create, and apply to resources.

            
          

          - **Status** *(string) --* 

            The status of a cost allocation tag.

            
          

          - **LastUpdatedDate** *(string) --* 

            The last date that the tag was either activated or deactivated.

            
          

          - **LastUsedDate** *(string) --* 

            The last month that the tag was used on an Amazon Web Services resource.

            
      
    
      

      - **NextToken** *(string) --* 

        The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

        
  
  **Exceptions**
  
  *   :py:class:`CostExplorer.Client.exceptions.LimitExceededException`

  
  *   :py:class:`CostExplorer.Client.exceptions.InvalidNextTokenException`

  