Template format error: Every Parameters member must be an object.
This error is not clear. Let me try to help …
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚙️ Check out my series on Automating Cybersecurity Metrics. The Code.
🔒 Related Stories: AWS Security | Application Security | CloudFormation
💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSA: Check the web for plagiarism of anything you publish online. Now onto our blog post…
This error occurred in a template I was deploying recently. It’s the tiniest of errors that causes a deployment to fail and in this case the error message is absolutely unclear. I immediately figured it out but for a newer programmer I would guess this error makes no sense. In fact, it really doesn’t make sense to me but I get why the person who wrote it might have written it the way they did.
When you are writing error messages you should not write them from the perspective of the code you are working with behind the scenes. You should write them from the perspective of the person who gets the error message and tell them exactly how to fix the problem.
It seems to me that the person writing the error should be able to get a handle on the parameter name causing the error. Then, if there is not a properly formatted line that indicates the type of the parameter, give the exact syntax that will resolve the problem.
In this case I had written an AWS CloudFormation template parameter like this:
Parameters:
UserNameParam:
Type:StringCan you spot the error?
Does “Template format error: Every Parameters member must be an object” provide a clear description of the problem and how to fix it? Yes, you might have quickly figured it out if you are an experienced programmer like me, but consider what a better description of this problem might be.
I would think it would be something like this:
The parameter UserNameParam is missing the “Type” property or the line setting the type is not properly formatted. The proper formatting is an indentation followed by “Type: [Your type here]”.
The problem in my code above is one little space missing after the colon. The fix for the code looks like this:
Parameters:
UserNameParam:
Type: StringFollow for updates.
Teri Radichel | © 2nd Sight Lab 2022
About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight LabNeed Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for PresentationFollow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
