从实例中查询EC2标签 [英] Query EC2 tags from within instance

查看:240
本文介绍了从实例中查询EC2标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亚马逊最近添加的标注EC2实例与键 - 值对,使大量虚拟机的有点容易管理的奇妙功能。

Amazon recently added the wonderful feature of tagging EC2 instances with key-value pairs to make management of large numbers of VMs a bit easier.

有一些方法来查询这些标签以相同的方式,因为一些其他用户设置的数据?例如:

Is there some way to query these tags in the same way as some of the other user-set data? For example:

$ wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone
us-east-1d

有没有查询标签有些类似的方式?

Is there some similar way to query the tags?

推荐答案

您可以使用 AWS元数据工具(检索您的实例ID)和新标签API 检索标签当前实例。

You can use a combination of the AWS metadata tool (to retrieve your instance ID) and the new Tag API to retrieve the tags for the current instance.

这篇关于从实例中查询EC2标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