node.js - Connect to MongoDB hosted on AWS ec2 from Elastic Beanstalk -
i'm trying host web app on aws.
i'm hosting nodejs app on elastic beanstalk (salable). have created ec2 instance host mongodb.
in test, mongodb ec2 instance accepts connection @ port 27017 anywhere. , website works great.
the problems want restrict access mongodb ec2 instance allow connections elastic beanstalk app.
i changed rule of ec2 instance security group, accept tcp port 27017 connection security group elastic beanstalk app assigned to.
this breaks communication mongodb app immediately.
i have tried allow traffic beanstalk security group, no luck
have got wrong? please help!
needed edit /etc/mongod.conf file , set bind_ip = 0.0.0.0 in order make connections externally.
also had try different version of mask work. xxx.xxx.0.0/16 worked me, xxx.xxx.0.0/24 , xxx.xxx.0.0/32 didn't.
also, recommended use private ip if in same zone (keeps costs down), public otherwise.
Comments
Post a Comment