I want to expose port of a EC2 machine(us-west-2b) to access from another machine(us-west-2a). For that, I have created a security group with CIDR range.
But it is not opening the port. What is the right way of achieving this without making port public
I have created a security group and added that security group to two machines. For each machine, i have exposed 9001 port to the newly created security group. Now i tried accessing port of one machine from another machine But it is not working.
Use different security groups, one per EC2 instance.
then edit that one you want to open the PORT and add as a source the other security group.
Check this example ... I am opening port 3306 only for SG: sg-xxxx
then use the private IP address and NOT the public IP.