-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloud-formation validate-template example doesn't work #1489
Comments
- The original example referenced a local file URL, which is not supported by the validate-template command. Switched to use an S3 URL. Fixes aws#1489.
|
OK, thanks for clarifying! |
This is unbelievably confusing and a very poor design choice. While
fails with the extremely cryptic error message
The following command
succeeds. In addition, the error message is extremely misleading, as it implies that parsing was attempted and failed, not that the document was not found/failed to be loaded. There should either be
|
@boompig That is because without the file URL syntax, the filename you entered is being evaluated as the template itself. The file name is not a valid JSON or YAML file. You could replace the filename in your first example with the actual JSON and it would evaluate it in place. |
@bamapookie But I hope you would agree that it wouldn't be difficult to look at the length of the argument and recognize that not to be the case and supply a more useful error message. Even a hint such as (did you forget to include 'file:') would be nice. The existing error message not only does nothing to let the user know what the real problem is but misleads her or him into thinking they have an invalid template -- which is arguably worse. |
@bamapookie Thank you for your explanation.
But why is that the case? This violates the logic assumption of the programmer using the interface. Also, while your explanation helps explain the reason the observed behaviour occurs, it does not address:
|
This still occurs, although the issue is closed. The verification process still returns a ValidationError when |
@C-Kenny That is by design. The |
Thanks @bamapookie , I guess I was expecting a different parameter for passing in files, rather than prepending it with |
@C-Kenny I'm with you. I would prefer a different flag for specifying a file, but this works for me. |
This decision makes perfect sense if you ignore how literally every single command line program works for the last 40 years. So in other words, this is a head scratching decision. There should 100% be a file flag or it should just attempt once to parse it then see if the file exists. |
I just hit this issue also. The error message is very misleading, steering me to the structure of the yml file when actually the "file://" is missing It's lucky I found this thread and went through the whole discussion |
Thank God for this thread, this almost got me stuck. |
The example command for
cloud-formation validate-template
uses--template-body
to reference a local file:// URL, which doesn't work:I'm using aws-cli/1.8.1.
It looks from the rest of the docs that the example meant to be using
template-url
, which would also require using a URL pointing to an object in an AWS S3 bucket in the same region as the template.The text was updated successfully, but these errors were encountered: