David Kimura PRO said about 1 year ago on Deploying to Amazon Linux 2 :
  I haven't tried deploying separate EC2 instances in the same environment but running different commands (rails app and then another set of instances running sidekiq). My thought is that this would go against their best practices as it could eventually lead to some issues with the load balancer. The health checks that occur will test to see if a EC2 instance is healthy or not and this could end up causing your background workers to die often.

You're probably best off creating a separate worker environment but use the same database. In these cases where you have two different environments for the same application, I would create the database separately from Beanstalk and make the appropriate routings.

For deploying to these two different environments, I would create a bin/deploy function. That way, you have one command that will deploy to both environments.

For connecting to a RDS database outside of the beanstalk network

For creating bin functions