title: boto3 create image using instance id
body: <p>I am using boto3 with python3 for aws usage, in the aws console there is a very simple option for creating an image from a running / stopped ec2 instance. I am looking for something similar in the boto3 SDK, the closest this I found is how to create an image from the EBS volume like so:</p>
  
  <pre><code>session = boto3.Session(...)
  ec2 = session.client("ec2") 
  ec2.create_image(...)
  </code></pre>
  
  <p>as explained <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.create_image" rel="nofollow noreferrer">here</a></p>
  
  <p>I would like to save the need to find out the volume ID for the instance, and just use the instance ID, is that possible? </p>
  
  <p>I tried to follow <a href="https://boto.readthedocs.io/en/latest/ref/ec2.html#boto.ec2.connection.EC2Connection.create_image" rel="nofollow noreferrer">this</a>
  Using this code: </p>
  
  <pre><code>ec2.create_image(instance_id) 
  </code></pre>
  
  <p>But got this error </p>
  
  <blockquote>
    <p>TypeError: create_image() only accepts keyword arguments.</p>
  </blockquote>