Describe the feature
When CloudFormation changeset creation fails due to early validation (e.g., AWS::EarlyValidation::ResourceExistenceCheck), the CDK CLI should automatically fetch and display the detailed validation errors from the CloudFormation DescribeEvents API, rather than directing users to manually query the API or use the AWS Console.
Use Case
I'm now getting early validation errors like this (which are great, in theory!):
❌ MyStack failed: ToolkitError: Failed to create ChangeSet cdk-deploy-change-set on MyStack: FAILED, The following hook(s)/validation failed: [AWS::EarlyValidation::ResourceExistenceCheck]. To troubleshoot Early Validation errors, use the DescribeEvents API for detailed failure information.
This error message tells me validation failed but doesn't tell me why. I have to:
- Log into the AWS Console
- Navigate to CloudFormation → Stacks → Events
- Find the actual error message
When I do, I see clear, actionable information:
Resource of type 'AWS::Lambda::Function' with identifier 'my-lambda-function' already exists.
Proposed Solution
When changeset creation fails with an early validation error, the CDK CLI should:
- Detect early validation failure patterns (e.g.,
AWS::EarlyValidation::* in the status reason)
- Call the DescribeEvents API with
FailedEvents=true filter
- Extract and display the detailed validation error messages inline
Desired output:
❌ MyStack failed: Early validation failed
AWS::Lambda::Function (my-lambda-function)
Resource of type 'AWS::Lambda::Function' with identifier 'my-lambda-function' already exists.
To see all events: aws cloudformation describe-events --stack-name MyStack --failed-events true
Other Information
Acknowledgements
CDK version used
2.1031.0 (build 3d7b09b)
Environment details (OS name and version, etc.)
MacOS
Describe the feature
When CloudFormation changeset creation fails due to early validation (e.g.,
AWS::EarlyValidation::ResourceExistenceCheck), the CDK CLI should automatically fetch and display the detailed validation errors from the CloudFormation DescribeEvents API, rather than directing users to manually query the API or use the AWS Console.Use Case
I'm now getting early validation errors like this (which are great, in theory!):
This error message tells me validation failed but doesn't tell me why. I have to:
When I do, I see clear, actionable information:
Proposed Solution
When changeset creation fails with an early validation error, the CDK CLI should:
AWS::EarlyValidation::*in the status reason)FailedEvents=truefilterDesired output:
Other Information
Acknowledgements
CDK version used
2.1031.0 (build 3d7b09b)
Environment details (OS name and version, etc.)
MacOS