avatarTeri Radichel

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2100

Abstract

4KyDvF7R_Mc_2zhIrSg.png"><figcaption></figcaption></figure><p id="24c2">which leads to this error:</p><blockquote id="2d39"><p>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.</p></blockquote><p id="4346">Do you see the problem? Look at the last line above.</p><p id="92d5">It should be indented like this:</p><figure id="d59e"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*fQYNhv-_0rjf-bhEvyKwgA.png"><figcaption></figcaption></figure><p id="235c">Join requires a list of two items. In YAML a list is represented like this list of fruit.</p><div id="20d8"><pre><span class="hljs-bullet">- </span>apple <span class="hljs-bullet">- </span>orange <span class="hljs-bullet">- </span>banana <span class="hljs-bullet">- </span>dragonfruit</pre></div><p id="f4cf">Join needs a list with the delimiter and the things to be concatenated:</p><div id="1606"><pre>!Join

  • [your delimter like <span class="hljs-keyword">an</span> <span class="hljs-literal">empty</span> <span class="hljs-keyword">string</span>, <span class="hljs-keyword">a</span> <span class="hljs-literal">comma</span>, <span class="hljs-keyword">a</span> <span class="hljs-literal">space</span>, <span class="hljs-keyword">or</span> <span class="hljs-keyword">a</span> <span class="hljs-literal">tab</span>]
  • [your list goes hehre]</pre></div><p id="a456">So if I want a comma delimited list of fruit it would look like this:</p><div id="3ff4"><pre>!<span class="hljs-keyword">Join </span> - <span class="hljs-string">','</span>
    • apple <span class="hljs-comment">#<<< two dashes here</span>
    • <span class="hljs-keyword">orange </span><span class="hljs-comment">#<<< indented</span>
    • <span class="hljs-keyword">banana </span><span class="hljs-comment">#<<< indented</span>
    • dragonfruit <span class="hljs-comment">#<<< indented</span></pre></div><p id="d0b7">What AWS CloudShell keeps doing to me is this:</p

Options

<div id="59f7"><pre>!<span class="hljs-keyword">Join

</span> - <span class="hljs-string">','</span>

    • apple <span class="hljs-comment">#<<< two dashes here</span>
  • <span class="hljs-keyword">orange </span><span class="hljs-comment">#<<< not indented</span>
  • <span class="hljs-keyword">banana </span><span class="hljs-comment">#<<< not indented</span>
  • dragonfruit <span class="hljs-comment">#<<< not indented</span></pre></div><p id="83b9">Follow for updates.</p><p id="4a3a">Teri Radichel | <i>© <a href="https://2ndsightlab.com/?source=post_page---------------------------">2nd Sight Lab</a> 2023</i></p><div id="8b5f"><pre><span class="hljs-section">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 Lab</pre></div><div id="caae"><pre><span class="hljs-section">Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation</pre></div><div id="96b9"><pre>Follow <span class="hljs-keyword">for</span> more stories like <span class="hljs-keyword">this</span>:

❤️ Sign Up my Medium Email List ❤️ Twitter: <span class="hljs-meta">@teriradichel</span> ❤️ LinkedIn: https:<span class="hljs-comment">//www.linkedin.com/in/teriradichel</span> ❤️ Mastodon: <span class="hljs-meta">@teriradichel</span><span class="hljs-meta">@infosec</span>.exchange ❤️ Facebook: 2nd Sight Lab ❤️ YouTube: @2ndsightlab</pre></div><figure id="7286"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*4oxP4LXk8l8c3mpRvO7ejg.png"><figcaption></figcaption></figure></article></body>

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
- dragonfruit

Join 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 #<<< indented

What AWS CloudShell keeps doing to me is this:

!Join
  - ','
  - - apple #<<< two dashes here
  - orange #<<< not indented
  - banana #<<< not indented
  - dragonfruit #<<< not indented

Follow 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 Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow 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
Error Message
Join
List
Indentation
Cloud Shell
Recommended from ReadMedium