terrafaker 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +52 -213
  2. package/dist/commands/generate/file.js +4 -4
  3. package/dist/commands/generate/repo.js +22 -15
  4. package/dist/commands/gh/repo/clone.js +22 -0
  5. package/dist/commands/gh/repo/delete.js +22 -0
  6. package/dist/commands/glab/repo/clone.js +22 -0
  7. package/dist/commands/glab/repo/delete.js +20 -0
  8. package/dist/commands/util/format-psv.js +3 -3
  9. package/dist/commands/util/format-tsv.js +10 -10
  10. package/dist/commands/util/index.js +1 -1
  11. package/dist/constants/aws.js +82 -82
  12. package/dist/constants/azure.js +95 -95
  13. package/dist/constants/gcp.js +66 -66
  14. package/dist/enums/help-messages.js +2 -0
  15. package/dist/enums/providers.js +1 -1
  16. package/dist/enums/vcs-providers.js +5 -0
  17. package/dist/topics/generate.js +5 -0
  18. package/dist/topics/gh.js +6 -0
  19. package/dist/topics/glab.js +6 -0
  20. package/dist/types/repo.js +1 -0
  21. package/dist/utilities/base-command.js +45 -0
  22. package/dist/utilities/flags.js +22 -8
  23. package/dist/utilities/generators/aws-generator.js +11 -11
  24. package/dist/utilities/generators/azure-generator.js +7 -7
  25. package/dist/utilities/generators/file-generator.js +2 -2
  26. package/dist/utilities/generators/gcp-generator.js +13 -9
  27. package/dist/utilities/generators/generator-utils.js +5 -5
  28. package/dist/utilities/generators/provider-generator.js +26 -8
  29. package/dist/utilities/generators/repo-generator.js +5 -5
  30. package/dist/utilities/github.js +27 -4
  31. package/dist/utilities/gitlab.js +29 -0
  32. package/dist/utilities/repo-utils.js +6 -0
  33. package/dist/utilities/tag-utils.js +2 -2
  34. package/oclif.manifest.json +139 -100
  35. package/package.json +11 -5
  36. package/dist/commands/generate/index.js +0 -9
  37. package/dist/commands/gh/clone-repos.js +0 -46
  38. package/dist/commands/gh/delete-repos.js +0 -41
  39. package/dist/commands/gh/index.js +0 -10
