Get cloud information based on hostname.
Pass a service hostname to the getCloudInfo()
function to get cloud information.
import get from 'lodash.get';
import { getCloudInfo } from 'mongodb-cloud-info';
async function getCloudInfoFromDataService(dataService) {
try {
const firstServerHostname = get(dataService, 'client.model.hosts.0.host');
return await getCloudInfo(firstServerHostname);
} catch (e) {
return {};
}
}
{
isAws: false,
isGcp: false,
isAzure: false
}