0
votes

I have a spring boot application that is deployed to AWS Elastic Beanstalk and a Mongo database the is deployed on an EC2 instance.

I created two security groups: one for the EC2 instance and another one for Elastic Beanstalk to open the connection to each other.

However, the spring boot app still can't connect to Mongo (on the EC2 IP address).

1

1 Answers

2
votes
  1. Login to your AWS account and navigate to EC2 (Compute) dashboard.
  2. Click the Security Group for the Ec2 instance in which MongoDB is installed
  3. In the inbound tab, click edit
  4. Add the private IP of the EC2 where beanstalk is running and the MongoDB port. This will allow the connectivity from your Spring boot application to MongoDB.
  5. To test the connectivity, SSH into your EC2 where beanstalk is running and telnet the IP: port where MongoDB is running.