@@ -9,78 +9,78 @@ const GCP_REGIONS = ["africa-south1-a", "africa-south1-b", "africa-south1-c", "a
9
9
  */
10
10
  // prettier-ignore
11
11
  const GCP_INSTANCE_TYPES_BY_FAMILY = {
12
- "C4D standard": ["c4d-standard-2", "c4d-standard-4", "c4d-standard-8", "c4d-standard-16", "c4d-standard-32", "c4d-standard-48", "c4d-standard-64", "c4d-standard-96", "c4d-standard-192", "c4d-standard-384", "c4d-standard-384-metal2"],
13
- "C4D highcpu": ["c4d-highcpu-2", "c4d-highcpu-4", "c4d-highcpu-8", "c4d-highcpu-16", "c4d-highcpu-32", "c4d-highcpu-48", "c4d-highcpu-64", "c4d-highcpu-96", "c4d-highcpu-192", "c4d-highcpu-384", "c4d-highcpu-384-metal2"],
14
- "C4D highmem": ["c4d-highmem-2", "c4d-highmem-4", "c4d-highmem-8", "c4d-highmem-16", "c4d-highmem-32", "c4d-highmem-48", "c4d-highmem-64", "c4d-highmem-96", "c4d-highmem-192", "c4d-highmem-384", "c4d-highmem-384-metal2"],
15
- "C4D standard SSD": ["c4d-standard-8-lssd", "c4d-standard-16-lssd", "c4d-standard-32-lssd", "c4d-standard-48-lssd", "c4d-standard-64-lssd", "c4d-standard-96-lssd", "c4d-standard-192-lssd", "c4d-standard-384-lssd"],
16
- "C4D highmem SSD": ["c4d-highmem-8-lssd", "c4d-highmem-16-lssd", "c4d-highmem-32-lssd", "c4d-highmem-48-lssd", "c4d-highmem-64-lssd", "c4d-highmem-96-lssd", "c4d-highmem-192-lssd", "c4d-highmem-384-lssd"],
17
- "C4A standard": ["c4a-standard-1", "c4a-standard-2", "c4a-standard-4", "c4a-standard-8", "c4a-standard-16", "c4a-standard-32", "c4a-standard-48", "c4a-standard-64", "c4a-standard-72"],
18
- "C4A highcpu": ["c4a-highcpu-1", "c4a-highcpu-2", "c4a-highcpu-4", "c4a-highcpu-8", "c4a-highcpu-16", "c4a-highcpu-32", "c4a-highcpu-48", "c4a-highcpu-64", "c4a-highcpu-72"],
19
- "C4A highmem": ["c4a-highmem-1", "c4a-highmem-2", "c4a-highmem-4", "c4a-highmem-8", "c4a-highmem-16", "c4a-highmem-32", "c4a-highmem-48", "c4a-highmem-64", "c4a-highmem-72"],
20
- "C4A standard SSD": ["c4a-standard-4-lssd", "c4a-standard-8-lssd", "c4a-standard-16-lssd", "c4a-standard-32-lssd", "c4a-standard-48-lssd", "c4a-standard-64-lssd", "c4a-standard-72-lssd"],
21
- "C4A highmem SSD": ["c4a-highmem-4-lssd", "c4a-highmem-8-lssd", "c4a-highmem-16-lssd", "c4a-highmem-32-lssd", "c4a-highmem-48-lssd", "c4a-highmem-64-lssd", "c4a-highmem-72-lssd"],
22
- "C4 standard": ["c4-standard-2", "c4-standard-4", "c4-standard-8", "c4-standard-16", "c4-standard-24", "c4-standard-32", "c4-standard-48", "c4-standard-96", "c4-standard-144", "c4-standard-192", "c4-standard-288", "c4-standard-288-metal"],
23
- "C4 highcpu": ["c4-highcpu-2", "c4-highcpu-4", "c4-highcpu-8", "c4-highcpu-16", "c4-highcpu-24", "c4-highcpu-32", "c4-highcpu-48", "c4-highcpu-96", "c4-highcpu-144", "c4-highcpu-192", "c4-highcpu-288"],
24
- "C4 highmem": ["c4-highmem-2", "c4-highmem-4", "c4-highmem-8", "c4-highmem-16", "c4-highmem-24", "c4-highmem-32", "c4-highmem-48", "c4-highmem-96", "c4-highmem-144", "c4-highmem-192", "c4-highmem-288", "c4-highmem-288-metal"],
25
- "C4 standard SSD": ["c4-standard-4-lssd", "c4-standard-8-lssd", "c4-standard-16-lssd", "c4-standard-24-lssd", "c4-standard-32-lssd", "c4-standard-48-lssd", "c4-standard-96-lssd", "c4-standard-144-lssd", "c4-standard-192-lssd", "c4-standard-288-lssd", "c4-standard-288-lssd-metal"],
26
- "C4 highmem SSD": ["c4-highmem-4-lssd", "c4-highmem-8-lssd", "c4-highmem-16-lssd", "c4-highmem-24-lssd", "c4-highmem-32-lssd", "c4-highmem-48-lssd", "c4-highmem-96-lssd", "c4-highmem-144-lssd", "c4-highmem-192-lssd", "c4-highmem-288-lssd", "c4-highmem-288-lssd-metal"],
27
- "N4D standard": ["n4d-standard-2", "n4d-standard-4", "n4d-standard-8", "n4d-standard-16", "n4d-standard-32", "n4d-standard-48", "n4d-standard-64", "n4d-standard-80", "n4d-standard-96"],
28
- "N4D highcpu": ["n4d-highcpu-2", "n4d-highcpu-4", "n4d-highcpu-8", "n4d-highcpu-16", "n4d-highcpu-32", "n4d-highcpu-48", "n4d-highcpu-64", "n4d-highcpu-80", "n4d-highcpu-96"],
29
- "N4D highmem": ["n4d-highmem-2", "n4d-highmem-4", "n4d-highmem-8", "n4d-highmem-16", "n4d-highmem-32", "n4d-highmem-48", "n4d-highmem-64", "n4d-highmem-80", "n4d-highmem-96"],
30
- "N4A standard": ["n4a-standard-1", "n4a-standard-2", "n4a-standard-4", "n4a-standard-8", "n4a-standard-16", "n4a-standard-32", "n4a-standard-48", "n4a-standard-64"],
31
- "N4A highcpu": ["n4a-highcpu-1", "n4a-highcpu-2", "n4a-highcpu-4", "n4a-highcpu-8", "n4a-highcpu-16", "n4a-highcpu-32", "n4a-highcpu-48", "n4a-highcpu-64"],
32
- "N4A highmem": ["n4a-highmem-1", "n4a-highmem-2", "n4a-highmem-4", "n4a-highmem-8", "n4a-highmem-16", "n4a-highmem-32", "n4a-highmem-48", "n4a-highmem-64"],
33
- "N4 standard": ["n4-standard-2", "n4-standard-4", "n4-standard-8", "n4-standard-16", "n4-standard-32", "n4-standard-48", "n4-standard-64", "n4-standard-80"],
34
- "N4 highcpu": ["n4-highcpu-2", "n4-highcpu-4", "n4-highcpu-8", "n4-highcpu-16", "n4-highcpu-32", "n4-highcpu-48", "n4-highcpu-64", "n4-highcpu-80"],
35
- "N4 highmem": ["n4-highmem-2", "n4-highmem-4", "n4-highmem-8", "n4-highmem-16", "n4-highmem-32", "n4-highmem-48", "n4-highmem-64", "n4-highmem-80"],
36
- "C3D standard": ["c3d-standard-4", "c3d-standard-8", "c3d-standard-16", "c3d-standard-30", "c3d-standard-60", "c3d-standard-90", "c3d-standard-180", "c3d-standard-360"],
12
+ "A2 standard": ["a2-highgpu-1g", "a2-highgpu-2g", "a2-highgpu-4g", "a2-highgpu-8g", "a2-megagpu-16g"],
13
+ "A2 ultra": ["a2-ultragpu-1g", "a2-ultragpu-2g", "a2-ultragpu-4g", "a2-ultragpu-8g"],
14
+ "A3 edge": ["a3-edgegpu-8g"],
15
+ "A3 high": ["a3-highgpu-1g", "a3-highgpu-2g", "a3-highgpu-4g", "a3-highgpu-8g"],
16
+ "A3 mega": ["a3-megagpu-8g"],
17
+ "A3 ultra": ["a3-ultragpu-8g"],
18
+ "A4": ["a4-highgpu-8g"],
19
+ "A4X": ["a4x-highgpu-4g"],
20
+ "C2": ["c2-standard-4", "c2-standard-8", "c2-standard-16", "c2-standard-30", "c2-standard-60"],
21
+ "C2D highcpu": ["c2d-highcpu-2", "c2d-highcpu-4", "c2d-highcpu-8", "c2d-highcpu-16", "c2d-highcpu-32", "c2d-highcpu-56", "c2d-highcpu-112"],
22
+ "C2D highmem": ["c2d-highmem-2", "c2d-highmem-4", "c2d-highmem-8", "c2d-highmem-16", "c2d-highmem-32", "c2d-highmem-56", "c2d-highmem-112"],
23
+ "C2D standard": ["c2d-standard-2", "c2d-standard-4", "c2d-standard-8", "c2d-standard-16", "c2d-standard-32", "c2d-standard-56", "c2d-standard-112"],
37
24
  "C3D highcpu": ["c3d-highcpu-4", "c3d-highcpu-8", "c3d-highcpu-16", "c3d-highcpu-30", "c3d-highcpu-60", "c3d-highcpu-90", "c3d-highcpu-180", "c3d-highcpu-360"],
38
25
  "C3D highmem": ["c3d-highmem-4", "c3d-highmem-8", "c3d-highmem-16", "c3d-highmem-30", "c3d-highmem-60", "c3d-highmem-90", "c3d-highmem-180", "c3d-highmem-360"],
39
- "C3D standard SSD": ["c3d-standard-8-lssd", "c3d-standard-16-lssd", "c3d-standard-30-lssd", "c3d-standard-60-lssd", "c3d-standard-90-lssd", "c3d-standard-180-lssd", "c3d-standard-360-lssd"],
40
26
  "C3D highmem SSD": ["c3d-highmem-8-lssd", "c3d-highmem-16-lssd", "c3d-highmem-30-lssd", "c3d-highmem-60-lssd", "c3d-highmem-90-lssd", "c3d-highmem-180-lssd", "c3d-highmem-360-lssd"],
41
- "C3 standard": ["c3-standard-4", "c3-standard-8", "c3-standard-22", "c3-standard-44", "c3-standard-88", "c3-standard-176", "c3-standard-192-metal"],
27
+ "C3D standard": ["c3d-standard-4", "c3d-standard-8", "c3d-standard-16", "c3d-standard-30", "c3d-standard-60", "c3d-standard-90", "c3d-standard-180", "c3d-standard-360"],
28
+ "C3D standard SSD": ["c3d-standard-8-lssd", "c3d-standard-16-lssd", "c3d-standard-30-lssd", "c3d-standard-60-lssd", "c3d-standard-90-lssd", "c3d-standard-180-lssd", "c3d-standard-360-lssd"],
42
29
  "C3 highcpu": ["c3-highcpu-4", "c3-highcpu-8", "c3-highcpu-22", "c3-highcpu-44", "c3-highcpu-88", "c3-highcpu-176", "c3-highcpu-192-metal"],
43
30
  "C3 highmem": ["c3-highmem-4", "c3-highmem-8", "c3-highmem-22", "c3-highmem-44", "c3-highmem-88", "c3-highmem-176", "c3-highmem-192-metal"],
31
+ "C3 standard": ["c3-standard-4", "c3-standard-8", "c3-standard-22", "c3-standard-44", "c3-standard-88", "c3-standard-176", "c3-standard-192-metal"],
44
32
  "C3 standard SSD": ["c3-standard-4-lssd", "c3-standard-8-lssd", "c3-standard-22-lssd", "c3-standard-44-lssd", "c3-standard-88-lssd", "c3-standard-176-lssd"],
45
- "N2D standard": ["n2d-standard-2", "n2d-standard-4", "n2d-standard-8", "n2d-standard-16", "n2d-standard-32", "n2d-standard-48", "n2d-standard-64", "n2d-standard-80", "n2d-standard-96", "n2d-standard-128", "n2d-standard-224"],
46
- "N2D highcpu": ["n2d-highcpu-2", "n2d-highcpu-4", "n2d-highcpu-8", "n2d-highcpu-16", "n2d-highcpu-32", "n2d-highcpu-48", "n2d-highcpu-64", "n2d-highcpu-80", "n2d-highcpu-96", "n2d-highcpu-128", "n2d-highcpu-224"],
47
- "N2D highmem": ["n2d-highmem-2", "n2d-highmem-4", "n2d-highmem-8", "n2d-highmem-16", "n2d-highmem-32", "n2d-highmem-48", "n2d-highmem-64", "n2d-highmem-80", "n2d-highmem-96"],
48
- "N2 standard": ["n2-standard-2", "n2-standard-4", "n2-standard-8", "n2-standard-16", "n2-standard-32", "n2-standard-48", "n2-standard-64", "n2-standard-80", "n2-standard-96", "n2-standard-128"],
49
- "N2 highcpu": ["n2-highcpu-2", "n2-highcpu-4", "n2-highcpu-8", "n2-highcpu-16", "n2-highcpu-32", "n2-highcpu-48", "n2-highcpu-64", "n2-highcpu-80", "n2-highcpu-96"],
50
- "N2 highmem": ["n2-highmem-2", "n2-highmem-4", "n2-highmem-8", "n2-highmem-16", "n2-highmem-32", "n2-highmem-48", "n2-highmem-64", "n2-highmem-80", "n2-highmem-96", "n2-highmem-128"],
51
- "E2 standard": ["e2-standard-2", "e2-standard-4", "e2-standard-8", "e2-standard-16", "e2-standard-32"],
33
+ "C4A highcpu": ["c4a-highcpu-1", "c4a-highcpu-2", "c4a-highcpu-4", "c4a-highcpu-8", "c4a-highcpu-16", "c4a-highcpu-32", "c4a-highcpu-48", "c4a-highcpu-64", "c4a-highcpu-72"],
34
+ "C4A highmem": ["c4a-highmem-1", "c4a-highmem-2", "c4a-highmem-4", "c4a-highmem-8", "c4a-highmem-16", "c4a-highmem-32", "c4a-highmem-48", "c4a-highmem-64", "c4a-highmem-72"],
35
+ "C4A highmem SSD": ["c4a-highmem-4-lssd", "c4a-highmem-8-lssd", "c4a-highmem-16-lssd", "c4a-highmem-32-lssd", "c4a-highmem-48-lssd", "c4a-highmem-64-lssd", "c4a-highmem-72-lssd"],
36
+ "C4A standard": ["c4a-standard-1", "c4a-standard-2", "c4a-standard-4", "c4a-standard-8", "c4a-standard-16", "c4a-standard-32", "c4a-standard-48", "c4a-standard-64", "c4a-standard-72"],
37
+ "C4A standard SSD": ["c4a-standard-4-lssd", "c4a-standard-8-lssd", "c4a-standard-16-lssd", "c4a-standard-32-lssd", "c4a-standard-48-lssd", "c4a-standard-64-lssd", "c4a-standard-72-lssd"],
38
+ "C4D highcpu": ["c4d-highcpu-2", "c4d-highcpu-4", "c4d-highcpu-8", "c4d-highcpu-16", "c4d-highcpu-32", "c4d-highcpu-48", "c4d-highcpu-64", "c4d-highcpu-96", "c4d-highcpu-192", "c4d-highcpu-384", "c4d-highcpu-384-metal2"],
39
+ "C4D highmem": ["c4d-highmem-2", "c4d-highmem-4", "c4d-highmem-8", "c4d-highmem-16", "c4d-highmem-32", "c4d-highmem-48", "c4d-highmem-64", "c4d-highmem-96", "c4d-highmem-192", "c4d-highmem-384", "c4d-highmem-384-metal2"],
40
+ "C4D highmem SSD": ["c4d-highmem-8-lssd", "c4d-highmem-16-lssd", "c4d-highmem-32-lssd", "c4d-highmem-48-lssd", "c4d-highmem-64-lssd", "c4d-highmem-96-lssd", "c4d-highmem-192-lssd", "c4d-highmem-384-lssd"],
41
+ "C4D standard": ["c4d-standard-2", "c4d-standard-4", "c4d-standard-8", "c4d-standard-16", "c4d-standard-32", "c4d-standard-48", "c4d-standard-64", "c4d-standard-96", "c4d-standard-192", "c4d-standard-384", "c4d-standard-384-metal2"],
42
+ "C4D standard SSD": ["c4d-standard-8-lssd", "c4d-standard-16-lssd", "c4d-standard-32-lssd", "c4d-standard-48-lssd", "c4d-standard-64-lssd", "c4d-standard-96-lssd", "c4d-standard-192-lssd", "c4d-standard-384-lssd"],
43
+ "C4 highcpu": ["c4-highcpu-2", "c4-highcpu-4", "c4-highcpu-8", "c4-highcpu-16", "c4-highcpu-24", "c4-highcpu-32", "c4-highcpu-48", "c4-highcpu-96", "c4-highcpu-144", "c4-highcpu-192", "c4-highcpu-288"],
44
+ "C4 highmem": ["c4-highmem-2", "c4-highmem-4", "c4-highmem-8", "c4-highmem-16", "c4-highmem-24", "c4-highmem-32", "c4-highmem-48", "c4-highmem-96", "c4-highmem-144", "c4-highmem-192", "c4-highmem-288", "c4-highmem-288-metal"],
45
+ "C4 highmem SSD": ["c4-highmem-4-lssd", "c4-highmem-8-lssd", "c4-highmem-16-lssd", "c4-highmem-24-lssd", "c4-highmem-32-lssd", "c4-highmem-48-lssd", "c4-highmem-96-lssd", "c4-highmem-144-lssd", "c4-highmem-192-lssd", "c4-highmem-288-lssd", "c4-highmem-288-lssd-metal"],
46
+ "C4 standard": ["c4-standard-2", "c4-standard-4", "c4-standard-8", "c4-standard-16", "c4-standard-24", "c4-standard-32", "c4-standard-48", "c4-standard-96", "c4-standard-144", "c4-standard-192", "c4-standard-288", "c4-standard-288-metal"],
47
+ "C4 standard SSD": ["c4-standard-4-lssd", "c4-standard-8-lssd", "c4-standard-16-lssd", "c4-standard-24-lssd", "c4-standard-32-lssd", "c4-standard-48-lssd", "c4-standard-96-lssd", "c4-standard-144-lssd", "c4-standard-192-lssd", "c4-standard-288-lssd", "c4-standard-288-lssd-metal"],
52
48
  "E2 highcpu": ["e2-highcpu-2", "e2-highcpu-4", "e2-highcpu-8", "e2-highcpu-16", "e2-highcpu-32"],
53
49
  "E2 highmem": ["e2-highmem-2", "e2-highmem-4", "e2-highmem-8", "e2-highmem-16"],
54
50
  "E2 sharedcore": ["e2-micro", "e2-small", "e2-medium"],
55
- "N1 standard": ["n1-standard-1", "n1-standard-2", "n1-standard-4", "n1-standard-8", "n1-standard-16", "n1-standard-32", "n1-standard-64", "n1-standard-96"],
51
+ "E2 standard": ["e2-standard-2", "e2-standard-4", "e2-standard-8", "e2-standard-16", "e2-standard-32"],
52
+ "G2": ["g2-standard-4", "g2-standard-8", "g2-standard-12", "g2-standard-16", "g2-standard-24", "g2-standard-32", "g2-standard-48", "g2-standard-96"],
53
+ "G4": ["g4-standard-48", "g4-standard-96", "g4-standard-192", "g4-standard-384"],
54
+ "H3": ["h3-standard-88"],
55
+ "H4D": ["h4d-standard-192", "h4d-highmem-192", "h4d-highmem-192-lssd"],
56
+ "M1": ["m1-ultramem-40", "m1-ultramem-80", "m1-ultramem-160", "m1-megamem-96"],
57
+ "M2": ["m2-ultramem-208", "m2-ultramem-416", "m2-megamem-416", "m2-hypermem-416"],
58
+ "M3": ["m3-ultramem-32", "m3-ultramem-64", "m3-ultramem-128", "m3-megamem-64", "m3-megamem-128"],
59
+ "M4": ["m4-hypermem-16", "m4-hypermem-32", "m4-hypermem-64", "m4-megamem-28", "m4-megamem-56", "m4-megamem-112", "m4-megamem-224", "m4-ultramem-56", "m4-ultramem-112", "m4-ultramem-224"],
56
60
  "N1 highcpu": ["n1-highcpu-2", "n1-highcpu-4", "n1-highcpu-8", "n1-highcpu-16", "n1-highcpu-32", "n1-highcpu-64", "n1-highcpu-96"],
57
61
  "N1 highmem": ["n1-highmem-2", "n1-highmem-4", "n1-highmem-8", "n1-highmem-16", "n1-highmem-32", "n1-highmem-64", "n1-highmem-96"],
58
62
  "N1 sharedcore": ["f1-micro", "g1-small"],
63
+ "N1 standard": ["n1-standard-1", "n1-standard-2", "n1-standard-4", "n1-standard-8", "n1-standard-16", "n1-standard-32", "n1-standard-64", "n1-standard-96"],
64
+ "N2D highcpu": ["n2d-highcpu-2", "n2d-highcpu-4", "n2d-highcpu-8", "n2d-highcpu-16", "n2d-highcpu-32", "n2d-highcpu-48", "n2d-highcpu-64", "n2d-highcpu-80", "n2d-highcpu-96", "n2d-highcpu-128", "n2d-highcpu-224"],
65
+ "N2D highmem": ["n2d-highmem-2", "n2d-highmem-4", "n2d-highmem-8", "n2d-highmem-16", "n2d-highmem-32", "n2d-highmem-48", "n2d-highmem-64", "n2d-highmem-80", "n2d-highmem-96"],
66
+ "N2D standard": ["n2d-standard-2", "n2d-standard-4", "n2d-standard-8", "n2d-standard-16", "n2d-standard-32", "n2d-standard-48", "n2d-standard-64", "n2d-standard-80", "n2d-standard-96", "n2d-standard-128", "n2d-standard-224"],
67
+ "N2 highcpu": ["n2-highcpu-2", "n2-highcpu-4", "n2-highcpu-8", "n2-highcpu-16", "n2-highcpu-32", "n2-highcpu-48", "n2-highcpu-64", "n2-highcpu-80", "n2-highcpu-96"],
68
+ "N2 highmem": ["n2-highmem-2", "n2-highmem-4", "n2-highmem-8", "n2-highmem-16", "n2-highmem-32", "n2-highmem-48", "n2-highmem-64", "n2-highmem-80", "n2-highmem-96", "n2-highmem-128"],
69
+ "N2 standard": ["n2-standard-2", "n2-standard-4", "n2-standard-8", "n2-standard-16", "n2-standard-32", "n2-standard-48", "n2-standard-64", "n2-standard-80", "n2-standard-96", "n2-standard-128"],
70
+ "N4A highcpu": ["n4a-highcpu-1", "n4a-highcpu-2", "n4a-highcpu-4", "n4a-highcpu-8", "n4a-highcpu-16", "n4a-highcpu-32", "n4a-highcpu-48", "n4a-highcpu-64"],
71
+ "N4A highmem": ["n4a-highmem-1", "n4a-highmem-2", "n4a-highmem-4", "n4a-highmem-8", "n4a-highmem-16", "n4a-highmem-32", "n4a-highmem-48", "n4a-highmem-64"],
72
+ "N4A standard": ["n4a-standard-1", "n4a-standard-2", "n4a-standard-4", "n4a-standard-8", "n4a-standard-16", "n4a-standard-32", "n4a-standard-48", "n4a-standard-64"],
73
+ "N4D highcpu": ["n4d-highcpu-2", "n4d-highcpu-4", "n4d-highcpu-8", "n4d-highcpu-16", "n4d-highcpu-32", "n4d-highcpu-48", "n4d-highcpu-64", "n4d-highcpu-80", "n4d-highcpu-96"],
74
+ "N4D highmem": ["n4d-highmem-2", "n4d-highmem-4", "n4d-highmem-8", "n4d-highmem-16", "n4d-highmem-32", "n4d-highmem-48", "n4d-highmem-64", "n4d-highmem-80", "n4d-highmem-96"],
75
+ "N4D standard": ["n4d-standard-2", "n4d-standard-4", "n4d-standard-8", "n4d-standard-16", "n4d-standard-32", "n4d-standard-48", "n4d-standard-64", "n4d-standard-80", "n4d-standard-96"],
76
+ "N4 highcpu": ["n4-highcpu-2", "n4-highcpu-4", "n4-highcpu-8", "n4-highcpu-16", "n4-highcpu-32", "n4-highcpu-48", "n4-highcpu-64", "n4-highcpu-80"],
77
+ "N4 highmem": ["n4-highmem-2", "n4-highmem-4", "n4-highmem-8", "n4-highmem-16", "n4-highmem-32", "n4-highmem-48", "n4-highmem-64", "n4-highmem-80"],
78
+ "N4 standard": ["n4-standard-2", "n4-standard-4", "n4-standard-8", "n4-standard-16", "n4-standard-32", "n4-standard-48", "n4-standard-64", "n4-standard-80"],
59
79
  "T2A": ["t2a-standard-1", "t2a-standard-2", "t2a-standard-4", "t2a-standard-8", "t2a-standard-16", "t2a-standard-32", "t2a-standard-48"],
60
80
  "T2D": ["t2d-standard-1", "t2d-standard-2", "t2d-standard-4", "t2d-standard-8", "t2d-standard-16", "t2d-standard-32", "t2d-standard-48", "t2d-standard-60"],
61
- "Z3 standard SSD": ["z3-highmem-14-standardlssd", "z3-highmem-22-standardlssd", "z3-highmem-44-standardlssd", "z3-highmem-88-standardlssd", "z3-highmem-176-standardlssd"],
62
- "Z3 high SSD": ["z3-highmem-8-highlssd", "z3-highmem-16-highlssd", "z3-highmem-22-highlssd", "z3-highmem-32-highlssd", "z3-highmem-44-highlssd", "z3-highmem-88-highlssd", "z3-highmem-192-highlssd-metal"],
63
- "H4D": ["h4d-standard-192", "h4d-highmem-192", "h4d-highmem-192-lssd"],
64
- "H3": ["h3-standard-88"],
65
- "C2D standard": ["c2d-standard-2", "c2d-standard-4", "c2d-standard-8", "c2d-standard-16", "c2d-standard-32", "c2d-standard-56", "c2d-standard-112"],
66
- "C2D highcpu": ["c2d-highcpu-2", "c2d-highcpu-4", "c2d-highcpu-8", "c2d-highcpu-16", "c2d-highcpu-32", "c2d-highcpu-56", "c2d-highcpu-112"],
67
- "C2D highmem": ["c2d-highmem-2", "c2d-highmem-4", "c2d-highmem-8", "c2d-highmem-16", "c2d-highmem-32", "c2d-highmem-56", "c2d-highmem-112"],
68
- "C2": ["c2-standard-4", "c2-standard-8", "c2-standard-16", "c2-standard-30", "c2-standard-60"],
69
81
  "X4": ["x4-480-6t-metal", "x4-480-8t-metal", "x4-960-12t-metal", "x4-960-16t-metal", "x4-1440-24t-metal", "x4-1920-32t-metal"],
70
- "M4": ["m4-hypermem-16", "m4-hypermem-32", "m4-hypermem-64", "m4-megamem-28", "m4-megamem-56", "m4-megamem-112", "m4-megamem-224", "m4-ultramem-56", "m4-ultramem-112", "m4-ultramem-224"],
71
- "M3": ["m3-ultramem-32", "m3-ultramem-64", "m3-ultramem-128", "m3-megamem-64", "m3-megamem-128"],
72
- "M2": ["m2-ultramem-208", "m2-ultramem-416", "m2-megamem-416", "m2-hypermem-416"],
73
- "M1": ["m1-ultramem-40", "m1-ultramem-80", "m1-ultramem-160", "m1-megamem-96"],
74
- "A4X": ["a4x-highgpu-4g"],
75
- "A4": ["a4-highgpu-8g"],
76
- "A3 ultra": ["a3-ultragpu-8g"],
77
- "A3 mega": ["a3-megagpu-8g"],
78
- "A3 high": ["a3-highgpu-1g", "a3-highgpu-2g", "a3-highgpu-4g", "a3-highgpu-8g"],
79
- "A3 edge": ["a3-edgegpu-8g"],
80
- "A2 ultra": ["a2-ultragpu-1g", "a2-ultragpu-2g", "a2-ultragpu-4g", "a2-ultragpu-8g"],
81
- "A2 standard": ["a2-highgpu-1g", "a2-highgpu-2g", "a2-highgpu-4g", "a2-highgpu-8g", "a2-megagpu-16g"],
82
- "G4": ["g4-standard-48", "g4-standard-96", "g4-standard-192", "g4-standard-384"],
83
- "G2": ["g2-standard-4", "g2-standard-8", "g2-standard-12", "g2-standard-16", "g2-standard-24", "g2-standard-32", "g2-standard-48", "g2-standard-96"],
82
+ "Z3 high SSD": ["z3-highmem-8-highlssd", "z3-highmem-16-highlssd", "z3-highmem-22-highlssd", "z3-highmem-32-highlssd", "z3-highmem-44-highlssd", "z3-highmem-88-highlssd", "z3-highmem-192-highlssd-metal"],
83
+ "Z3 standard SSD": ["z3-highmem-14-standardlssd", "z3-highmem-22-standardlssd", "z3-highmem-44-standardlssd", "z3-highmem-88-standardlssd", "z3-highmem-176-standardlssd"],
84
84
  };
85
85
  const GCP_INSTANCE_TYPES = flatten(Object.values(GCP_INSTANCE_TYPES_BY_FAMILY));
86
86
  /**
@@ -88,17 +88,17 @@ const GCP_INSTANCE_TYPES = flatten(Object.values(GCP_INSTANCE_TYPES_BY_FAMILY));
88
88
  */
89
89
  // prettier-ignore
90
90
  const GCP_GPU_MACHINE_TYPES_BY_FAMILY = {
91
- "NVIDIA T4": ["nvidia-tesla-t4", "nvidia-tesla-t4-vws"],
92
- "NVIDIA P4": ["nvidia-tesla-p4", "nvidia-tesla-p4-vws"],
93
- "NVIDIA V100": ["nvidia-tesla-v100"],
94
- "NVIDIA P100": ["nvidia-tesla-p100", "nvidia-tesla-p100-vws"],
95
- "NVIDIA RTX PRO 6000": ["nvidia-rtx-pro-6000", "nvidia-rtx-pro-6000-vws"],
96
- "NVIDIA L4": ["nvidia-l4", "nvidia-l4-vws"],
97
- "NVIDIA GB200 Superchips": ["nvidia-gb200"],
91
+ "NVIDIA A100": ["nvidia-a100-80gb", "nvidia-a100-40gb"],
98
92
  "NVIDIA B200": ["nvidia-b200"],
99
- "NVIDIA H200": ["nvidia-h200-141gb"],
93
+ "NVIDIA GB200 Superchips": ["nvidia-gb200"],
100
94
  "NVIDIA H100": ["nvidia-h100-mega-80gb", "nvidia-h100-80gb"],
101
- "NVIDIA A100": ["nvidia-a100-80gb", "nvidia-a100-40gb"],
95
+ "NVIDIA H200": ["nvidia-h200-141gb"],
96
+ "NVIDIA L4": ["nvidia-l4", "nvidia-l4-vws"],
97
+ "NVIDIA P100": ["nvidia-tesla-p100", "nvidia-tesla-p100-vws"],
98
+ "NVIDIA P4": ["nvidia-tesla-p4", "nvidia-tesla-p4-vws"],
99
+ "NVIDIA RTX PRO 6000": ["nvidia-rtx-pro-6000", "nvidia-rtx-pro-6000-vws"],
100
+ "NVIDIA T4": ["nvidia-tesla-t4", "nvidia-tesla-t4-vws"],
101
+ "NVIDIA V100": ["nvidia-tesla-v100"],
102
102
  };
103
103
  const GCP_GPU_MACHINE_TYPES = flatten(Object.values(GCP_GPU_MACHINE_TYPES_BY_FAMILY));
104
104
  /**
@@ -1,4 +1,6 @@
1
1
  const HelpMessages = {
2
2
  RequiresGhCli: `Requires the \`gh\` CLI to be installed. To install, run \`brew install gh\`.`,
3
+ RequiresGlabCli: `Requires the \`glab\` CLI to be installed. To install, run \`brew install glab\`.`,
4
+ RequiresVcsCLI: `Requires the \`gh\` or \`glab\` CLI to be installed. To install, run \`brew install gh|glab\`.`,
3
5
  };
4
6
  export { HelpMessages };
@@ -1,6 +1,6 @@
1
1
  const Providers = {
2
2
  AWS: "aws",
3
- GCP: "gcp",
4
3
  Azure: "azure",
4
+ GCP: "gcp",
5
5
  };
6
6
  export { Providers };
@@ -0,0 +1,5 @@
1
+ const VcsProviders = {
2
+ GitHub: "github",
3
+ GitLab: "gitlab",
4
+ };
5
+ export { VcsProviders };
@@ -0,0 +1,5 @@
1
+ const generate = {
2
+ description: "Commands for generating terraform files.",
3
+ name: "generate",
4
+ };
5
+ export { generate };
@@ -0,0 +1,6 @@
1
+ import { HelpMessages } from "../enums/help-messages.js";
2
+ const gh = {
3
+ description: `Utility commands that wrap the \`gh\` CLI. ${HelpMessages.RequiresGhCli}`,
4
+ name: "gh",
5
+ };
6
+ export { gh };
@@ -0,0 +1,6 @@
1
+ import { HelpMessages } from "../enums/help-messages.js";
2
+ const glab = {
3
+ description: `Utility commands that wrap the \`glab\` CLI. ${HelpMessages.RequiresGlabCli}`,
4
+ name: "glab",
5
+ };
6
+ export { glab };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,50 @@
1
+ import { confirm } from "@inquirer/prompts";
1
2
  import { Command, loadHelpClass } from "@oclif/core";
3
+ import { isEmpty } from "lodash-es";
4
+ import path from "path";
5
+ import { RepoUtils } from "./repo-utils.js";
2
6
  class BaseCommand extends Command {
7
+ async cloneRepos(options) {
8
+ const { cloneRepo, directory: directoryOption, listRepos, prefix, } = options;
9
+ const allRepos = await listRepos();
10
+ const repos = allRepos.filter((repo) => repo.name.startsWith(prefix));
11
+ if (isEmpty(repos)) {
12
+ this.log(`Repos found:\n${RepoUtils.stringifyRepos(allRepos)}`);
13
+ this.log(`No repos found with prefix '${prefix}'`);
14
+ this.exit();
15
+ }
16
+ this.log(`Repos to clone:\n${RepoUtils.stringifyRepos(repos)}`);
17
+ const confirmation = await confirm({
18
+ message: "Continue with cloning these repos?",
19
+ });
20
+ if (!confirmation) {
21
+ return;
22
+ }
23
+ for (const repo of repos) {
24
+ const directory = path.resolve(process.cwd(), directoryOption, repo.name);
25
+ await cloneRepo({ directory, repo });
26
+ }
27
+ }
28
+ async deleteRepos(options) {
29
+ const { deleteRepo, listRepos, prefix } = options;
30
+ const allRepos = await listRepos();
31
+ const repos = allRepos.filter((repo) => repo.name.startsWith(prefix));
32
+ if (isEmpty(repos)) {
33
+ this.log(`Repos found:\n${RepoUtils.stringifyRepos(allRepos)}`);
34
+ this.log(`No repos found with prefix '${prefix}'`);
35
+ this.exit();
36
+ }
37
+ this.log(`Repos to delete:\n${RepoUtils.stringifyRepos(repos)}`);
38
+ const confirmation = await confirm({
39
+ message: "Continue with deletion of these repos?",
40
+ });
41
+ if (!confirmation) {
42
+ return;
43
+ }
44
+ for (const repo of repos) {
45
+ await deleteRepo({ repo });
46
+ }
47
+ }
3
48
  async showHelp() {
4
49
  const HelpClass = await loadHelpClass(this.config);
5
50
  const help = new HelpClass(this.config);
@@ -1,25 +1,39 @@
1
1
  import { Flags } from "@oclif/core";
2
- import { Providers } from "../enums/providers.js";
3
2
  import { DEFAULT_TAGS } from "../constants/tags.js";
4
- import { parseTagString, stringifyTags } from "./tag-utils.js";
3
+ import { Providers } from "../enums/providers.js";
4
+ import { VcsProviders } from "../enums/vcs-providers.js";
5
+ import { parseTags, stringifyTags } from "./tag-utils.js";
5
6
  const formatFlag = Flags.boolean({
7
+ allowNo: true,
6
8
  char: "f",
7
- description: "Format the output terraform files. Requires `terraform` to be in your $PATH.",
8
9
  default: true,
9
- allowNo: true,
10
+ description: "Format the output terraform files. Requires `terraform` to be in your $PATH.",
10
11
  });
11
12
  const quietFlag = Flags.boolean({
12
13
  char: "q",
13
14
  description: "Suppress the logging output.",
14
15
  });
15
16
  const resourceCountFlag = Flags.integer({
16
- description: "Number of resources per file to generate",
17
17
  default: 3,
18
+ description: "Number of resources per file to generate",
18
19
  });
19
20
  const providerFlag = Flags.string({
20
21
  description: "Cloud provider to generate resources for",
21
22
  options: Object.values(Providers),
22
23
  });
24
+ const vcsProviderFlag = Flags.string({
25
+ default: VcsProviders.GitHub,
26
+ description: "Remote version control system to interact with",
27
+ options: Object.values(VcsProviders),
28
+ });
29
+ const requiredPrefixFlag = Flags.string({
30
+ description: "Prefix for the repos, such as 'tf_'",
31
+ required: true,
32
+ });
33
+ const directoryFlag = Flags.string({
34
+ default: ".",
35
+ description: "Directory to create the repo(s) in",
36
+ });
23
37
  const TAGS_WITH_VALUES = {
24
38
  Service: "web-app",
25
39
  Team: "core",
@@ -44,7 +58,7 @@ When specifying a key or value that has a space in it, the entire tag string nee
44
58
  --tags "${stringifyTags(TAGS_WITH_SPACES)}" → ${JSON.stringify(TAGS_WITH_SPACES)}
45
59
  `,
46
60
  exclusive: ["chaos-tags", "no-tags"],
47
- parse: async (input) => parseTagString(input),
61
+ parse: async (input) => parseTags(input),
48
62
  });
49
63
  const noTagsFlag = Flags.boolean({
50
64
  description: "Disable any tag generation",
@@ -59,7 +73,7 @@ const chaosTagsFlag = Flags.boolean({
59
73
  * flag configurations.
60
74
  */
61
75
  const getTagsOption = (flags) => {
62
- const { "no-tags": noTags, "chaos-tags": chaosTags } = flags;
76
+ const { "chaos-tags": chaosTags, "no-tags": noTags } = flags;
63
77
  let tags = flags.tags ?? DEFAULT_TAGS;
64
78
  if (chaosTags) {
65
79
  tags = "chaos";
@@ -69,4 +83,4 @@ const getTagsOption = (flags) => {
69
83
  }
70
84
  return tags;
71
85
  };
72
- export { chaosTagsFlag, formatFlag, getTagsOption, noTagsFlag, providerFlag, quietFlag, resourceCountFlag, tagsFlag, };
86
+ export { chaosTagsFlag, directoryFlag, formatFlag, getTagsOption, noTagsFlag, providerFlag, quietFlag, requiredPrefixFlag, resourceCountFlag, tagsFlag, vcsProviderFlag, };
@@ -6,9 +6,8 @@ const AwsResourceType = {
6
6
  LambdaFunction: "aws_lambda_function",
7
7
  };
8
8
  class AwsGenerator extends ProviderGenerator {
9
- addProvider() {
10
- this.tfg.provider("aws", { region: this.region });
11
- }
9
+ randomAmi = unique(() => `ami-${randomId()}`);
10
+ randomRole = unique(() => `arn:aws:iam::${randomId()}:mfa/${randomMemorableSlug()}`);
12
11
  addComputeInstance() {
13
12
  const name = randomMemorableSlug();
14
13
  const ami = this.randomAmi();
@@ -17,8 +16,8 @@ class AwsGenerator extends ProviderGenerator {
17
16
  ? {
18
17
  root_block_device: {
19
18
  volume_size: randomMemorySize({
20
- min: 1024,
21
19
  max: 64 * 1024 * 1024,
20
+ min: 1024,
22
21
  step: 1024,
23
22
  }),
24
23
  volume_type: randomItem(AWS_EBS_VOLUME_TYPES),
@@ -29,7 +28,7 @@ class AwsGenerator extends ProviderGenerator {
29
28
  ami,
30
29
  instance_type: instanceType,
31
30
  ...rootBlockDevice,
32
- tags: this.getTags(),
31
+ ...this.getTagsBlock(),
33
32
  });
34
33
  return this;
35
34
  }
@@ -37,8 +36,8 @@ class AwsGenerator extends ProviderGenerator {
37
36
  const name = randomMemorableSlug();
38
37
  // https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html
39
38
  const memorySize = randomMemorySize({
40
- min: 128,
41
39
  max: 10240,
40
+ min: 128,
42
41
  step: 128,
43
42
  });
44
43
  const ami = this.randomAmi();
@@ -48,19 +47,20 @@ class AwsGenerator extends ProviderGenerator {
48
47
  const handler = `${randomItem(["exports", "index"])}.${functionName}`;
49
48
  this.tfg.resource(AwsResourceType.LambdaFunction, name, {
50
49
  ami,
51
- runtime,
52
- handler,
53
50
  function_name: functionName,
51
+ handler,
54
52
  memory_size: memorySize,
55
53
  role,
56
- tags: this.getTags(),
54
+ runtime,
55
+ ...this.getTagsBlock(),
57
56
  });
58
57
  return this;
59
58
  }
59
+ addProvider() {
60
+ this.tfg.provider("aws", { region: this.region });
61
+ }
60
62
  randomRegion() {
61
63
  return randomItem(AWS_REGIONS);
62
64
  }
63
- randomAmi = unique(() => `ami-${randomId()}`);
64
- randomRole = unique(() => `arn:aws:iam::${randomId()}:mfa/${randomMemorableSlug()}`);
65
65
  }
66
66
  export { AwsGenerator };
@@ -6,15 +6,12 @@ const AzureResourceType = {
6
6
  LambdaFunction: "azurerm_linux_function_app",
7
7
  };
8
8
  class AzureGenerator extends ProviderGenerator {
9
- addProvider() {
10
- this.tfg.provider("azurerm", { region: this.region });
11
- }
12
9
  addComputeInstance() {
13
10
  const name = randomMemorableSlug();
14
11
  const instanceType = randomItem(AZURE_INSTANCE_TYPES);
15
12
  this.tfg.resource(AzureResourceType.ComputeInstance, name, {
16
13
  size: instanceType,
17
- tags: this.getTags(),
14
+ ...this.getTagsBlock(),
18
15
  });
19
16
  return this;
20
17
  }
@@ -24,18 +21,21 @@ class AzureGenerator extends ProviderGenerator {
24
21
  // There's a lot of different configurations listed, so just guessing here.
25
22
  // https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale
26
23
  const instanceMemoryInMb = randomMemorySize({
27
- min: 128,
28
24
  max: 4 * 1024,
25
+ min: 128,
29
26
  step: 128,
30
27
  });
31
28
  this.tfg.resource(AzureResourceType.LambdaFunction, name, {
32
29
  ...runtime,
33
- name,
34
30
  instance_memory_in_mb: instanceMemoryInMb,
35
- tags: this.getTags(),
31
+ name,
32
+ ...this.getTagsBlock(),
36
33
  });
37
34
  return this;
38
35
  }
36
+ addProvider() {
37
+ this.tfg.provider("azurerm", { region: this.region });
38
+ }
39
39
  randomRegion() {
40
40
  return randomItem(AZURE_REGIONS);
41
41
  }
@@ -2,12 +2,12 @@ import { randomProvider } from "./generator-utils.js";
2
2
  import { ProviderGeneratorFactory } from "./provider-generator-factory.js";
3
3
  class FileGenerator {
4
4
  static generate(options) {
5
- const { provider = randomProvider(), resourceCount = 3, fileName, directory, format, tags, } = options;
5
+ const { directory, fileName, format, provider = randomProvider(), resourceCount = 3, tags, } = options;
6
6
  const generator = ProviderGeneratorFactory.get(provider, { tags });
7
7
  for (let i = 0; i < resourceCount; i++) {
8
8
  generator.addRandomResource();
9
9
  }
10
- generator.writeToFile({ fileName, directory, format });
10
+ generator.writeToFile({ directory, fileName, format });
11
11
  }
12
12
  }
13
13
  export { FileGenerator };
@@ -6,8 +6,9 @@ const GcpResourceType = {
6
6
  LambdaFunction: "google_cloudfunctions_function",
7
7
  };
8
8
  class GcpGenerator extends ProviderGenerator {
9
- addProvider() {
10
- this.tfg.provider("google", { region: this.region });
9
+ constructor(options) {
10
+ super(options);
11
+ this.tagKey = "labels";
11
12
  }
12
13
  addComputeInstance() {
13
14
  const name = randomMemorableSlug();
@@ -15,16 +16,16 @@ class GcpGenerator extends ProviderGenerator {
15
16
  const guestAccelerator = maybe(0.5)
16
17
  ? {
17
18
  guest_accelerator: {
19
+ count: randomInt({ max: 4, min: 1 }),
18
20
  type: randomItem(GCP_GPU_MACHINE_TYPES),
19
- count: randomInt({ min: 1, max: 4 }),
20
21
  },
21
22
  }
22
23
  : {};
23
24
  this.tfg.resource(GcpResourceType.ComputeInstance, name, {
24
- zone: this.region,
25
25
  machine_type: machineType,
26
+ zone: this.region,
26
27
  ...guestAccelerator,
27
- labels: this.getTags(),
28
+ ...this.getTagsBlock(),
28
29
  });
29
30
  return this;
30
31
  }
@@ -33,18 +34,21 @@ class GcpGenerator extends ProviderGenerator {
33
34
  const runtime = randomItem(GCP_LAMBDA_RUNTIMES);
34
35
  // @see https://docs.cloud.google.com/run/docs/configuring/services/memory-limits
35
36
  const availableMemoryMb = randomMemorySize({
36
- min: 128,
37
37
  max: 32 * 1024,
38
+ min: 128,
38
39
  step: 128,
39
40
  });
40
41
  this.tfg.resource(GcpResourceType.LambdaFunction, name, {
41
- runtime,
42
- name,
43
42
  available_memory_mb: availableMemoryMb,
44
- labels: this.getTags(),
43
+ name,
44
+ runtime,
45
+ ...this.getTagsBlock(),
45
46
  });
46
47
  return this;
47
48
  }
49
+ addProvider() {
50
+ this.tfg.provider("google", { region: this.region });
51
+ }
48
52
  randomRegion() {
49
53
  return randomItem(GCP_REGIONS);
50
54
  }
@@ -1,8 +1,8 @@
1
1
  import { faker } from "@faker-js/faker";
2
- import { snakeSlugify } from "../string-utils.js";
2
+ import { range } from "lodash-es";
3
3
  import { ENVIRONMENT_TAGS, SERVICE_TAGS, TAG_KEYS, } from "../../constants/tags.js";
4
4
  import { Providers } from "../../enums/providers.js";
5
- import { range } from "lodash-es";
5
+ import { snakeSlugify } from "../string-utils.js";
6
6
  const MAX_UNIQUE_GENERATOR_ATTEMPTS = 50;
7
7
  /**
8
8
  * Wraps a generator function to ensure the values it returns are not reused within the program runtime
@@ -31,7 +31,7 @@ const randomId = unique(() => faker.internet.mac({ separator: "" }));
31
31
  const randomEnvironmentTag = () => randomItem(ENVIRONMENT_TAGS);
32
32
  const randomServiceTag = () => randomItem(SERVICE_TAGS);
33
33
  const randomTags = (additionalTags) => {
34
- const keys = randomItems(TAG_KEYS, { min: 1, max: 4 });
34
+ const keys = randomItems(TAG_KEYS, { max: 4, min: 1 });
35
35
  const tags = keys.reduce((accumulated, key) => {
36
36
  accumulated[key] = randomMemorableSlug();
37
37
  return accumulated;
@@ -39,12 +39,12 @@ const randomTags = (additionalTags) => {
39
39
  return { ...tags, ...additionalTags };
40
40
  };
41
41
  const randomMemorySize = (options) => {
42
- const { min, max, step } = options;
42
+ const { max, min, step } = options;
43
43
  const values = range(min, max, step);
44
44
  return randomItem(values);
45
45
  };
46
46
  const randomInt = (options) => {
47
- let { min = 0, max = 100 } = options;
47
+ let { max = 100, min = 0 } = options;
48
48
  min = Math.ceil(min);
49
49
  max = Math.floor(max);
50
50
  return Math.floor(Math.random() * (max - min + 1)) + min;