UNPKG

2.26 kBTypeScriptView Raw
1/**
2 * Copyright 2022 Google LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/**
17 * Known paths unique to Google Compute Engine Linux instances
18 */
19export declare const GCE_LINUX_BIOS_PATHS: {
20 BIOS_DATE: string;
21 BIOS_VENDOR: string;
22};
23/**
24 * Determines if the process is running on a Google Cloud Serverless environment (Cloud Run or Cloud Functions instance).
25 *
26 * Uses the:
27 * - {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.
28 * - {@link https://cloud.google.com/functions/docs/env-var Cloud Functions environment variables}.
29 *
30 * @returns {boolean} `true` if the process is running on GCP serverless, `false` otherwise.
31 */
32export declare function isGoogleCloudServerless(): boolean;
33/**
34 * Determines if the process is running on a Linux Google Compute Engine instance.
35 *
36 * @returns {boolean} `true` if the process is running on Linux GCE, `false` otherwise.
37 */
38export declare function isGoogleComputeEngineLinux(): boolean;
39/**
40 * Determines if the process is running on a Google Compute Engine instance with a known
41 * MAC address.
42 *
43 * @returns {boolean} `true` if the process is running on GCE (as determined by MAC address), `false` otherwise.
44 */
45export declare function isGoogleComputeEngineMACAddress(): boolean;
46/**
47 * Determines if the process is running on a Google Compute Engine instance.
48 *
49 * @returns {boolean} `true` if the process is running on GCE, `false` otherwise.
50 */
51export declare function isGoogleComputeEngine(): boolean;
52/**
53 * Determines if the process is running on Google Cloud Platform.
54 *
55 * @returns {boolean} `true` if the process is running on GCP, `false` otherwise.
56 */
57export declare function detectGCPResidency(): boolean;