aws ec2 describe-tags --filters "Name=value,Values=pname"
aws ec2 describe-tags
To describe the tags for a single resource
aws ec2 describe-tags --filters "Name=resource-id,Values=i-5f4e3d2a"
{ "Tags": [ { "ResourceType": "instance", "ResourceId": "i-5f4e3d2a", "Value": "Test", "Key": "Stack" }, { "ResourceType": "instance", "ResourceId": "i-5f4e3d2a", "Value": "Beta Server", "Key": "Name" } ] }
To describe the tags for a type of resource
aws ec2 describe-tags --filters "Name=resource-type,Values=volume"
{
"Tags": [
{
"ResourceType": "volume",
"ResourceId": "vol-1a2b3c4d",
"Value": "Project1",
"Key": "Purpose"
},
{
"ResourceType": "volume",
"ResourceId": "vol-87654321",
"Value": "Logs",
"Key": "Purpose"
}
]
}
To describe the tags for your resources based on a key and a value
aws ec2 describe-tags --filters "Name=key,Values=Stack" "Name=value,Values=Test"
{ "Tags": [ { "ResourceType": "image", "ResourceId": "ami-3ac33653", "Value": "Test", "Key": "Stack" }, { "ResourceType": "instance", "ResourceId": "i-5f4e3d2a", "Value": "Test", "Key": "Stack" } ] }
aws ec2 describe-tags --filters "Name=resource-type,Values=instance" "Name=key,Values=Purpose" "Name=value,Values="
Comments