如何使用Boto3创建EC2实例 [英] How to create an ec2 instance using boto3

查看:426
本文介绍了如何使用Boto3创建EC2实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在python中使用boto3创建ec2实例?
Boto3文档在这里没有帮助,我在网上找不到任何帮助文档。请提供一些示例代码/链接。

Is it possible to create an ec2 instance using boto3 in python? Boto3 document is not helping here, and I couldn't find any helping documents online. please provide some sample codes/links.

推荐答案

API已更改,但在文档中就在那里

The API has changed but it's right there in the documentation

# Boto 3
ec2.create_instances(ImageId='<ami-image-id>', MinCount=1, MaxCount=5)

文档链接:
http://boto3.readthedocs.org/en/latest/guide/migrationec2.html#launching-new-instances

这篇关于如何使用Boto3创建EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