如何使用 boto3
使用标签和值过滤 AWS 实例?
import boto3
ec2 = boto3.resource('ec2')
client = boto3.client('ec2')
response = client.describe_tags(
Filters=[{'Key': 'Owner', 'Value': 'user@example.com'}])
print(response)
原文由 Narasimha Theja Rao 发布,翻译遵循 CC BY-SA 4.0 许可协议
您使用了错误的 API。使用 describe_instances