Proper error reporting
Although this action works nicely when things work out correctly, the error reporting when things go wrong is lacking. In fact, the error reporting is so poor that, when I need to debug a certain class of errors, I need to add a step to my github actions issuing the command aws cloudformation deploy just so that I can debug the problem.
I can provide a concrete example. My deployment just failed, and aws-cloudformation-github-deploy issues the following error:
Error: 1 validation error detected: Value 'AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
(...)
(the beginning of the template follows)
With that kind of error I am clueless about how to fix my deployment. When I use the AWS CLI I obtain:
Templates with a size greater than 51,200 bytes must be deployed via an S3 Bucket. Please add the --s3-bucket parameter to your command. The local template will be copied to that S3 bucket and then deployed.
Error: Process completed with exit code 255.
I can provide a single example right now, but I have found myself in this situation multiple times. Thus:
- Am I doing something wrong? Do we have a documented/undocumented
--debugflag that I should be using? - If not: are you interested in reworking the error reporting? Should I try to open a PR?
Honestly! I am thinking of using some sort of debug to print this! Some help to make life easier would be amazing or if any body has any better ideas?
One thing that I have used in the past to help catch errors is the tool cfn-lint. It can be used to lint your templates for common issues or discrepancies. It doesn't help with deployment errors, but it's a good way to catch errors prior to deployment.
@waggonerjake cfn-lint is a good tool to use, that however provides utility that is orthogonal that what I am asking for here.
This issue is not about preventing errors, but about understanding the error when they happen.
Same thing happened to us today with the 51,200 bytes. I wish this was fixed