Error parsing AWS CloudFormation template
I’ve gotten this error a couple of instances now whereas working a CloudFormation script. I suppose it’s passing up the decrease degree error from YAML:
whereas parsing a block mapping
in "<unicode string>", line 5, column 1:
^ (line: 5)
anticipated <block finish>, however discovered '<block mapping begin>'
in "<unicode string>", line 10, column 2:
^ (line: 10)
The error message at the least provides you a number of good clues. It tells you exactly what line the issue is on and the factor inflicting the issue. It’s a stack hint so I feel actually we solely want the second block of the error message right here, however I can see in my case the issue is with GroupDescriptionParam.
That’s an awesome clue and it’s, the truth is, on line 10 in my template. Nice. So what’s the precise downside?
I’ve a colon after the parameter identify. The kinds look appropriate. For those who’re youthful than me with superb eyesight you would possibly spot it instantly however the first time I acquired this error it took me a bit to see it. Now I acknowledge the error message.
I want an area earlier than the parameter identify to align it with the others:
The littlest issues like that may generally journey you up and waste time when the error message isn’t clear. If you get an identical error in Python, it tells you, “Hey, you’ve got an indentation error.” It could be good if CloudFormation would do the identical factor right here no matter what YAML reviews.
At any fee…one other bug resolved in my code at the least. Hope that helps another person.
For those who preferred this story please clap and comply with:
Medium: Teri Radichel or E-mail Checklist: Teri Radichel
Twitter: @teriradichel or @2ndSightLab
Requests providers through LinkedIn: Teri Radichel or IANS Analysis
© 2nd Sight Lab 2022
Want Cloud Safety Coaching? 2nd Sight Lab Cloud Safety Coaching
Cybersecurity & Cloud Safety Sources by Teri Radichel: Cybersecurity and Cloud safety lessons, articles, white papers, shows, and podcasts