[英]Is it possible to create EC2 instance from describe_instances() output?
Using python and BOTO3 service there is an option to use describe_instances() to get all the information about the running instances in specific region. 使用python和BOTO3服务,可以选择使用describe_instances()获取有关特定区域中正在运行的实例的所有信息。
If I use that and save the output in JSON, later input that json and pass it to create_instances() , is it going to work or the format is different from what I need to pass to create_instnaces() function? 如果我使用它并将输出保存为JSON,则稍后输入该json并将其传递给create_instances() ,它是否可以正常工作或者其格式与我需要传递给create_instnaces()函数的格式不同?
I'm asking that because I would like to make an automated option to get back a terminated instance which I have all its information saved. 我之所以这么问,是因为我想选择一个自动化的选项来取回已终止的实例,并保存所有信息。
thanks! 谢谢!
There is no standard format that would allow easy creation of a new instance from an existing or terminated instance. 没有标准格式允许从现有或终止的实例轻松创建新实例。
You would need to take the output of describe_instances()
and use it to call run_instances()
. 您将需要获取
describe_instances()
的输出并使用它来调用run_instances()
。
Some information might no longer be available from a terminated instance, such as User Data. 终止的实例可能不再提供某些信息,例如“用户数据”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.