Skip to content

Commit 21c8608

Browse files
committed
fix: default timeout not set
1 parent a02149f commit 21c8608

6 files changed

Lines changed: 89 additions & 10 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ CDKO's `.cdko.json` automatically maps your patterns (`*MyApp`) to the correct c
105105

106106
## Environment Variables
107107

108-
- `CDK_TIMEOUT` - Timeout for CDK operations (default: "30m")
108+
- `CDK_TIMEOUT` - Timeout for CDK operations (default: "not set")
109109
- `CDK_CLI_NOTICES` - Set to "true" to show CDK notices (default: hidden)
110110
- `DEBUG` - Enable detailed error traces for troubleshooting
111111

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ async function main() {
7575
const stackManager = new StackManager();
7676
const config = await stackManager.loadConfig();
7777

78-
const cdkTimeout = config.cdkTimeout || "30m";
79-
process.env.CDK_TIMEOUT = cdkTimeout;
78+
if (config.cdkTimeout) {
79+
process.env.CDK_TIMEOUT = config.cdkTimeout;
80+
}
8081

8182
const regions = stackManager.getRegions(config, args.regions);
8283

@@ -123,6 +124,7 @@ ${Object.entries({
123124
Mode: args.mode,
124125
Deployment: args.sequential ? "sequential" : "parallel",
125126
Dependencies: args.includeDeps ? "included" : "excluded",
127+
Timeout: process.env.CDK_TIMEOUT || "not set",
126128
})
127129
.map(([k, v]) => `${logger.dim(k + ":")} ${v}`)
128130
.join("\n")}`);

src/core/executor.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ export async function runCdkCommand(
8181
process.env.AWS_REGION = region;
8282
process.env.FORCE_COLOR = "1";
8383

84-
const timeout = process.env.CDK_TIMEOUT || "30m";
85-
86-
return await $({
84+
const cdkProcess = $({
8785
signal,
8886
quiet: ["diff", "deploy"].includes(command) ? false : !verbose,
89-
})`cdk ${cdkArgs}`.timeout(timeout as Duration);
87+
})`cdk ${cdkArgs}`;
88+
89+
return process.env.CDK_TIMEOUT
90+
? await cdkProcess.timeout(process.env.CDK_TIMEOUT as Duration)
91+
: await cdkProcess;
9092
}

src/core/stack-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class StackManager {
137137
return {
138138
version: "0.1",
139139
stackGroups,
140-
cdkTimeout: process.env.CDK_TIMEOUT || "30m",
140+
cdkTimeout: process.env.CDK_TIMEOUT,
141141
suppressNotices: process.env.CDK_CLI_NOTICES !== "true",
142142
lastUpdated: new Date().toISOString(),
143143
updatedBy: `cdko@${await this.getCdkoVersion()}`,

test/.cdko.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"version": "0.1",
3+
"stackGroups": {
4+
"Production-API": {
5+
"unknown-account/unknown-region": {
6+
"constructId": "Production-API",
7+
"account": "unknown-account",
8+
"region": "unknown-region"
9+
}
10+
},
11+
"Production-Database": {
12+
"unknown-account/unknown-region": {
13+
"constructId": "Production-Database",
14+
"account": "unknown-account",
15+
"region": "unknown-region"
16+
}
17+
},
18+
"Production-Frontend": {
19+
"unknown-account/unknown-region": {
20+
"constructId": "Production-Frontend",
21+
"account": "unknown-account",
22+
"region": "unknown-region"
23+
}
24+
},
25+
"Production-Cache": {
26+
"unknown-account/us-east-1": {
27+
"constructId": "Production-Cache",
28+
"account": "unknown-account",
29+
"region": "us-east-1"
30+
},
31+
"unknown-account/eu-west-1": {
32+
"constructId": "Production-Cache-EU",
33+
"account": "unknown-account",
34+
"region": "eu-west-1"
35+
}
36+
},
37+
"Production-Audit": {
38+
"123456789012/unknown-region": {
39+
"constructId": "Production-Audit",
40+
"account": "123456789012",
41+
"region": "unknown-region"
42+
}
43+
},
44+
"Production-Compliance": {
45+
"123456789012/us-east-1": {
46+
"constructId": "Production-Compliance",
47+
"account": "123456789012",
48+
"region": "us-east-1"
49+
}
50+
},
51+
"Production-App": {
52+
"unknown-account/us-east-1": {
53+
"constructId": "Production-App",
54+
"account": "unknown-account",
55+
"region": "us-east-1"
56+
},
57+
"unknown-account/eu-central-1": {
58+
"constructId": "Production-App-Frankfurt",
59+
"account": "unknown-account",
60+
"region": "eu-central-1"
61+
}
62+
},
63+
"Production-App-Oregon": {
64+
"unknown-account/us-west-2": {
65+
"constructId": "Production-App-Oregon",
66+
"account": "unknown-account",
67+
"region": "us-west-2"
68+
}
69+
}
70+
},
71+
"cdkTimeout": "30m",
72+
"suppressNotices": true,
73+
"lastUpdated": "2025-07-15T15:35:34.010Z",
74+
"updatedBy": "cdko@1.0.4"
75+
}

0 commit comments

Comments
 (0)