We have an Elastic Beanstalk environment and since many weeks almost every morning at about 8.10 am/8.20 am we get a notification (SNS) that "Environment health has transitioned from Ok to Degraded" and 2 mins later we get another saying that "Environment health has transitioned from Degraded to Ok".
When this happens the running EC2 instance get killed and a new one is started.
I investigated by downloading logs of just terminated instances and by controlling all CloudWatch parameters and the only thing I found is that there's a CloudWatch NetworkOut < 2000000 alarm starting about 10 mins before instance termination.
So I suppose that the problem is that the instance is getting low traffic. I also doubt about it because we have 2 environments running for 2 countries (.it, .ch) and even if they are the same on every aspect just the .it has this problem.
But if the problem is that autoscaling triggers to down scale an instance for low-use, how is possible to handle autoscaling down scale if you have just 1 instance running and also you set only 1 instance kind (T3.micro) to be used, and avoid that this only instance get terminated?
Shall we change the metric for autoscaling down sizing? Actually it seems that every metric could have the same problem.