【发布时间】:2020-06-21 05:04:55
【问题描述】:
我正在尝试使用 boto 3 获取 aws 实例的 volume-id 列表,我正在获取某种集合管理器,但我不知道如何获取其中的数据。
import boto3
ec2 = boto3.resource('ec2', region_name='us-west-2')
instance = ec2.Instance('i-xxxxxx')
volumes = instance.volumes.all()
print volumes
我得到的答案是:
ec2.Instance.volumesCollection(ec2.Instance(id='i-xxxxxx'), ec2.Volume)
我如何使用“ec2.Volume”来获取卷 ID
谢谢, 审阅。
【问题讨论】:
标签: python amazon-web-services aws-sdk boto3