match ec2 by private or public