Template format error: unsupported structure seen in AWS CloudFormation

In case, you are using windows file system, you can use like this:

--template-body file://c:/Windows/myfile.json

or

--template-body file://localhost/c$/Windows/myfile.json

Apparently, the very unhelpful error message comes as a result of improper formatting in the CLI command.

The --template-body argument must be specified as a file URI.

Thus, the correct, runnable form of the command above is:

▶ aws cloudformation validate-template --template-body file://template.yml

See this blog post for more information.