code: 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;
      }
docs: check to see if the instanceInfo record is of a server that is deployed within EC2 VPC (best effort check
  based on assumption of existing vpcId). This check could be for the local server or a remote server.
  
  @param instanceInfo
  @return true if the record contains a non null, non empty AWS vpcId