自动关闭和启动 Amazon EC2 实例 [英] Auto Shutdown and Start Amazon EC2 Instance

查看:31
本文介绍了自动关闭和启动 Amazon EC2 实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 Amazon API 自动启动和终止我的 Amazon 实例吗?你能描述一下如何做到这一点吗?理想情况下,我需要每天在指定的时间间隔启动和停止实例.

Can I automatically start and terminate my Amazon instance using Amazon API? Can you please describe how this can be done? I ideally need to start the instance and stop the instance at specified time intervals every day.

推荐答案

为了防止有人偶然发现这个老问题,现在您可以通过向 Auto Scaling 组添加计划来实现同样的目的:增加实例数量在某个自动缩放组中,在某些时候将其设置为 1,然后再将其减少回 0.

Just in case somebody stumbles on this ye old question, nowadays you can achieve the same thing by adding a schedule to an auto scaling group: increase the amount of instances in an auto scaling group to 1 at certain times and decrease it back to 0 afterwards.

由于这个答案获得了很多观点,我想链接到一个非常有用的指南:使用 Auto Scaling 定期运行 EC2 实例

And since this answer is getting a lot of views, I thought to link to a very helpful guide about this: Running EC2 Instances on a Recurring Schedule with Auto Scaling

这篇关于自动关闭和启动 Amazon EC2 实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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