Beanstalk platform updates remove the instances from their load balancer target groups

0

Hello,

We just transformed a system into a multi-tenancy one and we encountered an issue with Beanstalks automatic updates.

There is one backend per tenant hosted in Beanstalk. We have a shared load balancer that uses one target group per instance to forward their traffic there based on custom ports. Everything worked fine until a platform update was applied to all Beanstalk instances, it removed all targets from the target groups and thus no instance was available after that. The targets had to be manually added back to each target group.

This is not a sustainable solution in the long-term. I could set the Beanstalks update window on Sunday and then have a Lambda function verify that the target groups are not empty after it and populate them again if needed but I'd rather avoid using some custom logic here.

Would there be a way to make the target groups always include these Beanstalk instances even after their platform updates?

Xavier
asked a year ago441 views
1 Answer
1
Accepted Answer

It sounds like the issue you are experiencing is due to the platform update process in Elastic Beanstalk creating new instances and then removing the old instances from the target group.

To avoid this problem, you can create a custom target group for your Elastic Beanstalk instances that will not be impacted by platform updates. You can do this by following these steps:

Create a new target group in the EC2 console.

Configure the new target group to include the port(s) that your Elastic Beanstalk instances are listening on.

Update your Elastic Beanstalk environment to use the new target group instead of the default target group.

Add the new target group to your shared load balancer.

By creating a custom target group, you can ensure that your Elastic Beanstalk instances are always included in the target group, even after platform updates. When a platform update creates new instances, they will automatically be added to the custom target group, while the old instances will remain in the group.

Note that when you create a custom target group, you will need to update your Elastic Beanstalk environment to use it instead of the default target group. This can be done using the Elastic Beanstalk console or the AWS CLI.

AWS_Guy
answered a year ago
  • Thanks, that seems to be exactly what I need here!

    I didn't know I could change a Beanstalk target group like this. I'll take care of it as soon as I have some time.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions