Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first problem, here, is quoting and formatting:</p> <pre><code>$ launch="{"ImageId":"ami-a999999","InstanceType":"c1.medium"} "SecurityGroups":"launch-wizard-6"" </code></pre> <p>This isn't going to generate valid JSON, because the block you copied from the help file includes a spurious closing brace from a nested object that you didn't include, the closing brace is missing, and the unescaped double quotes are disappearing.</p> <p>But we're not really getting to the point where the json is actually being validated, because with that space after the last brace, the cli is assuming that SecurityGroups and launch-wizard-6 are more command line options following the argument to <code>--launch-specification</code>: </p> <pre><code>$ echo $launch {ImageId:ami-a999999,InstanceType:c1.medium} SecurityGroups:launch-wizard-6 </code></pre> <p>That's probably not what you expected... so we'll fix the quoting so that it looks like one long argument, after the json is valid:</p> <p>From the perspective of just generating valid json <em>structures</em> (not necessarily content), the data you are most likely trying to send would actually look like this, based on the docs:</p> <pre><code>{"ImageId":"ami-a999999","InstanceType":"c1.medium","SecurityGroups":["launch-wizard-6"]} </code></pre> <p>Check that as structurally valid JSON, <a href="http://jsonlint.com/" rel="nofollow">here</a>.</p> <p>Fixing the bracing, commas, and bracketing, the CLI stops throwing that error, with this formatting:</p> <pre><code>$ launch='{"ImageId":"ami-a999999","InstanceType":"c1.medium","SecurityGroups":["launch-wizard-6"]}' $ echo $launch {"ImageId":"ami-a999999","InstanceType":"c1.medium","SecurityGroups":["launch-wizard-6"]} </code></pre> <p>That isn't to say the API might not subsequently reject the request due to something else incorrect or missing, but you were never actually getting to the point of sending anything to the API; this was failing local validation in the command line tools.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload