I am trying to connect from a server in AWS in one security group to server in AWS which is in another security group.
I am using public FQDN in phoenix jdbc url and I opened corresponding port in AWS.
-->i am able to ping and telnet with port i am using to corresponding host which i am connecting to .
Thanks for the clarification, in AWS the servers should have a common security group. You can not use the same Security Group for multiple VPC it's specific to a single VPC.
However, you can copy a Security Group to create a new Security Group with the same rules in another VPC for the same AWS Account.