title: aws ssm session - how do I set "runAsDefaultuser" to be a interactive parameter when starting a session
body: <p>I'm trying to create a document that I call and specific my IAM user as the user to connect with. This document will be a shared document that has a parameter &quot;runAsDefaultuser&quot;. It will default to a user that doesn't exist. This will force me to provide an argument like,
  --parameters '{&quot;runAsDefaultUser&quot;: [&quot;joeschmo&quot;]}'.</p>
  <p>My end goal is to allow users to login in as their IAM user via CLI through SSM. I've tried using tag's in the IAM user account. That only works when using a SSM session over the Web UI in the AWS Session Manager page. Doesn't work vi SSM CLI. The SSM documents override this.</p>
  <p>I can't set this as a parameter. It will only accept it as a hardcoded value. Same with &quot;runAsEnabled&quot;.</p>
  <p>I get this error when I try to set it as a parameter using the &quot;aws ssm update-document or create-document command.</p>
  <pre><code>An error occurred (InvalidDocumentContent) when calling the UpdateDocument operation: DefaultUser: {{runAsDefaultUser}} is invalid
  </code></pre>
  <p>I'm using this page as a reference.
  <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html</a></p>
  <p>Here is the example document that I am using.</p>
  <pre><code>{
     &quot;schemaVersion&quot;:&quot;1.0&quot;,
     &quot;description&quot;:&quot;Session Document Parameter Example JSON Template&quot;,
     &quot;sessionType&quot;:&quot;Standard_Stream&quot;,
     &quot;parameters&quot;:{
        &quot;s3BucketName&quot;:{
           &quot;type&quot;:&quot;String&quot;,
           &quot;default&quot;:&quot;&quot;
        },
        &quot;s3KeyPrefix&quot;:{
           &quot;type&quot;:&quot;String&quot;,
           &quot;default&quot;:&quot;&quot;
        },
        &quot;s3EncryptionEnabled&quot;:{
           &quot;type&quot;:&quot;String&quot;,
           &quot;default&quot;:&quot;false&quot;
        },
        &quot;cloudWatchLogGroupName&quot;:{
           &quot;type&quot;:&quot;String&quot;,
           &quot;default&quot;:&quot;&quot;
        },
        &quot;cloudWatchEncryptionEnabled&quot;:{
           &quot;type&quot;:&quot;String&quot;,
           &quot;default&quot;:&quot;false&quot;
        },
        &quot;runAsDefaultUser&quot;:{
           &quot;type&quot;:&quot;String&quot;,
           &quot;default&quot;:&quot;nobody&quot;
        }
     },
     &quot;inputs&quot;:{
        &quot;s3BucketName&quot;:&quot;{{s3BucketName}}&quot;,
        &quot;s3KeyPrefix&quot;:&quot;{{s3KeyPrefix}}&quot;,
        &quot;s3EncryptionEnabled&quot;:&quot;{{s3EncryptionEnabled}}&quot;,
        &quot;cloudWatchLogGroupName&quot;:&quot;{{cloudWatchLogGroupName}}&quot;,
        &quot;cloudWatchEncryptionEnabled&quot;:&quot;{{cloudWatchEncryptionEnabled}}&quot;,
        &quot;kmsKeyId&quot;:&quot;&quot;,
        &quot;runAsEnabled&quot;: true
        &quot;runAsDefaultUser&quot;:&quot;{{runAsDefaultUser}}&quot;,
        &quot;shellProfile&quot;: {
          &quot;windows&quot;: &quot;&quot;,
          &quot;linux&quot;: &quot;bash&quot;
        }
     }
  }
  </code></pre>
  <p>The command that I want to use:</p>
  <pre><code>aws ssm start-session --target i-ThisIsObviouslyMadeUp \
  --document-name Custom-SessionManagerRunShell \
  --parameters '{&quot;runAsDefaultUser&quot;: [&quot;joeschmo&quot;]}'
  </code></pre>