I'm trying to configure access to our RDS from the instances in an Elastic Beanstalk environment.
The RDS and EB environment are in the same VPC.
The complication is that the security group for the EB instances is dynamically generated at environment creation time. I'm not sure how to configure the RDS security group to allow a dynamic security group.
I've tried using the CIDR for the VPC instead, but this doesn't seem to work.
Is there a recommended way to do this?
EC2 security groups can be used for more than just allowing incoming and outgoing traffic. They can also be used for pure identification of EC2 instances.
When creating an Elastic Beanstalk application, EB will always create a security group for the EC2 instances, but you can also add another security group to your EC2 instances.
Using these two pieces of information, you can do the following:
Once this is done, your EC2 instances should have access to your RDS instance.
As an aside, using a CIDR for your VPC in your RDS security group's incoming rule should work as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With