获取 describeImages 的 AWS 区域

get AWS region for describeImages

我正在尝试使用以下代码在 AWS lambda

中使用 python 2.7 获取所有 Ami 图像

结果=client.describe_images( 业主=[ 'self' ] )

我能够获取 ami 图像但无法获取其创建的区域...我想根据 region.Please 建议

过滤图像

当您使用 AWS EC2 SDK 时,您只在一个区域中工作。

因此,通过调用 client.describe_images(),您已经被过滤到一个区域。结果中返回的所有 AMI 图像都在同一区域。

要获取所有区域的所有 AMI 映像,则需要遍历所有区域,在每个区域内调用 client.describe_images()