Add test or utility to check all required context variables are present
armenr opened this issue · comments
Minor nitpick, but I lost a couple of hours until I hunted this down:
In my own project, I ported some of the example code from this repo after scaffolding my own cdk project.
I received no warnings or errors from npm run watch
or cdk synth
or npm run build
during any of my development.
When it came to deploy, I kept getting a VERY cryptic and ambiguous error:
Tag must have a value
For the life of me, I couldn't figure out what was missing, or where (I'm an experienced DevOps engineer and architect, and I know JS/TS). I am, however, new to CDK.
After a few hours of trying to debug/investigate by reading through all of the Construct and Stack code, I started diffing my own ported code to the code in the examples repo. THAT is when I finally thought to compare/diff my own cdk.json
file to the one in the example repo, and realized I was missing this line:
"service_name": "myProj-web"
Would it be worth AT LEAST noting this in README.md, or otherwise maybe writing a smaller utility/helper that can check for all required context variables PRIOR to deploy/build?
I lost a few hours on this, and I'm guessing other newbies might as well.