Aws open port to another instance but not publicly
<p>I didn't understand which rule I have to setup in my vpc to make the postgres port available only to other instances in the same vpc.</p>

<p>Let me clarify: </p>

<p>172.30.0.183 is my database.</p>

<p>172.30.0.207 instance A</p>

<p>172.30.0.165 instance B</p>

<p>They are in the same VPC. 
If I include an inbound rule to the port 5432(postgres) binded to 0.0.0.0/0, I can access my database from the Internet, but I dont want that.
I just want my instances A and B to be able to connect with it.</p>

<p>How can I do that?</p>