I try to turn off / start my environments with an elastic beanstalk (test) during the night to save resources when the servers are not needed. On the EB web console, I can enter the time scales that start.
But when I add the configuration file to the .ebextensions folder, which should do the same, the servers do not scale at all.
According to the documentation (search for “Examples of time scale parameter settings files”) from an elastic bean stitch, you can add a .ebextension file with a temporary scaling configuration.
So, I adjusted this example and added the appropriate definition to the project:
{ [ { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "OvernightShutdown", "OptionName": "MinSize", "Value": "0" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "OvernightShutdown", "OptionName": "MaxSize", "Value": "0" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "OvernightShutdown", "OptionName": "DesiredCapacity", "Value": "0" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "OvernightShutdown", "OptionName": "StartTime", "Value": "2015-11-18T16:50:00Z" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "OvernightShutdown", "OptionName": "Recurrence", "Value": "00 21 * * 1-5" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "MorningStartup", "OptionName": "MinSize", "Value": "1" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "MorningStartup", "OptionName": "MaxSize", "Value": "1" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "MorningStartup", "OptionName": "DesiredCapacity", "Value": "1" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "MorningStartup", "OptionName": "StartTime", "Value": "2015-11-19T05:00:00Z" }, { "Namespace": "aws:autoscaling:scheduledaction", "ResourceName": "MorningStartup", "OptionName": "Recurrence", "Value": "00 07 * * 1-5" } ] }
Basically it is copy and paste and a little adjustment according to my needs. I put it in a .ebxtensions / autoscaling.config file in my project and deployed it to EB.
The servers should now scale ("OvernightShutdown") to 0 at 21:00 UTC and should increase ("MorningStartup") at 7:00 UTC.
But OvernightShutdown and MorningStartup do not start when they should.
I also had a typo in the file, then EB told me that he could not parse it, so I know that I am reading the file, but obviously it does not apply the configuration to the environment.
Does anyone know what could be the problem? Is my configuration wrong? Since there are not so many examples, the file would look as if I did not have the correct links, except for the link from the EB document.