Search code examples
laravelamazon-web-servicesamazon-elastic-beanstalkaws-codepipelineaws-code-deploy

One or more TargetGroups associated with the environment are in a reduced health state


After updating the environment variables and the code from the repo (which automatically deploys to this AWS EB environment) I started to get

enter image description here

Environment health has transitioned from Ok to Warning. One or more TargetGroups associated with the environment are in a reduced health state: - awseb-AWSEB-1MJ1... - Warning

How can that be solved?


Solution

  • In order to solve it, I've pushed a minor change to the repo branch that triggers the pipeline to deploy to that EB environment and then the code was updated.

    So, the reason was that I've updated the .env variables at the same time the code was being published.

    enter image description here

    Note: I didn't try to reproduce it.


    Edit

    I've just gone through the same problem again. That happened shortly after I was running Laravel migrations through SSH and pushing code to the repo which would trigger the deployment to the EB. During the time of the warning I wasn't able to access the AWS RDS database instance from my machine. Pushing new code to the repo (and by consequence to EB) solved the problem again.