@swovohq/fuel 0.2.0-alpha.4 → 0.2.0-alpha.40
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.
- package/LICENSE +21 -0
- package/README.md +231 -0
- package/dist/bin/fuel.js +150 -55
- package/dist/bin/fuel.js.map +1 -1
- package/dist/commands/config-verify.d.ts +4 -0
- package/dist/commands/config-verify.d.ts.map +1 -0
- package/dist/commands/config-verify.js +66 -0
- package/dist/commands/config-verify.js.map +1 -0
- package/dist/commands/create-app.d.ts +7 -2
- package/dist/commands/create-app.d.ts.map +1 -1
- package/dist/commands/create-app.js +84 -49
- package/dist/commands/create-app.js.map +1 -1
- package/dist/commands/infra-deploy.d.ts +5 -0
- package/dist/commands/infra-deploy.d.ts.map +1 -1
- package/dist/commands/infra-deploy.js +59 -15
- package/dist/commands/infra-deploy.js.map +1 -1
- package/dist/commands/infra-destroy.d.ts +2 -0
- package/dist/commands/infra-destroy.d.ts.map +1 -1
- package/dist/commands/infra-destroy.js +5 -6
- package/dist/commands/infra-destroy.js.map +1 -1
- package/dist/commands/infra-init.d.ts +1 -0
- package/dist/commands/infra-init.d.ts.map +1 -1
- package/dist/commands/infra-init.js +99 -14
- package/dist/commands/infra-init.js.map +1 -1
- package/dist/commands/migrate-init.d.ts.map +1 -1
- package/dist/commands/migrate-init.js +28 -12
- package/dist/commands/migrate-init.js.map +1 -1
- package/dist/engines/template-source.d.ts.map +1 -1
- package/dist/engines/template-source.js +14 -1
- package/dist/engines/template-source.js.map +1 -1
- package/dist/infra/config-loader.d.ts.map +1 -1
- package/dist/infra/config-loader.js +10 -2
- package/dist/infra/config-loader.js.map +1 -1
- package/dist/infra/config-writer.d.ts +2 -7
- package/dist/infra/config-writer.d.ts.map +1 -1
- package/dist/infra/config-writer.js +5 -11
- package/dist/infra/config-writer.js.map +1 -1
- package/dist/infra/credentials.d.ts +10 -2
- package/dist/infra/credentials.d.ts.map +1 -1
- package/dist/infra/credentials.js +44 -25
- package/dist/infra/credentials.js.map +1 -1
- package/dist/infra/git-client.d.ts +1 -1
- package/dist/infra/git-client.d.ts.map +1 -1
- package/dist/infra/git-client.js +8 -4
- package/dist/infra/git-client.js.map +1 -1
- package/dist/infra/github-client.d.ts +6 -0
- package/dist/infra/github-client.d.ts.map +1 -0
- package/dist/infra/github-client.js +36 -0
- package/dist/infra/github-client.js.map +1 -0
- package/dist/infra/orchestrator.d.ts +5 -2
- package/dist/infra/orchestrator.d.ts.map +1 -1
- package/dist/infra/orchestrator.js +85 -71
- package/dist/infra/orchestrator.js.map +1 -1
- package/dist/infra/port-utils.d.ts +4 -0
- package/dist/infra/port-utils.d.ts.map +1 -0
- package/dist/infra/port-utils.js +77 -0
- package/dist/infra/port-utils.js.map +1 -0
- package/dist/infra/preflight.d.ts +1 -1
- package/dist/infra/preflight.d.ts.map +1 -1
- package/dist/infra/preflight.js +4 -4
- package/dist/infra/preflight.js.map +1 -1
- package/dist/infra/s3-state-bucket.d.ts +1 -1
- package/dist/infra/s3-state-bucket.d.ts.map +1 -1
- package/dist/infra/s3-state-bucket.js +21 -26
- package/dist/infra/s3-state-bucket.js.map +1 -1
- package/dist/infra/secrets-manager-client.d.ts.map +1 -1
- package/dist/infra/secrets-manager-client.js +35 -1
- package/dist/infra/secrets-manager-client.js.map +1 -1
- package/dist/infra/template-engine.d.ts +1 -1
- package/dist/infra/template-engine.d.ts.map +1 -1
- package/dist/infra/template-engine.js +16 -29
- package/dist/infra/template-engine.js.map +1 -1
- package/dist/infra/tofu-runner.d.ts +5 -8
- package/dist/infra/tofu-runner.d.ts.map +1 -1
- package/dist/infra/tofu-runner.js +42 -80
- package/dist/infra/tofu-runner.js.map +1 -1
- package/package.json +10 -6
- package/schema/fuel.schema.json +158 -0
|
@@ -3,22 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.TofuApplyError = void 0;
|
|
7
7
|
exports.buildDestroyArgs = buildDestroyArgs;
|
|
8
8
|
exports.runTofuDestroy = runTofuDestroy;
|
|
9
|
-
exports.
|
|
9
|
+
exports.runTofuApply = runTofuApply;
|
|
10
10
|
const child_process_1 = require("child_process");
|
|
11
11
|
const chalk_1 = __importDefault(require("chalk"));
|
|
12
12
|
const subprocess_1 = require("./subprocess");
|
|
13
|
-
class
|
|
14
|
-
constructor(
|
|
15
|
-
super(`Tofu
|
|
16
|
-
this.
|
|
17
|
-
this.completedPasses = completedPasses;
|
|
18
|
-
this.name = 'TofuPassError';
|
|
13
|
+
class TofuApplyError extends Error {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(`Tofu apply failed after ${MAX_ATTEMPTS} attempts`);
|
|
16
|
+
this.name = 'TofuApplyError';
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
exports.
|
|
19
|
+
exports.TofuApplyError = TofuApplyError;
|
|
22
20
|
const MAX_ATTEMPTS = 3;
|
|
23
21
|
const TRANSIENT_PATTERNS = [
|
|
24
22
|
/RequestError/i,
|
|
@@ -38,46 +36,42 @@ function buildAwsEnv(credentials) {
|
|
|
38
36
|
AWS_REGION: credentials.AWS_REGION,
|
|
39
37
|
};
|
|
40
38
|
}
|
|
41
|
-
function buildVarArgs(credentials, tofuVars
|
|
42
|
-
|
|
39
|
+
function buildVarArgs(credentials, tofuVars) {
|
|
40
|
+
const args = [
|
|
43
41
|
'-var-file=default.tfvars',
|
|
44
|
-
`-var=github_token=${credentials.GITHUB_TOKEN}`,
|
|
45
|
-
`-var=github_username=${credentials.GITHUB_USERNAME}`,
|
|
46
42
|
`-var=aws_access_key_id=${credentials.AWS_ACCESS_KEY_ID}`,
|
|
47
43
|
`-var=aws_secret_access_key=${credentials.AWS_SECRET_ACCESS_KEY}`,
|
|
48
44
|
`-var=aws_region=${credentials.AWS_REGION}`,
|
|
49
45
|
`-var=github_organization=${credentials.GITHUB_ORGANIZATION}`,
|
|
50
|
-
`-var=db_password=${tofuVars.db_password}`,
|
|
51
|
-
`-var=db_username=${tofuVars.db_username}`,
|
|
52
|
-
`-var=db_name=${tofuVars.db_name}`,
|
|
53
|
-
`-var=skip_ecs=${skipEcs}`,
|
|
54
46
|
];
|
|
47
|
+
if (tofuVars) {
|
|
48
|
+
args.push(`-var=db_username=${tofuVars.db_username}`, `-var=db_name=${tofuVars.db_name}`, `-var=github_repo_name=${tofuVars.github_repo_name}`);
|
|
49
|
+
}
|
|
50
|
+
return args;
|
|
55
51
|
}
|
|
56
|
-
function buildApplyArgs(
|
|
52
|
+
function buildApplyArgs(credentials, tofuVars) {
|
|
57
53
|
return [
|
|
58
54
|
'apply',
|
|
59
55
|
'-auto-approve',
|
|
60
|
-
...buildVarArgs(credentials, tofuVars
|
|
61
|
-
...passTargets,
|
|
56
|
+
...buildVarArgs(credentials, tofuVars),
|
|
62
57
|
];
|
|
63
58
|
}
|
|
64
|
-
function buildPlanArgs(
|
|
59
|
+
function buildPlanArgs(credentials, tofuVars) {
|
|
65
60
|
return [
|
|
66
61
|
'plan',
|
|
67
|
-
...buildVarArgs(credentials, tofuVars
|
|
68
|
-
...passTargets,
|
|
62
|
+
...buildVarArgs(credentials, tofuVars),
|
|
69
63
|
];
|
|
70
64
|
}
|
|
71
|
-
async function
|
|
65
|
+
async function runApplyWithRetry(args, cwd, env) {
|
|
72
66
|
for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
|
73
67
|
const { code, combined } = await (0, subprocess_1.spawnStreaming)(args, cwd, env);
|
|
74
68
|
if (code === 0) {
|
|
75
69
|
return;
|
|
76
70
|
}
|
|
77
71
|
if (!isTransient(combined) || attempt === MAX_ATTEMPTS) {
|
|
78
|
-
throw new Error(`
|
|
72
|
+
throw new Error(`Apply failed after attempt ${attempt}`);
|
|
79
73
|
}
|
|
80
|
-
console.warn(chalk_1.default.yellow(`Warning:
|
|
74
|
+
console.warn(chalk_1.default.yellow(`Warning: Attempt ${attempt} failed with transient error. Retrying...`));
|
|
81
75
|
}
|
|
82
76
|
}
|
|
83
77
|
async function collectOutputs(infraDir, env) {
|
|
@@ -113,7 +107,7 @@ function buildDestroyArgs(credentials, tofuVars) {
|
|
|
113
107
|
return [
|
|
114
108
|
'destroy',
|
|
115
109
|
'-auto-approve',
|
|
116
|
-
...buildVarArgs(credentials, tofuVars
|
|
110
|
+
...buildVarArgs(credentials, tofuVars),
|
|
117
111
|
];
|
|
118
112
|
}
|
|
119
113
|
async function runTofuDestroy(infraDir, credentials, tofuVars) {
|
|
@@ -135,7 +129,7 @@ async function runTofuDestroy(infraDir, credentials, tofuVars) {
|
|
|
135
129
|
}
|
|
136
130
|
console.log(chalk_1.default.green('✓ Infrastructure destroyed'));
|
|
137
131
|
}
|
|
138
|
-
async function
|
|
132
|
+
async function runTofuApply(infraDir, credentials, tofuVars, options) {
|
|
139
133
|
const awsEnv = buildAwsEnv(credentials);
|
|
140
134
|
// Initialize OpenTofu
|
|
141
135
|
console.log(chalk_1.default.cyan('--- Initializing OpenTofu ---'));
|
|
@@ -145,64 +139,32 @@ async function runTofuSequence(infraDir, credentials, tofuVars, options) {
|
|
|
145
139
|
process.exit(1);
|
|
146
140
|
}
|
|
147
141
|
console.log(chalk_1.default.green('✓ OpenTofu initialized'));
|
|
148
|
-
// Define pass configurations
|
|
149
|
-
const passes = [
|
|
150
|
-
{
|
|
151
|
-
num: 1,
|
|
152
|
-
label: 'ECR + GitHub repo',
|
|
153
|
-
targets: ['-target=module.ecr', '-target=module.github_repo'],
|
|
154
|
-
skipEcs: true,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
num: 2,
|
|
158
|
-
label: 'GitHub Actions',
|
|
159
|
-
targets: ['-target=module.github_actions', '-target=module.github_repo', '-target=module.github_oidc'],
|
|
160
|
-
skipEcs: true,
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
num: 3,
|
|
164
|
-
label: 'Full apply',
|
|
165
|
-
targets: [],
|
|
166
|
-
skipEcs: false,
|
|
167
|
-
},
|
|
168
|
-
];
|
|
169
|
-
const result = {
|
|
170
|
-
completedPasses: [],
|
|
171
|
-
failedPass: null,
|
|
172
|
-
outputs: null,
|
|
173
|
-
};
|
|
174
142
|
const planOnly = options?.planOnly ?? false;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
if (code !== 0) {
|
|
185
|
-
throw new Error(`Plan ${pass.num} (${pass.label}) failed`);
|
|
186
|
-
}
|
|
143
|
+
console.log(chalk_1.default.cyan(`--- ${planOnly ? 'Planning' : 'Applying'} infrastructure ---`));
|
|
144
|
+
try {
|
|
145
|
+
const args = planOnly
|
|
146
|
+
? buildPlanArgs(credentials, tofuVars)
|
|
147
|
+
: buildApplyArgs(credentials, tofuVars);
|
|
148
|
+
if (planOnly) {
|
|
149
|
+
const { code } = await (0, subprocess_1.spawnStreaming)(args, infraDir, awsEnv);
|
|
150
|
+
if (code !== 0) {
|
|
151
|
+
throw new Error('Plan failed');
|
|
187
152
|
}
|
|
188
|
-
else {
|
|
189
|
-
await runPassWithRetry(pass.num, pass.label, args, infraDir, awsEnv);
|
|
190
|
-
}
|
|
191
|
-
result.completedPasses.push(pass.num);
|
|
192
|
-
console.log(chalk_1.default.green(`✓ ${mode} ${pass.num} complete`));
|
|
193
153
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (planOnly) {
|
|
197
|
-
console.log(chalk_1.default.red(`✗ Plan ${pass.num} failed.`));
|
|
198
|
-
throw err;
|
|
199
|
-
}
|
|
200
|
-
console.log(chalk_1.default.red(`✗ Pass ${pass.num} failed after ${MAX_ATTEMPTS} attempts.`));
|
|
201
|
-
throw new TofuPassError(pass.num, [...result.completedPasses]);
|
|
154
|
+
else {
|
|
155
|
+
await runApplyWithRetry(args, infraDir, awsEnv);
|
|
202
156
|
}
|
|
157
|
+
console.log(chalk_1.default.green(`✓ ${planOnly ? 'Plan' : 'Apply'} complete`));
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
console.log(chalk_1.default.red(`✗ ${planOnly ? 'Plan' : 'Apply'} failed after ${MAX_ATTEMPTS} attempts.`));
|
|
161
|
+
throw new TofuApplyError();
|
|
203
162
|
}
|
|
163
|
+
const result = {
|
|
164
|
+
success: true,
|
|
165
|
+
outputs: null,
|
|
166
|
+
};
|
|
204
167
|
if (!planOnly) {
|
|
205
|
-
// Collect outputs after all passes
|
|
206
168
|
result.outputs = await collectOutputs(infraDir, awsEnv);
|
|
207
169
|
}
|
|
208
170
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tofu-runner.js","sourceRoot":"","sources":["../../src/infra/tofu-runner.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"tofu-runner.js","sourceRoot":"","sources":["../../src/infra/tofu-runner.ts"],"names":[],"mappings":";;;;;;AAwJA,4CASC;AAED,wCAwBC;AAED,oCAmDC;AAhPD,iDAAqC;AACrC,kDAAyB;AAEzB,6CAA6C;AAa7C,MAAa,cAAe,SAAQ,KAAK;IACvC;QACE,KAAK,CAAC,2BAA2B,YAAY,WAAW,CAAC,CAAA;QACzD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAA;IAC9B,CAAC;CACF;AALD,wCAKC;AAED,MAAM,YAAY,GAAG,CAAC,CAAA;AAEtB,MAAM,kBAAkB,GAAa;IACnC,eAAe;IACf,sBAAsB;IACtB,OAAO;IACP,UAAU;IACV,mBAAmB;IACnB,kBAAkB;CACnB,CAAA;AAED,SAAS,WAAW,CAAC,MAAc;IACjC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AACnE,CAAC;AAED,SAAS,WAAW,CAAC,WAA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
|
3
|
+
"version": "0.2.0-alpha.40",
|
|
4
4
|
"bin": {
|
|
5
5
|
"fuel": "dist/bin/fuel.js"
|
|
6
6
|
},
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"license": "MIT",
|
|
9
10
|
"files": [
|
|
10
11
|
"dist",
|
|
11
|
-
"
|
|
12
|
+
"schema",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
12
15
|
],
|
|
13
16
|
"publishConfig": {
|
|
14
17
|
"access": "public",
|
|
@@ -25,14 +28,15 @@
|
|
|
25
28
|
"lint": "eslint \"src/**/*.ts\""
|
|
26
29
|
},
|
|
27
30
|
"dependencies": {
|
|
28
|
-
"@aws-sdk/client-s3": "^3.
|
|
29
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
31
|
+
"@aws-sdk/client-s3": "^3.1022.0",
|
|
32
|
+
"@aws-sdk/client-secrets-manager": "^3.1022.0",
|
|
30
33
|
"@octokit/rest": "^22.0.1",
|
|
31
|
-
"chalk": "^4",
|
|
32
|
-
"commander": "^
|
|
34
|
+
"chalk": "^4.1.2",
|
|
35
|
+
"commander": "^14.0.3",
|
|
33
36
|
"fs-extra": "^11.2.0",
|
|
34
37
|
"glob": "^10.3.10",
|
|
35
38
|
"libsodium-wrappers": "^0.8.2",
|
|
39
|
+
"yaml": "^2.8.3",
|
|
36
40
|
"zod": "^4"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Fuel CLI Configuration",
|
|
4
|
+
"description": "Configuration file for Fuel CLI infrastructure provisioning (fuel.yml)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["name", "deployment", "ssl", "apps"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1,
|
|
12
|
+
"description": "Project name. Used as a prefix for all AWS and GitHub resources."
|
|
13
|
+
},
|
|
14
|
+
"deployment": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": ["ecs"],
|
|
17
|
+
"description": "Deployment target. Only 'ecs' is currently supported."
|
|
18
|
+
},
|
|
19
|
+
"ssl": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"minLength": 1,
|
|
22
|
+
"description": "ARN of the ACM SSL certificate (e.g. arn:aws:acm:us-east-1:123:certificate/abc)."
|
|
23
|
+
},
|
|
24
|
+
"slack_webhook_url": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Slack incoming webhook URL for deploy failure notifications. Leave empty to disable."
|
|
27
|
+
},
|
|
28
|
+
"apps": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"minItems": 1,
|
|
31
|
+
"description": "List of applications to deploy.",
|
|
32
|
+
"items": {
|
|
33
|
+
"$ref": "#/definitions/app"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"definitions": {
|
|
38
|
+
"worker": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["name", "dockerfile"],
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"properties": {
|
|
43
|
+
"name": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"minLength": 1,
|
|
46
|
+
"description": "Worker name. Used as the ECS service name."
|
|
47
|
+
},
|
|
48
|
+
"dockerfile": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"minLength": 1,
|
|
51
|
+
"description": "Path to the worker's Dockerfile relative to the project root."
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"app": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": ["name", "technology", "dockerfile", "health_check_path", "domain", "port"],
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"properties": {
|
|
60
|
+
"name": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"minLength": 1,
|
|
63
|
+
"description": "App name. Used as the ECS service and task definition name."
|
|
64
|
+
},
|
|
65
|
+
"technology": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"enum": ["nest", "react"],
|
|
68
|
+
"description": "Application technology: 'nest' for NestJS API, 'react' for React/Next.js frontend."
|
|
69
|
+
},
|
|
70
|
+
"dockerfile": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"minLength": 1,
|
|
73
|
+
"description": "Path to the Dockerfile relative to the project root."
|
|
74
|
+
},
|
|
75
|
+
"health_check_path": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"minLength": 1,
|
|
78
|
+
"description": "HTTP path for ALB health checks (e.g. /health)."
|
|
79
|
+
},
|
|
80
|
+
"domain": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"minLength": 1,
|
|
83
|
+
"description": "Domain name for this app (e.g. api.example.com)."
|
|
84
|
+
},
|
|
85
|
+
"port": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"minimum": 1,
|
|
88
|
+
"description": "Container port the app listens on."
|
|
89
|
+
},
|
|
90
|
+
"branch": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"default": "main",
|
|
93
|
+
"description": "Git branch that triggers deployment for this app."
|
|
94
|
+
},
|
|
95
|
+
"template_repo_branch": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"default": "main",
|
|
98
|
+
"description": "Branch of the template repository to use for scaffolding."
|
|
99
|
+
},
|
|
100
|
+
"postgres": {
|
|
101
|
+
"type": "boolean",
|
|
102
|
+
"default": false,
|
|
103
|
+
"description": "Provision an RDS PostgreSQL instance for this app."
|
|
104
|
+
},
|
|
105
|
+
"redis": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"default": false,
|
|
108
|
+
"description": "Provision an ElastiCache Redis cluster for this app."
|
|
109
|
+
},
|
|
110
|
+
"variables": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": { "type": "string" },
|
|
113
|
+
"default": {},
|
|
114
|
+
"description": "Runtime environment variables injected into the ECS task."
|
|
115
|
+
},
|
|
116
|
+
"build_env": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": { "type": "string" },
|
|
119
|
+
"default": {},
|
|
120
|
+
"description": "Build-time arguments passed to Docker build (e.g. NEXT_PUBLIC_API_HOST)."
|
|
121
|
+
},
|
|
122
|
+
"workers": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"default": [],
|
|
125
|
+
"description": "Background worker processes for this app.",
|
|
126
|
+
"items": {
|
|
127
|
+
"$ref": "#/definitions/worker"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"cpu_units": {
|
|
131
|
+
"type": "integer",
|
|
132
|
+
"minimum": 1,
|
|
133
|
+
"default": 1024,
|
|
134
|
+
"description": "CPU units for the ECS task (1024 = 1 vCPU)."
|
|
135
|
+
},
|
|
136
|
+
"memory_units": {
|
|
137
|
+
"type": "integer",
|
|
138
|
+
"minimum": 1,
|
|
139
|
+
"default": 2048,
|
|
140
|
+
"description": "Memory in MB for the ECS task."
|
|
141
|
+
},
|
|
142
|
+
"db_instance_type": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"description": "RDS instance type (e.g. db.t3.small). Only used when postgres is true."
|
|
145
|
+
},
|
|
146
|
+
"db_allocated_storage": {
|
|
147
|
+
"type": "integer",
|
|
148
|
+
"minimum": 1,
|
|
149
|
+
"description": "RDS storage in GB. Only used when postgres is true."
|
|
150
|
+
},
|
|
151
|
+
"redis_instance_type": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"description": "ElastiCache node type (e.g. cache.t3.small). Only used when redis is true."
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|