Skip to content

Commit 48bad5d

Browse files
authored
fix(cli): error message when early validation failures cannot be retrieved is unclear (#995)
Clarified error message for early validation failures in deployments. The current error message is confusing: it can be taken to mean that the CLI version is outdated, which is not the case. It also mentions the CDK Toolkit stack version without any explanation - it is not clear which version it is referring to. I also believe that saying "with the latest version of the CLI" is redundant - the error message will only appear in a sufficiently up-to-date CLI. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 191ed69 commit 48bad5d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/@aws-cdk/toolkit-lib/lib/api/deployments/early-validation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export class EarlyValidationReporter implements ValidationReporter {
2626

2727
return `The template cannot be deployed because of early validation errors, but retrieving more details about those
2828
errors failed (${error}). Make sure you have permissions to call the DescribeEvents API, or re-bootstrap
29-
your environment with the latest version of the CLI (need at least version 30, current version ${currentVersion ?? 'unknown'}).`;
29+
your environment by running 'cdk bootstrap' to update the Bootstrap CDK Toolkit stack.
30+
Bootstrap toolkit stack version 30 or later is needed; current version: ${currentVersion ?? 'unknown'}.`;
3031
}
3132

3233
let message = `ChangeSet '${changeSetName}' on stack '${stackName}' failed early validation`;

packages/@aws-cdk/toolkit-lib/test/api/deployments/deploy-stack.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,8 @@ test('deployStack warns when it cannot get the events in case of early validatio
804804
}),
805805
).rejects.toThrow(`The template cannot be deployed because of early validation errors, but retrieving more details about those
806806
errors failed (Error: AccessDenied). Make sure you have permissions to call the DescribeEvents API, or re-bootstrap
807-
your environment with the latest version of the CLI (need at least version 30, current version 0).`);
807+
your environment by running 'cdk bootstrap' to update the Bootstrap CDK Toolkit stack.
808+
Bootstrap toolkit stack version 30 or later is needed; current version: 0.`);
808809
});
809810

810811
test('deploy not skipped if template did not change but one tag removed', async () => {

0 commit comments

Comments
 (0)