AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

Cannot parse template as YAML : special characters are not allowed

I get the following error when trying to create a stack using either of the provided templates in Cloudformation.

"Cannot parse template as YAML : special characters are not allowed"

I tried going through the template a bit but I wasn’t exactly sure what was causing this issue.

5 Answers

Hi Andrew,

I’ve replicated this in the past when I copied and pasted from GitHub into the CloudFormation editor.   Seems there are some hidden characters that the validator does not like.  Try cloning the repo locally, then uploading the script into the CloudFormation console and see if that helps.



Thanks.. cloing the gitrepo worked for me..

I cannot find an easy way to open up a new ticket related to this lab, so I’ll do it here.

The supplied YAML files do not provide the intended outcome.

The original stack is left untouched, and after running the ‘Disaster’ stack it creates everything from scratch, leaving the original website in a perfectly working condition.

The new stack of course outputs a new FQDN, in contrast to what is shown to be expected in the video.

At any rate I went ahead with ‘fixing’ the broken parts, but wasn’t able to load up the site, and it became clear that the reason is that the webserver was not running, because the user script failed with "Failed running /var/lib/cloud/instance/scripts/part-001" since "One of the configured repositories failed (Unknown),"

This lab is very poorly made (and maintained), I wasted an hour on it, and you should really improve it



You need to update the first stack with the second file, not create a second stack

K Troshin

Or just create another instance with the same user data and see that it works if the VPC config is OK. I actually think, it is a good exercise to see that the stuff is still broken because user data failed.

Just copy the contents from github and paste into a text file then change the extension. Any special characters you’ve copied won’t save to your notepad.

Select "raw" in the file page – will give you plain text.


this approached was fast and worked for me, thanks.

Also can’t figure out how to leave feedback on this lab so I’m going to leave some in this thread.  The first CF stack creates successfully but website in not accessible. Tried hitting via the public IP and the FQDN. Tried in multiple regions and no dice. Something is off here. SG shows 80 accessible from Not sure what’s happening here.  Should it be broken before applying the CF Template that breaks it?

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?