Boto3 get EC2 instance's volume

前端 未结 5 559
既然无缘
既然无缘 2021-01-14 10:00

I am trying to get volume-id list of aws instance using boto 3, I am getting sort of collection manager but I don\'t know how to get the data inside.

import          


        
5条回答
  •  离开以前
    2021-01-14 10:16

    It's just an iterable of objects so

    for v in volumes:
        print(v.id)
    

    if you want to get a list of id :

    l = [v.id for v in volumes]
    

提交回复
热议问题