Jef*_*eff 23 python amazon-ec2 boto amazon-web-services
我正在使用boto基于AMI生成新的EC2实例.
ami.run方法有许多参数,但没有"name" - 也许它被称为不同的东西?
小智 31
import boto
c = boto.connect_ec2(ec2_key, ec2_secret)
image = c.get_image(ec2_ami)
reservation = image.run(key_name=ec2_keypair,
security_groups=ec2_secgroups,
instance_type=ec2_instancetype)
instance = reservation.instances[0]
c.create_tags([instance.id], {"Name": instance_name})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8016 次 |
| 最近记录: |