How to turn on/off cloud instances during office hours

前端 未结 9 1840
孤城傲影
孤城傲影 2020-12-08 10:40

I\'ve got my head around creating cloud instances in AWS, Azure and Rackspace. However, I need to turn my instances off at the end of the day and on in the morning as this w

9条回答
  •  粉色の甜心
    2020-12-08 11:26

    Refer to this article, there some options to turn your instances on/off inside AWS.

    • AWS Datapipeline
    • AWS Lambda scheduled events
    • Scheduled Cron on EC2 instance
    • Scheduled Scaling of Auto Scaling Group

    So in your case I'd recommend the followings:

    For AWS:

    Through Shell Command like AWS CLI commands: See Turn on/off Cloud instances using AWS Pipeline. this method will initiate a separate EC2 instance to be started and terminated for each AWS API call that running times affect to your Bill.

    Through programming languages like Node.js / Python: See Turn on/off Cloud instances using AWS Lambda. The task running twice a day for typically less than 3 seconds with memory consumption up to 128MB typically costs less than $0.0004 USD/month

    For Azure and Rackspace (or other platforms you may have):
    Use the above tools to provide a Respective API to start/stop instances on demand.

    You may also consider to set scripts-per-boot which runs each time your instance is started.

提交回复
热议问题