[Bug]: Copilot env deploy shows null error instead of actual CloudFormation error message
Description:
When deploying an environment addon using copilot env deploy, CloudFormation errors are not properly surfaced to the user. Instead of showing the actual error message, Copilot displays a generic "null" error message.
Steps to Reproduce:
- Create a Copilot application with an environment
- Add an addon template (CloudFormation) with a deliberate error (e.g., invalid RDS engine version)
- Run
copilot env deploy
Actual Result: Error message displayed: "Embedded stack arn:aws:cloudformation:[region]:[account]:stack/[stack-name] was not successfully created: null"
Expected Result: The actual CloudFormation error message should be displayed, such as: "Resource handler returned message: Cannot find version 14.7 for postgres (Service: Rds, Status Code: 400)"
Additional Information:
- The actual error message is visible when deploying the same template directly through CloudFormation
- This makes debugging deployment issues much more difficult as users need to check CloudFormation console or deploy separately to see the actual error
- Copilot version: v1.34.0
- AWS Region: eu-west-1
- Operating System: macOS
Workaround: Currently users need to either:
- Check CloudFormation console directly for the actual error message
- Deploy the template directly using AWS CloudFormation to see the error
Suggested Fix: Modify Copilot to properly capture and display the underlying CloudFormation error messages instead of showing "null".
Please find a screenshot from the CloudFormation events tab for reference. Thank you