Skip to content

Function: resolveCloudLocation()

resolveCloudLocation(input): Promise<CloudLocation | null>

Resolve input’s host to a CloudLocation, or null when the host can’t be resolved or none of its IPs match a known cloud range. input is any net.UrlLike - a URL, a bare host, or a { url } wrapper.

The provider range feeds are cached for RANGE_CACHE_TTL_MS, so only the first call in a 24-hour window pays the fetch cost; the DNS lookup happens on every call.

UrlLike

Promise<CloudLocation | null>

await resolveCloudLocation("https://adb-1234567890.7.azuredatabricks.net");
// { provider: CloudProvider.Azure,
// region: "eastus2", ip: "...", cidr: "..." }
await resolveCloudLocation("dbc-abc123.cloud.databricks.com");
// { provider: CloudProvider.Aws,
// region: "us-west-2", ip: "...", cidr: "..." }