CostExplorer / Client / list_cost_allocation_tags

list_cost_allocation_tags#

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

Request Syntax

response = client.list_cost_allocation_tags(
    Status='Active'|'Inactive',
    TagKeys=[
        'string',
    ],
    Type='AWSGenerated'|'UserDefined',
    NextToken='string',
    MaxResults=123
)
Parameters:
  • Status (string) – The status of cost allocation tag keys that are returned for this request.

  • TagKeys (list) –

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

    • (string) –

  • Type (string) – 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.

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

  • MaxResults (integer) – The maximum number of objects that are returned for this request. By default, the request returns 100 results.

Return type:

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

  • CostExplorer.Client.exceptions.LimitExceededException

  • CostExplorer.Client.exceptions.InvalidNextTokenException