checking for ec2 connection