Displaying EC2 Instance name using Boto 3

后端 未结 2 1959
醉酒成梦
醉酒成梦 2020-12-31 00:18

I\'m not sure how to display the name of my instance in AWS EC2 using boto3

This is some of the code I have:

import boto3

ec2 = boto3.r         


        
2条回答
  •  伪装坚强ぢ
    2020-12-31 00:43

    In AWS EC2 an instance is tagged with a Name tag.

    In order to get the value of the Name tag for a given instance, you need to query the instance for that tag:

    See Obtaining tags from AWS instances with boto

提交回复
热议问题