terrafaker 0.0.1 → 0.0.5

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 +20 -10
  2. package/dist/constants/azure.js +12 -12
  3. package/dist/utilities/generators/aws-generator.js +4 -2
  4. package/dist/utilities/generators/azure-generator.js +6 -5
  5. package/dist/utilities/generators/gcp-generator.js +5 -2
  6. package/dist/utilities/generators/generator-utils.js +7 -1
  7. package/dist/utilities/generators/provider-generator.js +6 -0
  8. package/oclif.manifest.json +1 -1
  9. package/package.json +8 -12
  10. package/dist/commands/generate/file.d.ts +0 -13
  11. package/dist/commands/generate/index.d.ts +0 -7
  12. package/dist/commands/generate/repo.d.ts +0 -18
  13. package/dist/commands/gh/clone-repos.d.ts +0 -10
  14. package/dist/commands/gh/delete-repos.d.ts +0 -9
  15. package/dist/commands/gh/index.d.ts +0 -7
  16. package/dist/commands/util/format-psv.d.ts +0 -10
  17. package/dist/commands/util/format-tsv.d.ts +0 -13
  18. package/dist/commands/util/index.d.ts +0 -7
  19. package/dist/constants/aws.d.ts +0 -192
  20. package/dist/constants/azure.d.ts +0 -138
  21. package/dist/constants/gcp.d.ts +0 -88
  22. package/dist/constants/tags.d.ts +0 -5
  23. package/dist/enums/help-messages.d.ts +0 -4
  24. package/dist/enums/providers.d.ts +0 -9
  25. package/dist/enums/resource-types.d.ts +0 -11
  26. package/dist/index.d.ts +0 -1
  27. package/dist/types/object-values.d.ts +0 -2
  28. package/dist/utilities/base-command.d.ts +0 -5
  29. package/dist/utilities/flags.d.ts +0 -5
  30. package/dist/utilities/generators/aws-generator.d.ts +0 -9
  31. package/dist/utilities/generators/azure-generator.d.ts +0 -7
  32. package/dist/utilities/generators/file-generator.d.ts +0 -12
  33. package/dist/utilities/generators/gcp-generator.d.ts +0 -7
  34. package/dist/utilities/generators/generator-utils.d.ts +0 -25
  35. package/dist/utilities/generators/provider-generator-factory.d.ts +0 -8
  36. package/dist/utilities/generators/provider-generator.d.ts +0 -22
  37. package/dist/utilities/generators/repo-generator.d.ts +0 -39
  38. package/dist/utilities/github.d.ts +0 -8
  39. package/dist/utilities/string-utils.d.ts +0 -6
