Getting Information About Tags Associated with a Resource

You can get information about tags associated with a resource.

If you exceed the number of identical requests allowed for a configured time period, the RequestLimitExceeded error message is returned.

In the case of an instance, you can also get information about associated tags from within the instance itself. For more information, see Accessing the Metadata and User Data of an Instance.

Getting Information About Your Tags Using Cockpit

  1. Click the page corresponding to the type of the resource you want tag information about.

  2. Select the resource you want to get information about.
    The resource is selected.

  3. Click Tags.
    A dialog box with all the tags associated with the selected resource appears.

    You can hover over the selected resource to make all its associated tags appear.

Getting Information About Your Tags Using AWS CLI

To get information about tags associated with your resources, use the describe-tags command following this syntax:

Request sample
$ aws ec2 describe-tags \
    --profile YOUR_PROFILE \
    --filters Name=resource-id,Values=i-12345678 \

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • (optional) filters: One or more filters, in the "Name=X,Values=Y" format.

    You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

    The following filters are available:

    • key: The key of the tags.

    • resource-id: The ID of the resource.

    • resource-type: The resource type (instance | image | volume | snapshot | public-ip | security-group | route-table | network-interface | vpc | subnet | network-link | vpc-endpoint | nat-gateway | internet-gateway | customer-gateway | vpn-gateway | vpn-connection | dhcp-options | task).

    • value: The value of the tags.

      If you use this filter and set it to an empty string, you get information about all your tags with a value set to an empty string.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-tags command returns the following elements:

  • Tags: The tags associated to the resources.

    • ResourceType: The resource type.

    • ResourceId: The ID of the resource.

    • Value: The value of the tags.

    • Key: The key of the tags.

Result sample
    "Tags": [
            "ResourceType": "instance",
            "ResourceId": "i-12345678",
            "Value": "Production",
            "Key": "Stack"
            "ResourceType": "instance",
            "ResourceId": "i-12345678",
            "Value": "Beta Server",
            "Key": "Name"

Related Pages

Corresponding API Method

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.