title: How to use session-manager-plugin command
body: <p>I want to use session-manager-plugin in python code.</p>
  <p>The code is written as follows</p>
  <pre><code>import boto3
  from boto3.session import Session
  import subprocess
  
  AWS_REGION = &quot;ap-northeast-1&quot;
  AWS_PROFILE = &quot;default&quot;
  INSTANCE_ID = &quot;i-XXXXX&quot;
  
  ssm = boto3.client('ssm')
  
  response = ssm.start_session(
      Target=INSTANCE_ID,
      DocumentName='AWS-StartPortForwardingSession',
      Parameters={
          'portNumber': ['3389'],
          'localPortNumber': ['13389'],
      }
  )
  
  parameters = &quot;{'DocumentName': 'AWS-StartPortForwardingSession', 'Target': &quot;+INSTANCE_ID+&quot;, 'Parameters': {'portNumber': ['3389'], 'localPortNumber': ['13389']}}&quot;
  
  def start_aws_ssm_plugin(create_session_response, parameters, profile, region):
      arg0 = '&quot;' + 'session-manager-plugin' + '&quot;'
      arg1 = '&quot;' + str(create_session_response).replace('\'', '\\&quot;') + '&quot;'
      arg2 = region
      arg3 = 'StartSession'
      arg4 = profile
      arg5 = '&quot;' + str(parameters).replace('\'', '\\&quot;') + '&quot;'
      arg6 = 'https://ssm.{region}.amazonaws.com'.format(region=region)
  
      command = arg0 + ' ' + arg1 + ' ' + arg2 + ' ' + arg3 + ' ' + arg4 + ' ' + arg5 + ' ' + arg6
  
      pid = subprocess.Popen(command).pid
      return pid
  
  start_aws_ssm_plugin(response, parameters, AWS_PROFILE, AWS_REGION)
  </code></pre>
  <p>But, the code gets an error.</p>
  <pre><code>panic: interface conversion: interface {} is nil, not string
  
  goroutine 1 [running]:
  github.com/aws/SSMCLI/src/sessionmanagerplugin/session.ValidateInputAndStartSession(0xc00010c000, 0x7, 0x8, 0x14c2380, 0xc000006018)
  </code></pre>
  <p>I wrote the code with reference to &quot;https://stackoverflow.com/questions/65963897/how-do-i-use-the-results-of-an-ssm-port-forwarding-session-started-with-ruby/66043222#66043222&quot;</p>
  <p>If you have any information, please let me know.</p>
  <p>Thank you</p>