package/README.md CHANGED
@@ -6,9 +6,11 @@ CLI for easily generating fake terraform files and repos
6
6
  [![Version](https://img.shields.io/npm/v/terrafaker.svg)](https://npmjs.org/package/terrafaker)
7
7
  [![Downloads/week](https://img.shields.io/npm/dw/terrafaker.svg)](https://npmjs.org/package/terrafaker)
8
8
 
9
- ## Why this exists
9
+ ## Goals
10
10
 
11
- This tool mostly exists to quickly seed data for testing out platforms that rely on infrastructure-as-code, like [Infracost](https://www.infracost.io/). If you find it useful, or there's a feature you'd like to see, feel free to open up an [issue](https://github.com/brandongregoryscott/terrafaker/issues).
11
+ The primary goal of this tool is to quickly generate seed data for testing out platforms that use infrastructure-as-code, like [Infracost](https://www.infracost.io/). The data used to generate the infrastructure configurations is based on public cloud provider docs, but there is no guarantee that the configurations are valid. For example, only some Azure VMs support _accelerators_ or GPU add-ons, but this tool does not encode any of that logic.
12
+
13
+ Obviously, you shouldn't use this tool to try to generate real production infrastructure.
12
14
 
13
15
  ## Features
14
16
 
@@ -19,12 +21,20 @@ This tool mostly exists to quickly seed data for testing out platforms that rely
19
21
  ### Supported providers and resources
20
22
 
21
23
  - AWS
22
- - EC2 instances
23
- - Lambda functions
24
+ - Compute instances
25
+ - Functions
24
26
  - GCP
25
27
  - Compute instances
26
28
  - Functions
27
- - TODO: Azure
29
+ - Azure
30
+ - Compute instances
31
+ - Functions
32
+
33
+ ## Issues
34
+
35
+ If you find a bug, feel free to [open up an issue](https://github.com/brandongregoryscott/terrafaker/issues/new) and try to describe it in detail with reproduction steps if possible.
36
+
37
+ If you would like to see a feature, and it isn't [already documented](https://github.com/brandongregoryscott/terrafaker/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement), feel free to open up a new issue and describe the desired behavior.
28
38
 
29
39
  <!-- prettier-ignore-start -->
30
40
  <!-- toc -->
@@ -41,7 +51,7 @@ $ npm install -g terrafaker
41
51
  $ terrafaker COMMAND
42
52
  running command...
43
53
  $ terrafaker (--version)
44
- terrafaker/0.0.1 darwin-arm64 node-v24.8.0
54
+ terrafaker/0.0.5 darwin-arm64 node-v24.8.0
45
55
  $ terrafaker --help [COMMAND]
46
56
  USAGE
47
57
  $ terrafaker COMMAND
@@ -78,7 +88,7 @@ DESCRIPTION
78
88
  Generates a terraform file.
79
89
  ```
80
90
 
81
- _See code: [src/commands/generate/file.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.1/src/commands/generate/file.ts)_
91
+ _See code: [src/commands/generate/file.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.5/src/commands/generate/file.ts)_
82
92
 
83
93
  ## `terrafaker generate repo`
84
94
 
@@ -107,7 +117,7 @@ DESCRIPTION
107
117
  Generates repo(s) with multiple terraform files.
108
118
  ```
109
119
 
110
- _See code: [src/commands/generate/repo.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.1/src/commands/generate/repo.ts)_
120
+ _See code: [src/commands/generate/repo.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.5/src/commands/generate/repo.ts)_
111
121
 
112
122
  ## `terrafaker gh clone-repos`
113
123
 
@@ -126,7 +136,7 @@ DESCRIPTION
126
136
  `gh` CLI to be installed. To install, run `brew install gh`.
127
137
  ```
128
138
 
129
- _See code: [src/commands/gh/clone-repos.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.1/src/commands/gh/clone-repos.ts)_
139
+ _See code: [src/commands/gh/clone-repos.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.5/src/commands/gh/clone-repos.ts)_
130
140
 
131
141
  ## `terrafaker gh delete-repos`
132
142
 
@@ -146,7 +156,7 @@ DESCRIPTION
146
156
  If the deletion fails, you may need to refresh your CLI permissions with `gh auth refresh -s delete_repo`
147
157
  ```
148
158
 
149
- _See code: [src/commands/gh/delete-repos.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.1/src/commands/gh/delete-repos.ts)_
159
+ _See code: [src/commands/gh/delete-repos.ts](https://github.com/brandongregoryscott/terrafaker/blob/v0.0.5/src/commands/gh/delete-repos.ts)_
150
160
 
151
161
  ## `terrafaker help [COMMAND]`
152
162
 
@@ -137,51 +137,51 @@ const AZURE_INSTANCE_TYPES = flatten(Object.values(AZURE_INSTANCE_TYPES_BY_FAMIL
137
137
  const AZURE_LAMBDA_RUNTIMES = [
138
138
  {
139
139
  runtime_name: "dotnet-isolated",
140
- runtime_verison: "8",
140
+ runtime_version: "8",
141
141
  },
142
142
  {
143
143
  runtime_name: "dotnet-isolated",
144
- runtime_verison: "9",
144
+ runtime_version: "9",
145
145
  },
146
146
  {
147
147
  runtime_name: "dotnet-isolated",
148
- runtime_verison: "10",
148
+ runtime_version: "10",
149
149
  },
150
150
  {
151
151
  runtime_name: "java",
152
- runtime_verison: "11",
152
+ runtime_version: "11",
153
153
  },
154
154
  {
155
155
  runtime_name: "java",
156
- runtime_verison: "17",
156
+ runtime_version: "17",
157
157
  },
158
158
  {
159
159
  runtime_name: "java",
160
- runtime_verison: "21",
160
+ runtime_version: "21",
161
161
  },
162
162
  {
163
163
  runtime_name: "node",
164
- runtime_verison: "20",
164
+ runtime_version: "20",
165
165
  },
166
166
  {
167
167
  runtime_name: "node",
168
- runtime_verison: "22",
168
+ runtime_version: "22",
169
169
  },
170
170
  {
171
171
  runtime_name: "powershell",
172
- runtime_verison: "7.4",
172
+ runtime_version: "7.4",
173
173
  },
174
174
  {
175
175
  runtime_name: "python",
176
- runtime_verison: "3.10",
176
+ runtime_version: "3.10",
177
177
  },
178
178
  {
179
179
  runtime_name: "python",
180
- runtime_verison: "3.11",
180
+ runtime_version: "3.11",
181
181
  },
182
182
  {
183
183
  runtime_name: "python",
184
- runtime_verison: "3.12",
184
+ runtime_version: "3.12",
185
185
  },
186
186
  ];
187
187
  export { AZURE_INSTANCE_TYPES, AZURE_INSTANCE_TYPES_BY_FAMILY, AZURE_LAMBDA_RUNTIMES, AZURE_REGIONS, };
@@ -7,8 +7,7 @@ const AwsResourceType = {
7
7
  };
8
8
  class AwsGenerator extends ProviderGenerator {
9
9
  addProvider() {
10
- const region = randomItem(AWS_REGIONS);
11
- this.tfg.provider("aws", { region });
10
+ this.tfg.provider("aws", { region: this.region });
12
11
  }
13
12
  addComputeInstance() {
14
13
  const name = randomMemorableSlug();
@@ -62,6 +61,9 @@ class AwsGenerator extends ProviderGenerator {
62
61
  });
63
62
  return this;
64
63
  }
64
+ randomRegion() {
65
+ return randomItem(AWS_REGIONS);
66
+ }
65
67
  randomAmi = unique(() => `ami-${randomId()}`);
66
68
  randomRole = unique(() => `arn:aws:iam::${randomId()}:mfa/${randomMemorableSlug()}`);
67
69
  }
@@ -1,5 +1,4 @@
1
- import { AWS_INSTANCE_TYPES } from "../../constants/aws.js";
2
- import { AZURE_LAMBDA_RUNTIMES, AZURE_REGIONS } from "../../constants/azure.js";
1
+ import { AZURE_INSTANCE_TYPES, AZURE_LAMBDA_RUNTIMES, AZURE_REGIONS, } from "../../constants/azure.js";
3
2
  import { randomEnvironmentTag, randomItem, randomMemorableSlug, randomMemorySize, randomServiceTag, } from "./generator-utils.js";
4
3
  import { ProviderGenerator } from "./provider-generator.js";
5
4
  const AzureResourceType = {
@@ -8,14 +7,13 @@ const AzureResourceType = {
8
7
  };
9
8
  class AzureGenerator extends ProviderGenerator {
10
9
  addProvider() {
11
- const region = randomItem(AZURE_REGIONS);
12
- this.tfg.provider("azurerm", { region });
10
+ this.tfg.provider("azurerm", { region: this.region });
13
11
  }
14
12
  addComputeInstance() {
15
13
  const name = randomMemorableSlug();
16
14
  const environment = randomEnvironmentTag();
17
15
  const service = randomServiceTag();
18
- const instanceType = randomItem(AWS_INSTANCE_TYPES);
16
+ const instanceType = randomItem(AZURE_INSTANCE_TYPES);
19
17
  this.tfg.resource(AzureResourceType.ComputeInstance, name, {
20
18
  size: instanceType,
21
19
  tags: { name, environment, service },
@@ -42,5 +40,8 @@ class AzureGenerator extends ProviderGenerator {
42
40
  });
43
41
  return this;
44
42
  }
43
+ randomRegion() {
44
+ return randomItem(AZURE_REGIONS);
45
+ }
45
46
  }
46
47
  export { AzureGenerator };
@@ -7,8 +7,7 @@ const GcpResourceType = {
7
7
  };
8
8
  class GcpGenerator extends ProviderGenerator {
9
9
  addProvider() {
10
- const region = randomItem(GCP_REGIONS);
11
- this.tfg.provider("google", { region });
10
+ this.tfg.provider("google", { region: this.region });
12
11
  }
13
12
  addComputeInstance() {
14
13
  const name = randomMemorableSlug();
@@ -24,6 +23,7 @@ class GcpGenerator extends ProviderGenerator {
24
23
  }
25
24
  : {};
26
25
  this.tfg.resource(GcpResourceType.ComputeInstance, name, {
26
+ zone: this.region,
27
27
  machine_type: machineType,
28
28
  ...guestAccelerator,
29
29
  labels: { name, environment, service },
@@ -49,5 +49,8 @@ class GcpGenerator extends ProviderGenerator {
49
49
  });
50
50
  return this;
51
51
  }
52
+ randomRegion() {
53
+ return randomItem(GCP_REGIONS);
54
+ }
52
55
  }
53
56
  export { GcpGenerator };
@@ -3,6 +3,7 @@ import { snakeSlugify } from "../string-utils.js";
3
3
  import { ENVIRONMENT_TAGS, SERVICE_TAGS } from "../../constants/tags.js";
4
4
  import { Providers } from "../../enums/providers.js";
5
5
  import { range } from "lodash-es";
6
+ const MAX_UNIQUE_GENERATOR_ATTEMPTS = 50;
6
7
  /**
7
8
  * Wraps a generator function to ensure the values it returns are not reused within the program runtime
8
9
  */
@@ -10,9 +11,14 @@ function unique(generator) {
10
11
  const used = new Set();
11
12
  return () => {
12
13
  let value = generator();
13
- while (used.has(value)) {
14
+ let attempts = 0;
15
+ while (used.has(value) && attempts < MAX_UNIQUE_GENERATOR_ATTEMPTS) {
16
+ attempts++;
14
17
  value = generator();
15
18
  }
19
+ if (used.has(value)) {
20
+ value = `${value}${randomId()}`;
21
+ }
16
22
  used.add(value);
17
23
  return value;
18
24
  };
@@ -4,8 +4,10 @@ import { randomItem, randomMemorableSlug } from "./generator-utils.js";
4
4
  import { formatTfFileName } from "../string-utils.js";
5
5
  class ProviderGenerator {
6
6
  tfg;
7
+ region;
7
8
  constructor() {
8
9
  this.tfg = new TerraformGenerator();
10
+ this.region = this.randomRegion();
9
11
  this.addProvider();
10
12
  }
11
13
  addResourceByType(type) {
@@ -22,6 +24,10 @@ class ProviderGenerator {
22
24
  const type = randomItem(Object.values(ResourceTypes));
23
25
  return this.addResourceByType(type);
24
26
  }
27
+ toString() {
28
+ const { tf } = this.tfg.generate();
29
+ return tf.trim();
30
+ }
25
31
  writeToFile(options) {
26
32
  const { directory, format = true } = options ?? {};
27
33
  const fileName = formatTfFileName(options?.fileName ?? randomMemorableSlug());
@@ -356,5 +356,5 @@
356
356
  ]
357
357
  }
358
358
  },
359
- "version": "0.0.1"
359
+ "version": "0.0.5"
360
360
  }
package/package.json CHANGED
@@ -18,21 +18,19 @@
18
18
  "@eslint/compat": "1.4.1",
19
19
  "@oclif/test": "4.1.15",
20
20
  "@stylistic/eslint-plugin": "5.6.1",
21
- "@types/chai": "4.3.20",
22
21
  "@types/fs-extra": "11.0.4",
23
22
  "@types/lodash-es": "4.17.12",
24
- "@types/mocha": "10.0.10",
25
23
  "@types/node": "24.10.3",
26
- "chai": "4.5.0",
27
24
  "eslint": "9.39.1",
28
25
  "eslint-plugin-collation": "1.5.0",
29
- "mocha": "10.8.2",
26
+ "eslint-plugin-vitest": "0.5.4",
30
27
  "oclif": "4.22.54",
31
28
  "prettier": "3.6.1",
32
29
  "shx": "0.3.4",
33
30
  "ts-node": "10.9.2",
34
31
  "typescript": "5.9.3",
35
- "typescript-eslint": "8.49.0"
32
+ "typescript-eslint": "8.49.0",
33
+ "vitest": "4.0.15"
36
34
  },
37
35
  "engines": {
38
36
  "node": ">=18.0.0"
@@ -63,7 +61,7 @@
63
61
  "url": "git+https://github.com/brandongregoryscott/terrafaker.git"
64
62
  },
65
63
  "scripts": {
66
- "build": "npm run clean && tsc -b",
64
+ "build": "npm run clean && tsc --project tsconfig.build.json",
67
65
  "build:watch": "npm run clean && tsc --watch",
68
66
  "clean": "shx rm -rf dist tsconfig.tsbuildinfo",
69
67
  "format": "prettier . --check",
@@ -72,14 +70,12 @@
72
70
  "generate:readme": "oclif readme && prettier README.md --write",
73
71
  "lint": "eslint",
74
72
  "lint:fix": "eslint --fix",
75
- "postbuild": "npm run generate:manifest",
76
- "postpack": "shx rm -f oclif.manifest.json",
77
- "posttest": "npm run lint",
78
- "prepack": "npm run generate:manifest && npm run generate:readme",
79
- "test": "mocha --forbid-only \"test/**/*.test.ts\"",
73
+ "postbuild": "npm run generate:manifest && npm run generate:readme",
74
+ "prepack": "npm run build",
75
+ "test": "vitest",
80
76
  "version": "npm run generate:readme && git add README.md"
81
77
  },
82
78
  "type": "module",
83
79
  "types": "dist/index.d.ts",
84
- "version": "0.0.1"
80
+ "version": "0.0.5"
85
81
  }
@@ -1,13 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class File extends BaseCommand {
3
- static description: string;
4
- static flags: {
5
- name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
- provider: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
- "resource-count": import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
- format: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
- quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- };
11
- run(): Promise<void>;
12
- }
13
- export { File };
@@ -1,7 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class Generate extends BaseCommand {
3
- static hidden: boolean;
4
- static description: string;
5
- run(): Promise<void>;
6
- }
7
- export { Generate };
@@ -1,18 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class Repo extends BaseCommand {
3
- static description: string;
4
- static flags: {
5
- directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
- count: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
7
- "file-count": import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
- "resource-count": import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
9
- prefix: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
- provider: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- format: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- "create-remote": import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- public: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
- };
16
- run(): Promise<void>;
17
- }
18
- export { Repo };
@@ -1,10 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class CloneRepos extends BaseCommand {
3
- static description: string;
4
- static flags: {
5
- directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
- prefix: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
- };
8
- run(): Promise<void>;
9
- }
10
- export { CloneRepos };
@@ -1,9 +0,0 @@
1
- import { Command } from "@oclif/core";
2
- declare class DeleteRepos extends Command {
3
- static description: string;
4
- static flags: {
5
- prefix: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
- };
7
- run(): Promise<void>;
8
- }
9
- export { DeleteRepos };
@@ -1,7 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class Gh extends BaseCommand {
3
- static hidden: boolean;
4
- static description: string;
5
- run(): Promise<void>;
6
- }
7
- export { Gh };
@@ -1,10 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class FormatPsv extends BaseCommand {
3
- static hidden: boolean;
4
- static description: string;
5
- static args: {
6
- psv: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
- };
8
- run(): Promise<void>;
9
- }
10
- export { FormatPsv };
@@ -1,13 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class FormatTsv extends BaseCommand {
3
- static hidden: boolean;
4
- static description: string;
5
- static flags: {
6
- index: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
7
- };
8
- static args: {
9
- tsv: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
10
- };
11
- run(): Promise<void>;
12
- }
13
- export { FormatTsv };
@@ -1,7 +0,0 @@
1
- import { BaseCommand } from "../../utilities/base-command.js";
2
- declare class Util extends BaseCommand {
3
- static hidden: boolean;
4
- static description: string;
5
- run(): Promise<void>;
6
- }
7
- export { Util };
@@ -1,192 +0,0 @@
1
- /**
2
- * @see https://docs.aws.amazon.com/global-infrastructure/latest/regions/aws-regions.html
3
- */
4
- declare const AWS_REGIONS: string[];
5
- /**
6
- * @see https://docs.aws.amazon.com/ec2/latest/instancetypes/gp.html
7
- */
8
- declare const AWS_INSTANCE_TYPES_BY_FAMILY: {
9
- M5: string[];
10
- M5a: string[];
11
- M5ad: string[];
12
- M5d: string[];
13
- M5dn: string[];
14
- M5n: string[];
15
- M5zn: string[];
16
- M6a: string[];
17
- M6g: string[];
18
- M6gd: string[];
19
- M6i: string[];
20
- M6id: string[];
21
- M6idn: string[];
22
- M6in: string[];
23
- M7a: string[];
24
- M7g: string[];
25
- M7gd: string[];
26
- M7i: string[];
27
- "M7i-flex": string[];
28
- M8a: string[];
29
- M8g: string[];
30
- M8gd: string[];
31
- M8i: string[];
32
- "M8i-flex": string[];
33
- Mac1: string[];
34
- Mac2: string[];
35
- "Mac2-m1ultra": string[];
36
- "Mac2-m2": string[];
37
- "Mac2-m2pro": string[];
38
- "Mac-m4": string[];
39
- "Mac-m4pro": string[];
40
- T2: string[];
41
- T3: string[];
42
- T3a: string[];
43
- T4g: string[];
44
- C5: string[];
45
- C5a: string[];
46
- C5ad: string[];
47
- C5d: string[];
48
- C5n: string[];
49
- C6a: string[];
50
- C6g: string[];
51
- C6gd: string[];
52
- C6gn: string[];
53
- C6i: string[];
54
- C6id: string[];
55
- C6in: string[];
56
- C7a: string[];
57
- C7g: string[];
58
- C7gd: string[];
59
- C7gn: string[];
60
- C7i: string[];
61
- "C7i-flex": string[];
62
- C8a: string[];
63
- C8g: string[];
64
- C8gb: string[];
65
- C8gd: string[];
66
- C8gn: string[];
67
- C8i: string[];
68
- "C8i-flex": string[];
69
- R5: string[];
70
- R5a: string[];
71
- R5ad: string[];
72
- R5b: string[];
73
- R5d: string[];
74
- R5dn: string[];
75
- R5n: string[];
76
- R6a: string[];
77
- R6g: string[];
78
- R6gd: string[];
79
- R6i: string[];
80
- R6id: string[];
81
- R6idn: string[];
82
- R6in: string[];
83
- R7a: string[];
84
- R7g: string[];
85
- R7gd: string[];
86
- R7i: string[];
87
- R7iz: string[];
88
- R8a: string[];
89
- R8g: string[];
90
- R8gb: string[];
91
- R8gd: string[];
92
- R8gn: string[];
93
- R8i: string[];
94
- "R8i-flex": string[];
95
- "U-3tb1": string[];
96
- "U-6tb1": string[];
97
- "U-9tb1": string[];
98
- "U-12tb1": string[];
99
- "U-18tb1": string[];
100
- "U-24tb1": string[];
101
- "U7i-6tb": string[];
102
- "U7i-8tb": string[];
103
- "U7i-12tb": string[];
104
- "U7in-16tb": string[];
105
- "U7in-24tb": string[];
106
- "U7in-32tb": string[];
107
- "U7inh-32tb": string[];
108
- X1: string[];
109
- X1e: string[];
110
- X2gd: string[];
111
- X2idn: string[];
112
- X2iedn: string[];
113
- X2iezn: string[];
114
- X8g: string[];
115
- X8aedz: string[];
116
- z1d: string[];
117
- D2: string[];
118
- D3: string[];
119
- D3en: string[];
120
- H1: string[];
121
- I3: string[];
122
- I3en: string[];
123
- I4g: string[];
124
- I4i: string[];
125
- I7i: string[];
126
- I7ie: string[];
127
- I8g: string[];
128
- I8ge: string[];
129
- Im4gn: string[];
130
- Is4gen: string[];
131
- DL1: string[];
132
- DL2q: string[];
133
- F1: string[];
134
- F2: string[];
135
- G4ad: string[];
136
- G4dn: string[];
137
- G5: string[];
138
- G5g: string[];
139
- G6: string[];
140
- G6e: string[];
141
- G6f: string[];
142
- Gr6: string[];
143
- Gr6f: string[];
144
- Inf1: string[];
145
- Inf2: string[];
146
- P4d: string[];
147
- P4de: string[];
148
- P5: string[];
149
- P5e: string[];
150
- P5en: string[];
151
- "P6-B200": string[];
152
- "P6-B300": string[];
153
- "P6e-GB200": string[];
154
- Trn1: string[];
155
- Trn1n: string[];
156
- Trn2: string[];
157
- Trn2u: string[];
158
- VT1: string[];
159
- Hpc6a: string[];
160
- Hpc6id: string[];
161
- Hpc7a: string[];
162
- Hpc7g: string[];
163
- };
164
- /**
165
- * @see https://docs.aws.amazon.com/ec2/latest/instancetypes/pg.html
166
- */
167
- declare const AWS_PREVIOUS_GENERATION_INSTANCE_TYPES_BY_FAMILY: {
168
- A1: string[];
169
- C1: string[];
170
- C3: string[];
171
- C4: string[];
172
- G3: string[];
173
- I2: string[];
174
- M1: string[];
175
- M2: string[];
176
- M3: string[];
177
- M4: string[];
178
- P2: string[];
179
- P3: string[];
180
- P3dn: string[];
181
- R3: string[];
182
- R4: string[];
183
- T1: string[];
184
- };
185
- declare const AWS_INSTANCE_TYPES: string[];
186
- /**
187
- * @see https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
188
- */
189
- declare const AWS_LAMBDA_RUNTIMES: string[];
190
- /** @see https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html */
191
- declare const AWS_EBS_VOLUME_TYPES: string[];
192
- export { AWS_EBS_VOLUME_TYPES, AWS_INSTANCE_TYPES, AWS_INSTANCE_TYPES_BY_FAMILY, AWS_LAMBDA_RUNTIMES, AWS_PREVIOUS_GENERATION_INSTANCE_TYPES_BY_FAMILY, AWS_REGIONS, };
@@ -1,138 +0,0 @@
1
- declare const AZURE_REGIONS: string[];
2
- /**
3
- * @see https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview?tabs=breakdownseries%2Cgeneralsizelist%2Ccomputesizelist%2Cmemorysizelist%2Cstoragesizelist%2Cgpusizelist%2Cfpgasizelist%2Chpcsizelist#general-purpose
4
- */
5
- declare const AZURE_INSTANCE_TYPES_BY_FAMILY: {
6
- Av2: string[];
7
- Bsv2: string[];
8
- Basv2: string[];
9
- Bpsv2: string[];
10
- Dasv7: string[];
11
- Dadsv7: string[];
12
- Dalsv7: string[];
13
- Daldsv7: string[];
14
- Dsv6: string[];
15
- Ddsv6: string[];
16
- Dlsv6: string[];
17
- Dldsv6: string[];
18
- Dasv6: string[];
19
- Dadsv6: string[];
20
- Dalsv6: string[];
21
- Daldsv6: string[];
22
- Dpsv6: string[];
23
- Dpdsv6: string[];
24
- Dplsv6: string[];
25
- Dpldsv6: string[];
26
- Dv5: string[];
27
- Dsv5: string[];
28
- Ddv5: string[];
29
- Ddsv5: string[];
30
- Dasv5: string[];
31
- Dadsv5: string[];
32
- Dpsv5: string[];
33
- Dpdsv5: string[];
34
- Dplsv5: string[];
35
- Dpldsv5: string[];
36
- Dlsv5: string[];
37
- Dldsv5: string[];
38
- Dnsv6: string[];
39
- Dndsv6: string[];
40
- Dnlsv6: string[];
41
- Dnldsv6: string[];
42
- Dv4: string[];
43
- Dsv4: string[];
44
- Dav4: string[];
45
- Dasv4: string[];
46
- Ddv4: string[];
47
- Ddsv4: string[];
48
- DCasv5: string[];
49
- DCadsv5: string[];
50
- DCasv6: string[];
51
- DCadsv6: string[];
52
- DCesv6: string[];
53
- DCas_cc_v5: string[];
54
- DCads_cc_v5: string[];
55
- DCsv3: string[];
56
- DCdsv3: string[];
57
- DCsv: string[];
58
- Fasv7: string[];
59
- Fadsv7: string[];
60
- Famsv7: string[];
61
- Famdsv7: string[];
62
- Falsv7: string[];
63
- Faldsv7: string[];
64
- Fasv6: string[];
65
- Falsv6: string[];
66
- Famsv6: string[];
67
- Fsv2: string[];
68
- FXmsv2: string[];
69
- FXmdsv2: string[];
70
- FX: string[];
71
- Easv7: string[];
72
- Eadsv7: string[];
73
- Esv6: string[];
74
- Edsv6: string[];
75
- Epsv6: string[];
76
- Epdsv6: string[];
77
- Easv6: string[];
78
- Eadsv6: string[];
79
- Ev5: string[];
80
- Esv5: string[];
81
- Edv5: string[];
82
- Edsv5: string[];
83
- Easv5: string[];
84
- Eadsv5: string[];
85
- Ensv6: string[];
86
- Endsv6: string[];
87
- Epsv5: string[];
88
- Epdsv5: string[];
89
- Edv4: string[];
90
- Edsv4: string[];
91
- Eav4: string[];
92
- Easv4: string[];
93
- Ev4: string[];
94
- Esv4: string[];
95
- Ebsv6: string[];
96
- Ebdsv6: string[];
97
- Ebdsv5: string[];
98
- Ebsv5: string[];
99
- ECasv5: string[];
100
- ECadsv5: string[];
101
- ECasv6: string[];
102
- ECadsv6: string[];
103
- ECesv6: string[];
104
- ECas_cc_v5: string[];
105
- ECads_cc_v5: string[];
106
- "Mdsv3 Medium Memory": string[];
107
- "Msv3 Medium Memory": string[];
108
- "Msv2 Medium Memory": string[];
109
- "Mdsv2 Medium Memory": string[];
110
- M: string[];
111
- "Msv3 High Memory": string[];
112
- "Mdsv3 High Memory": string[];
113
- "Msv2 High Memory": string[];
114
- "Mdsv3 Very High Memory": string[];
115
- Mbsv3: string[];
116
- Mbdsv3: string[];
117
- Laosv4: string[];
118
- Lasv4: string[];
119
- Lsv4: string[];
120
- Lsv3: string[];
121
- Lasv3: string[];
122
- HBv2: string[];
123
- HBv3: string[];
124
- HBv4: string[];
125
- HBv5: string[];
126
- HC: string[];
127
- HX: string[];
128
- };
129
- declare const AZURE_INSTANCE_TYPES: string[];
130
- /**
131
- * @see https://aka.ms/flexfxversions
132
- * @see https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-terraform
133
- */
134
- declare const AZURE_LAMBDA_RUNTIMES: {
135
- runtime_name: string;
136
- runtime_verison: string;
137
- }[];
138
- export { AZURE_INSTANCE_TYPES, AZURE_INSTANCE_TYPES_BY_FAMILY, AZURE_LAMBDA_RUNTIMES, AZURE_REGIONS, };
@@ -1,88 +0,0 @@
1
- /**
2
- * @see https://docs.cloud.google.com/compute/docs/regions-zones
3
- */
4
- declare const GCP_REGIONS: string[];
5
- /**
6
- * @see https://docs.cloud.google.com/compute/docs/general-purpose-machines
7
- */
8
- declare const GCP_INSTANCE_TYPES_BY_FAMILY: {
9
- "C4D standard": string[];
10
- "C4D highcpu": string[];
11
- "C4D highmem": string[];
12
- "C4D standard SSD": string[];
13
- "C4D highmem SSD": string[];
14
- "C4A standard": string[];
15
- "C4A highcpu": string[];
16
- "C4A highmem": string[];
17
- "C4A standard SSD": string[];
18
- "C4A highmem SSD": string[];
19
- "C4 standard": string[];
20
- "C4 highcpu": string[];
21
- "C4 highmem": string[];
22
- "C4 standard SSD": string[];
23
- "C4 highmem SSD": string[];
24
- "N4D standard": string[];
25
- "N4D highcpu": string[];
26
- "N4D highmem": string[];
27
- "N4A standard": string[];
28
- "N4A highcpu": string[];
29
- "N4A highmem": string[];
30
- "N4 standard": string[];
31
- "N4 highcpu": string[];
32
- "N4 highmem": string[];
33
- "C3D standard": string[];
34
- "C3D highcpu": string[];
35
- "C3D highmem": string[];
36
- "C3D standard SSD": string[];
37
- "C3D highmem SSD": string[];
38
- "C3 standard": string[];
39
- "C3 highcpu": string[];
40
- "C3 highmem": string[];
41
- "C3 standard SSD": string[];
42
- "N2D standard": string[];
43
- "N2D highcpu": string[];
44
- "N2D highmem": string[];
45
- "N2 standard": string[];
46
- "N2 highcpu": string[];
47
- "N2 highmem": string[];
48
- "E2 standard": string[];
49
- "E2 highcpu": string[];
50
- "E2 highmem": string[];
51
- "E2 sharedcore": string[];
52
- "N1 standard": string[];
53
- "N1 highcpu": string[];
54
- "N1 highmem": string[];
55
- "N1 sharedcore": string[];
56
- T2A: string[];
57
- T2D: string[];
58
- "Z3 standard SSD": string[];
59
- "Z3 high SSD": string[];
60
- H4D: string[];
61
- H3: string[];
62
- "C2D standard": string[];
63
- "C2D highcpu": string[];
64
- "C2D highmem": string[];
65
- C2: string[];
66
- X4: string[];
67
- M4: string[];
68
- M3: string[];
69
- M2: string[];
70
- M1: string[];
71
- A4X: string[];
72
- A4: string[];
73
- "A3 ultra": string[];
74
- "A3 mega": string[];
75
- "A3 high": string[];
76
- "A3 edge": string[];
77
- "A2 ultra": string[];
78
- "A2 standard": string[];
79
- G4: string[];
80
- G2: string[];
81
- };
82
- declare const GCP_INSTANCE_TYPES: string[];
83
- declare const GCP_GPU_MACHINE_TYPES: string[];
84
- /**
85
- * @see https://docs.cloud.google.com/run/docs/runtimes/function-runtimes
86
- */
87
- declare const GCP_LAMBDA_RUNTIMES: string[];
88
- export { GCP_GPU_MACHINE_TYPES, GCP_INSTANCE_TYPES, GCP_INSTANCE_TYPES_BY_FAMILY, GCP_LAMBDA_RUNTIMES, GCP_REGIONS, };
@@ -1,5 +0,0 @@
1
- declare const SHORT_ENVIRONMENT_TAGS: string[];
2
- declare const LONG_ENVIRONMENT_TAGS: string[];
3
- declare const ENVIRONMENT_TAGS: string[];
4
- declare const SERVICE_TAGS: string[];
5
- export { ENVIRONMENT_TAGS, LONG_ENVIRONMENT_TAGS, SERVICE_TAGS, SHORT_ENVIRONMENT_TAGS, };
@@ -1,4 +0,0 @@
1
- declare const HelpMessages: {
2
- readonly RequiresGhCli: "Requires the `gh` CLI to be installed. To install, run `brew install gh`.";
3
- };
4
- export { HelpMessages };
@@ -1,9 +0,0 @@
1
- import type { ObjectValues } from "../types/object-values.js";
2
- declare const Providers: {
3
- readonly AWS: "aws";
4
- readonly GCP: "gcp";
5
- readonly Azure: "azure";
6
- };
7
- type Provider = ObjectValues<typeof Providers>;
8
- export type { Provider };
9
- export { Providers };
@@ -1,11 +0,0 @@
1
- import type { ObjectValues } from "../types/object-values.js";
2
- /**
3
- * Represents an abstract resource type that most providers offer, but may name differently.
4
- */
5
- declare const ResourceTypes: {
6
- readonly ComputeInstance: "compute-instance";
7
- readonly LambdaFunction: "lambda-function";
8
- };
9
- type ResourceType = ObjectValues<typeof ResourceTypes>;
10
- export type { ResourceType };
11
- export { ResourceTypes };
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { run } from "@oclif/core";
@@ -1,2 +0,0 @@
1
- type ObjectValues<T extends Record<string, unknown>> = T[keyof T];
2
- export type { ObjectValues };
@@ -1,5 +0,0 @@
1
- import { Command } from "@oclif/core";
2
- declare abstract class BaseCommand extends Command {
3
- showHelp(): Promise<void>;
4
- }
5
- export { BaseCommand };
@@ -1,5 +0,0 @@
1
- declare const formatFlag: import("@oclif/core/interfaces").BooleanFlag<boolean>;
2
- declare const quietFlag: import("@oclif/core/interfaces").BooleanFlag<boolean>;
3
- declare const resourceCountFlag: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
4
- declare const providerFlag: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
5
- export { formatFlag, providerFlag, quietFlag, resourceCountFlag };
@@ -1,9 +0,0 @@
1
- import { ProviderGenerator } from "./provider-generator.js";
2
- declare class AwsGenerator extends ProviderGenerator {
3
- addProvider(): void;
4
- addComputeInstance(): this;
5
- addLambdaFunction(): this;
6
- private randomAmi;
7
- private randomRole;
8
- }
9
- export { AwsGenerator };
@@ -1,7 +0,0 @@
1
- import { ProviderGenerator } from "./provider-generator.js";
2
- declare class AzureGenerator extends ProviderGenerator {
3
- addProvider(): void;
4
- addComputeInstance(): this;
5
- addLambdaFunction(): this;
6
- }
7
- export { AzureGenerator };
@@ -1,12 +0,0 @@
1
- import { type Provider } from "../../enums/providers.js";
2
- interface GenerateOptions {
3
- provider?: Provider;
4
- directory?: string;
5
- fileName?: string;
6
- format?: boolean;
7
- resourceCount?: number;
8
- }
9
- declare class FileGenerator {
10
- static generate(options: GenerateOptions): void;
11
- }
12
- export { FileGenerator };
@@ -1,7 +0,0 @@
1
- import { ProviderGenerator } from "./provider-generator.js";
2
- declare class GcpGenerator extends ProviderGenerator {
3
- addProvider(): void;
4
- addComputeInstance(): this;
5
- addLambdaFunction(): this;
6
- }
7
- export { GcpGenerator };
@@ -1,25 +0,0 @@
1
- type StringGenerator = () => string;
2
- /**
3
- * Wraps a generator function to ensure the values it returns are not reused within the program runtime
4
- */
5
- declare function unique(generator: StringGenerator): StringGenerator;
6
- declare const randomMemorableSlug: StringGenerator;
7
- declare const randomItem: <T>(values: T[]) => T;
8
- declare const randomProvider: () => "aws" | "gcp" | "azure";
9
- declare const randomId: StringGenerator;
10
- declare const randomEnvironmentTag: () => string;
11
- declare const randomServiceTag: () => string;
12
- interface RandomMemorySizeOptions extends Required<RandomIntOptions> {
13
- step: number;
14
- }
15
- declare const randomMemorySize: (options: RandomMemorySizeOptions) => number;
16
- interface RandomIntOptions {
17
- min?: number;
18
- max?: number;
19
- }
20
- declare const randomInt: (options: RandomIntOptions) => number;
21
- /**
22
- * Returns true/false depending on the provided probability (0 to 1)
23
- */
24
- declare const maybe: (probability: number) => boolean;
25
- export { maybe, randomEnvironmentTag, randomId, randomInt, randomItem, randomMemorableSlug, randomMemorySize, randomProvider, randomServiceTag, unique, };
@@ -1,8 +0,0 @@
1
- import type { Provider } from "../../enums/providers.js";
2
- import { AwsGenerator } from "./aws-generator.js";
3
- import { AzureGenerator } from "./azure-generator.js";
4
- import { GcpGenerator } from "./gcp-generator.js";
5
- declare class ProviderGeneratorFactory {
6
- static get(provider: Provider): AwsGenerator | AzureGenerator | GcpGenerator;
7
- }
8
- export { ProviderGeneratorFactory };
@@ -1,22 +0,0 @@
1
- import { TerraformGenerator } from "terraform-generator";
2
- import type { ResourceType } from "../../enums/resource-types.js";
3
- interface WriteToFileOptions {
4
- directory?: string;
5
- fileName?: string;
6
- format?: boolean;
7
- }
8
- declare abstract class ProviderGenerator {
9
- readonly tfg: TerraformGenerator;
10
- constructor();
11
- /**
12
- * Adds a block for the provider, and typically the region to be used.
13
- * This is called automatically by the constructor, so it shouldn't need to be called manually.
14
- */
15
- abstract addProvider(): void;
16
- abstract addComputeInstance(): this;
17
- abstract addLambdaFunction(): this;
18
- addResourceByType(type: ResourceType): this;
19
- addRandomResource(): this;
20
- writeToFile(options?: WriteToFileOptions): void;
21
- }
22
- export { ProviderGenerator };
@@ -1,39 +0,0 @@
1
- import type { Provider } from "../../enums/providers.js";
2
- interface GenerateOptions {
3
- /**
4
- * Provider to generate a terraform file for. If not provided, random providers will be used.
5
- */
6
- provider?: Provider;
7
- /**
8
- * Whether the terraform files should be formatted. Requires `terraform` to be installed.
9
- */
10
- format?: boolean;
11
- /**
12
- * Prefix for the repo
13
- */
14
- prefix?: string;
15
- /**
16
- * Directory to generate the repo in
17
- */
18
- directory?: string;
19
- /**
20
- * Number of files to generate
21
- */
22
- fileCount?: number;
23
- /**
24
- * Number of resources per file to generate
25
- */
26
- resourceCount?: number;
27
- /**
28
- * Whether output from the commands should be silenced
29
- */
30
- quiet?: boolean;
31
- }
32
- interface GenerateResult {
33
- name: string;
34
- path: string;
35
- }
36
- declare class RepoGenerator {
37
- static generate(options: GenerateOptions): Promise<GenerateResult>;
38
- }
39
- export { RepoGenerator };
@@ -1,8 +0,0 @@
1
- interface Repo {
2
- name: string;
3
- nameWithOwner: string;
4
- }
5
- declare const listRepos: () => Repo[];
6
- declare const stringifyRepos: (repos: Repo[]) => string;
7
- export type { Repo };
8
- export { listRepos, stringifyRepos };
@@ -1,6 +0,0 @@
1
- declare const slugify: (value: string) => string;
2
- declare const snakeSlugify: (value: string) => string;
3
- declare const success: (message: string) => string;
4
- declare const stringifySingleLineArray: (values: string[]) => string;
5
- declare const formatTfFileName: (fileName: string) => string;
6
- export { formatTfFileName, slugify, snakeSlugify, stringifySingleLineArray, success, };