title: How do you properly format the syntax in an AWS System Manager Document using downloadContent sourceInfo StringMap
body: <p>My goal is to have an AWS System Manager Document download a script from S3 and then run that script on the selected EC2 instance. In this case, it will be a Linux OS.</p>
  <p>According to <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-plugins.html#aws-downloadContent" rel="nofollow noreferrer">AWS documentation for aws:downloadContent</a> the sourceInfo Input is of type StringMap.</p>
  <p>The example code looks like this:</p>
  <pre><code>{
    &quot;schemaVersion&quot;: &quot;2.2&quot;,
    &quot;description&quot;: &quot;aws:downloadContent&quot;,
    &quot;parameters&quot;: {
      &quot;sourceType&quot;: {
      &quot;description&quot;: &quot;(Required) The download source.&quot;,
      &quot;type&quot;: &quot;String&quot;
    },
    &quot;sourceInfo&quot;: {
      &quot;description&quot;: &quot;(Required) The information required to retrieve the content from the required source.&quot;,
      &quot;type&quot;: &quot;StringMap&quot;
      }
    },
    &quot;mainSteps&quot;: [
      {
        &quot;action&quot;: &quot;aws:downloadContent&quot;,
        &quot;name&quot;: &quot;downloadContent&quot;,
        &quot;inputs&quot;: {
          &quot;sourceType&quot;:&quot;{{ sourceType }}&quot;,
          &quot;sourceInfo&quot;:&quot;{{ sourceInfo }}&quot;
        }
      }
    ]
  }
  </code></pre>
  <p>This code assumes you will run this document by hand (console or CLI) and then enter the sourceInfo in the parameter. When running this document by hand, anything entered in the parameter (an S3 URL) isn't accepted. However, I'm not trying to run this by hand, but rather programmatically and I want to hard code the S3 URL into sourceInfo in mainSteps.</p>
  <p>AWS does give an example of syntax that looks like this:</p>
  <pre><code>{
  &quot;path&quot;: &quot;https://s3.amazonaws.com/aws-executecommand-test/powershell/helloPowershell.ps1&quot; 
  }
  </code></pre>
  <p>I've coded the document action in mainSteps like this:</p>
  <pre><code>        {
              &quot;action&quot;: &quot;aws:downloadContent&quot;,
              &quot;name&quot;: &quot;downloadContent&quot;,
              &quot;inputs&quot;: {
                &quot;sourceType&quot;: &quot;S3&quot;,
                &quot;sourceInfo&quot;:
                  {
                    &quot;path&quot;: &quot;https://s3.amazonaws.com/bucketname/folder1/folder2/script.sh&quot;
                  },
                  &quot;destinationPath&quot;: &quot;/tmp&quot;
              }
          },
  </code></pre>
  <p>However, it doesn't seem to work and I receive this error:</p>
  <blockquote>
  <p><strong>invalid format in plugin properties map[sourceInfo:map[path:https://s3.amazonaws.com/bucketname/folder1/folder2/script.sh] sourceType:S3];
  error json: cannot unmarshal object into Go struct field DownloadContentPlugin.sourceInfo of type string</strong></p>
  </blockquote>
  <p>Note: I have seen this <a href="https://stackoverflow.com/questions/57330403/aws-download-content-in-yaml">post</a> that references how to format it for Windows. I did try it, didn't work and doesn't seem relevant to my Linux needs.</p>
  <p>So my questions are:</p>
  <ol>
  <li>Do you need a parameter for sourceInfo of type StringMap - something that won't be used within the aws:downloadContent {{ sourceInfo }} mainSteps?</li>
  <li>How do you properly format the aws:downloadContent action sourceInfo StringMap in mainSteps?</li>
  </ol>
  <p>Thank you for your effort in advance.</p>