Another misleading error from CloudFormation
This error is kind of right but mostly unhelpful in the particular case I was having. I had named some parameters I passed into my template in a complex way, not to mention I probably need glasses.
I was looking at my template over and over and thought I had copied the documentation exactly for FN::Import — even the weird caveats.
Finally I copied and pasted the code from the documentation and then copied and pasted my parameter names into the sub name. That worked.
I think I probably had a typo in the Sub that was referencing a parameter. So the error message is telling me something that in this case doesn’t make sense.
It would be more appropriate to say:
The value referenced in your Sub does not exist in this template. Check to see that the name you are passing in exactly matches what you are are trying to reference.
Also I wish AWS would fix the inconsistent syntax. It’s hard to remember how to create all these one-off cases.
One more: I saw someone else got the same error I go where the FN::Import cannot be on the same line as the property — a mapping error. The person responding to them said “well it’s invalid yaml.” But this is CloudFormation, not just Yaml. Overwrite that underlying YAML error message with something more meaningful in the context of CloudFormation.
Teri Radichel
If you liked this story please clap and follow:
Medium: Teri Radichel or Email List: Teri Radichel
Twitter: @teriradichel or @2ndSightLab
Requests services via LinkedIn: Teri Radichel or IANS Research
© 2nd Sight Lab 2022
____________________________________________
Author:
Cybersecurity for Executives in the Age of Cloud on Amazon

Need Cloud Security Training? 2nd Sight Lab Cloud Security Training
Is your cloud secure? Hire 2nd Sight Lab for a penetration test or security assessment.
Have a Cybersecurity or Cloud Security Question? Ask Teri Radichel by scheduling a call with IANS Research.
Cybersecurity & Cloud Security Resources by Teri Radichel: Cybersecurity and Cloud security classes, articles, white papers, presentations, and podcasts
