aws ec2 instance python(boto3)脚本读取实例信息

#!/usr/bin/env python3

import boto3

ec2 = boto3.client('ec2', region_name='ap-southeast-1')
instances = ec2.describe_instances()
for instance in instances:
    print(instance['InstanceId'])

猜你喜欢

转载自blog.csdn.net/guofeng_hao/article/details/82019399