Skip to content

Commit acab0d6

Browse files
authored
add missing machineTypes for Google Cloud (#351)
* add missing machineTypes for Google Cloud * update comment to be TODO instead
1 parent b655bbd commit acab0d6

1 file changed

Lines changed: 29 additions & 3 deletions

File tree

src/scrapers/gcpMachineTypes.ts

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,26 @@ import { generatePriceHash, generateProductHash } from '../db/helpers';
77
import { upsertProducts } from '../db/upsert';
88
import { findProducts } from '../db/query';
99

10+
// TODO: refactor to use compute.machineTypes.list()
1011
const machineTypeDescriptionLookups: {
1112
[key: string]: { [key: string]: string };
1213
} = {
14+
a2: {
15+
cpu: 'A2 Instance Core',
16+
memory: 'A2 Instance Ram',
17+
},
1318
c2: {
1419
cpu: 'Compute optimized Core',
1520
memory: 'Compute optimized Ram',
1621
},
22+
c2d: {
23+
cpu: 'C2D AMD Instance Core',
24+
memory: 'C2D AMD Instance Ram',
25+
},
26+
c3: {
27+
cpu: 'Compute optimized Core',
28+
memory: 'Compute optimized Ram',
29+
},
1730
e2: {
1831
cpu: 'E2 Instance Core',
1932
memory: 'E2 Instance Ram',
@@ -30,6 +43,14 @@ const machineTypeDescriptionLookups: {
3043
// some have "Preemptible Memory-optimized Ram"
3144
memory: 'Memory-optimized (Instance )?Ram',
3245
},
46+
m2: {
47+
cpu: 'Memory-optimized Instance Core',
48+
memory: 'Memory-optimized (Instance )?Ram',
49+
},
50+
m3: {
51+
cpu: 'Memory-optimized Instance Core',
52+
memory: 'Memory-optimized (Instance )?Ram',
53+
},
3354
n1: {
3455
cpu: 'N1 Predefined Instance Core',
3556
memory: 'N1 Predefined Instance Ram',
@@ -42,9 +63,14 @@ const machineTypeDescriptionLookups: {
4263
cpu: 'N2D AMD Instance Core',
4364
memory: 'N2D AMD Instance Ram',
4465
},
45-
a2: {
46-
cpu: 'A2 Instance Core',
47-
memory: 'A2 Instance Ram',
66+
// T2A is not available in all regions
67+
t2a: {
68+
cpu: 'T2A ARM Instance Core',
69+
memory: 'T2A ARM Instance Ram',
70+
},
71+
t2d: {
72+
cpu: 'T2D AMD Instance Core',
73+
memory: 'T2D AMD Instance Ram',
4874
},
4975
};
5076

0 commit comments

Comments
 (0)