Technology Musings

Getting EC2 Instances to Talk to Each Other

JB

I am getting started with EC2, and I noticed a problem - I was unable to get my instances to talk to each other - specifically, mounting an NFS drive.  After searching through my forums, I found my answer - I was using a custom Security Group.

In the default security group, instances within that security group can talk freely to each other.  What is surprising is that the default mode for a custom security group is to prevent all communication between the instances.  Therefore, you have to add permissions for the security group to be able to receive incoming traffic from the security group itself.  In the "host" line, rather than put an IP address, you can put in a security group ID (i.e. sg-abc123), and then specify 0-65535 for the port range.

Then, viola!  It works!