@cloud-carbon-footprint/gcp
Version:
The core logic to get cloud usage data and estimate energy and carbon emissions from Google Cloud Platform.
115 lines (109 loc) • 3.9 kB
text/typescript
/*
* © 2021 Thoughtworks, Inc.
*/
import { mappedRegionsToElectricityMapZones } from '@cloud-carbon-footprint/common'
export enum GCP_REGIONS {
AFRICA_SOUTH1 = 'africa-south1',
ASIA_EAST1 = 'asia-east1',
ASIA_EAST2 = 'asia-east2',
ASIA_NORTHEAST1 = 'asia-northeast1',
ASIA_NORTHEAST2 = 'asia-northeast2',
ASIA_NORTHEAST3 = 'asia-northeast3',
ASIA_SOUTH1 = 'asia-south1',
ASIA_SOUTH2 = 'asia-south2',
ASIA_SOUTHEAST1 = 'asia-southeast1',
ASIA_SOUTHEAST2 = 'asia-southeast2',
AUSTRALIA_SOUTHEAST1 = 'australia-southeast1',
AUSTRALIA_SOUTHEAST2 = 'australia-southeast2',
EUROPE_CENTRAL2 = 'europe-central2',
EUROPE_NORTH1 = 'europe-north1',
EUROPE_NORTH2 = 'europe-north2',
EUROPE_SOUTHWEST1 = 'europe-southwest1',
EUROPE_WEST1 = 'europe-west1',
EUROPE_WEST2 = 'europe-west2',
EUROPE_WEST3 = 'europe-west3',
EUROPE_WEST4 = 'europe-west4',
EUROPE_WEST6 = 'europe-west6',
EUROPE_WEST8 = 'europe-west8',
EUROPE_WEST9 = 'europe-west9',
EUROPE_WEST10 = 'europe-west10',
EUROPE_WEST12 = 'europe-west12',
NORTHAMERICA_NORTHEAST1 = 'northamerica-northeast1',
NORTHAMERICA_NORTHEAST2 = 'northamerica-northeast2',
NORTHAMERICA_SOUTH1 = 'northamerica-south1',
SOUTHAMERICA_EAST1 = 'southamerica-east1',
SOUTHAMERICA_WEST1 = 'southamerica-west1',
US_CENTRAL1 = 'us-central1',
US_CENTRAL2 = 'us-central2',
US_EAST1 = 'us-east1',
US_EAST2 = 'us-east2',
US_EAST4 = 'us-east4',
US_EAST5 = 'us-east5',
US_SOUTH1 = 'us-south1',
US_WEST1 = 'us-west1',
US_WEST2 = 'us-west2',
US_WEST3 = 'us-west3',
US_WEST4 = 'us-west4',
MIDDLEEAST_CENTRAL1 = 'me-central1',
MIDDLEEAST_CENTRAL2 = 'me-central2',
MIDDLEEAST_WEST1 = 'me-west1',
UNKNOWN = 'Unknown',
}
export enum GCP_DUAL_REGIONS {
ASIA1 = 'asia1',
EUR4 = 'eur4',
NAM4 = 'nam4',
}
export enum GCP_MULTI_REGIONS {
ASIA = 'asia',
EU = 'europe',
US = 'us',
}
export const GCP_MAPPED_REGIONS_TO_ELECTRICITY_MAPS_ZONES: mappedRegionsToElectricityMapZones =
{
[]: 'TW',
[]: null,
[]: 'JP-TK',
[]: 'JP-KN',
[]: 'KR',
[]: 'IN-WE',
[]: 'IN-NO',
[]: 'SG',
[]: 'ID',
[]: 'AU-NSW',
[]: 'AU-VIC',
[]: 'PL',
[]: 'FI',
[]: 'ES',
[]: 'BE',
[]: 'GB',
[]: 'DE',
[]: 'NL',
[]: 'CH',
[]: 'IT-NO',
[]: 'FR',
[]: 'DE',
[]: 'IT-NO',
[]: 'CA-QC',
[]: 'CA-ON',
[]: 'BR-CS',
[]: 'CL-SEN',
[]: 'US-MIDW-MISO',
[]: 'US-MIDW-MISO',
[]: 'US-CAR-SCEG',
[]: 'US-MIDA-PJM',
[]: 'US-MIDA-PJM',
[]: 'US-TEX-ERCO',
[]: 'US-NW-PACW',
[]: 'US-CAL-CISO',
[]: 'US-NW-PACE',
[]: 'US-NW-NEVP',
[]: 'ZA',
[]: 'SE-SE3',
[]: null,
[]: null,
[]: 'IL',
[]: 'MX',
[]: 'US-MIDA-PJM',
[]: null,
}