title: creating aws workspaces using ansible
body: <p>I am trying to automate the creation of aws workspaces using ansible, but I cant get the command to create the workspace right.</p>
  <p>Here is my playbook.yml and I am running ansible on a linux ec2 instance.</p>
  <pre class="lang-yaml prettyprint-override"><code>- hosts: windows
    gather_facts: false
    vars:
      BundleId: &quot;wpc-30g6060&quot;
      DirectoryId: &quot;d-8039964&quot;
      UserName: &quot;testing&quot;
  
    tasks:
      - name: deploy workspaces
        command: &gt;
          aws workspaces create-workspaces --workspaces  
          --cli-input-json '{{ lookup('template', 'workspaces.json') | to_json }}'
        delegate_to: localhost
        # loop: &quot;{{ user_list }}&quot;
  </code></pre>
  <p>Here is the workspaces.json</p>
  <pre class="lang-json prettyprint-override"><code>{
        &quot;DirectoryId&quot;: &quot;{{ DirectoryId }}&quot;,
        &quot;UserName&quot;: &quot;{{ UserName }}&quot;,
        &quot;BundleId&quot;: &quot;{{ BundleId }}&quot;,
        &quot;UserVolumeEncryptionEnabled&quot;: false,
        &quot;RootVolumeEncryptionEnabled&quot;: false,
        &quot;WorkspaceProperties&quot;: {
          &quot;RunningMode&quot;: &quot;ALWAYS_ON&quot;,
          &quot;RunningModeAutoStopTimeoutInMinutes&quot;: 5,
          &quot;RootVolumeSizeGib&quot;: 80,
          &quot;UserVolumeSizeGib&quot;: 10,
          &quot;ComputeTypeName&quot;: &quot;PERFORMANCE&quot;
        },
        &quot;Tags&quot;: [
          {
            &quot;Key&quot;: &quot;&quot;,
            &quot;Value&quot;: &quot;&quot;
          }
        ]
  }
  </code></pre>
  <p>I keep getting the following error when I run the playbook</p>
  <blockquote>
  <p>[&quot;&quot;, &quot;Error parsing parameter '--cli-input-json': Invalid type: expecting map, received &lt;class 'str'&gt;&quot;], &quot;stdout&quot;: &quot;&quot;, &quot;stdout_lines&quot;: []}&quot;</p>
  </blockquote>
  <p>I cant figure out why.</p>