user3382916
user3382916

Reputation: 125

How to Extract the Tag name from ec2 snapshot_id

With this command I am getting the snapshot id but i want to get the name associated with this id [TAGS]

aws ec2 describe-snapshots --owner-ids **********  --output text | awk /vol-6ac16d63/ | grep -y "2014-02-01" | awk "/vol-6ac16d63/{print \$5}"

Upvotes: 3

Views: 454

Answers (1)

Uri Agassi
Uri Agassi

Reputation: 37409

try describe-tags:

aws ec2 describe-tags --filters Name=resource-id,Values=snap-XXXXXXX Name=key,Values=Name --query "Tags[*].Value" --output text

Upvotes: 1

Related Questions