public static boolean isInVpc(InstanceInfo instanceInfo) {
        if (instanceInfo.getDataCenterInfo() instanceof AmazonInfo) {
            AmazonInfo info = (AmazonInfo) instanceInfo.getDataCenterInfo();
            String vpcId = info.get(AmazonInfo.MetaDataKey.vpcId);
            return !isNullOrEmpty(vpcId);
        }

        return false;
    }
@Test
    public void testIsInVpc() {
        InstanceInfo instanceInfo1 = new InstanceInfo.Builder(InstanceInfoGenerator.takeOne())
                .setDataCenterInfo(new DataCenterInfo() {
                    @Override
                    public Name getName() {
                        return Name.MyOwn;
                    }
                })
                .build();

        Assert.assertFalse(EurekaUtils.isInVpc(instanceInfo1));

        InstanceInfo instanceInfo2 = InstanceInfoGenerator.takeOne();
        Assert.assertFalse(EurekaUtils.isInVpc(instanceInfo2));

        InstanceInfo instanceInfo3 = InstanceInfoGenerator.takeOne();
        ((AmazonInfo) instanceInfo3.getDataCenterInfo()).getMetadata()
                .put(AmazonInfo.MetaDataKey.vpcId.getName(), "vpc-123456");

        Assert.assertTrue(EurekaUtils.isInVpc(instanceInfo3));
    }