An error occurred (ValidationError) when calling the CreateChangeSet operation: Template error: the attribute in Fn::ImportValue must not depend on any resources, imported values, or Fn::GetAZs
Another misleading error from CloudFormation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚙️ 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
Update: What is odd about this post is that somehow it got updated to a tld of .cn. That particular tld is blocked on my network. I would have never been able to visit that page therefore I do not believe I added that page to this post. Hopefully something odd isn’t going on with Medium.
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.
Follow 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






