Elastic beanstalk time scaling

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.

+5
source share
2 answers

I also posted this question on the AWS / EB board, they answered with a helpful answer to this problem:

AWS Panel Link

The solution is to use yaml configuration instead of json, because EB seems to have a problem with json-config. But they correct it according to the answer.

+2
source

I think you may come across priority suggestions: priority of configuration options . It caught me the other day. If you manually configured the values ​​through the web interface, your configuration file will not replace these values.

To fix this I value:

  • created the configuration file .ebextensions , as you are, make sure that it has been deployed and is ready in the environment.
  • run eb config to invoke the current configuration (this should show the old configuration)
  • deleted configuration values ​​that were in conflict
  • exit and save the configuration

This causes the environment to update, as if you changed it in the web interface.

or like @mbaird in the comments, 0 cannot be a valid minimum and maximum value.

+1
source

Source: https://habr.com/ru/post/1236320/


All Articles