Template error: every Fn::Join object requires two parameters, (1) a string delimiter and (2) a list of strings to be joined or a function that returns a list of strings (such as Fn::GetAZs) to be joined.
I seem to be making this error a lot because AWS CloudShell is “fixing” my template indentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚙️ Check out my series on Automating Cybersecurity Metrics | Code.
🔒 Related Stories: Bugs | AWS Security | Secure Code
💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I’ve gotten this single error too many times already today so documenting it in case anyone else is stuck on it. I happen to be working on inital admin scripts for a new AWS account in my latest series. Normally I don’t recommend CloudShell but it’s the easiest way to deploy the initial user and required policies.
So I’m usign CloudShell and I have some Join statements. And every time I copy and paste for one thing, CloudShell does not handle that well at all, as I’ve written before. I hope that will be fixed when AWS releases Amazon Linux 2023 in CloudShell.
In addition, when I copy and paste lines of code or move them around CloudShell jumps my code around and sometimes I don’t notice.
Here’s what I end up with:

which leads to this error:
Template error: every Fn::Join object requires two parameters, (1) a string delimiter and (2) a list of strings to be joined or a function that returns a list of strings (such as Fn::GetAZs) to be joined.
Do you see the problem? Look at the last line above.
It should be indented like this:

Join requires a list of two items. In YAML a list is represented like this list of fruit.
- apple
- orange
- banana
- dragonfruitJoin needs a list with the delimiter and the things to be concatenated:
!Join
- [your delimter like an empty string, a comma, a space, or a tab]
- [your list goes hehre]So if I want a comma delimited list of fruit it would look like this:
!Join
- ','
- - apple #<<< two dashes here
- orange #<<< indented
- banana #<<< indented
- dragonfruit #<<< indentedWhat AWS CloudShell keeps doing to me is this:
!Join
- ','
- - apple #<<< two dashes here
- orange #<<< not indented
- banana #<<< not indented
- dragonfruit #<<< not indentedFollow for updates.
Teri Radichel | © 2nd Sight Lab 2023
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
