You need to open mongoDB port to world so that you can listen inbound traffic. To do so:
In instance security group -> Inboud Open 27017 port or whatever port on which your mongoDB is currently running.
Type Protocol Port Range Source Custom TCP Rule TCP 27017 0.0.0.0/0 OR Custom TCP Rule TCP mongoDB_port your_ip/CIDR
In /etc/mongod.conf which is now default configuration file for mongoDB.
Change binIP: 127.0.0.1 to 0.0.0.0.
By default it listen to local host.
# network interfaces net: port: 27017 bindIp: 0.0.0.0
Run this command to reflect changes:
sudo service mongod restart