title: How to use boto3 to create an AMI from an Amazon EBS Snapshot
body: <p>While creating an image (AMI) in AWS using boto3 lib, providing the following parameters:</p>
  
  <pre><code>ec2.create_image(Name=name, BlockDeviceMappings=[{'DeviceName':device_name,'Ebs':{'SnapshotId':snapshot_id, 'DeleteOnTermination': delete_on_term,
              'VolumeSize':10, 'VolumeType':'gp2'}}])
  </code></pre>
  
  <p>I'm getting this error: <code>Missing required parameter in input: "InstanceId"</code>
  But when I create an image from the User Interface, no Instance Id is required. </p>
  
  <p>In the picture below, you can see that I can create the image from 'Snapshots' page, without specifying instance Id.</p>
  
  <p><a href="https://i.stack.imgur.com/bOcjC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bOcjC.png" alt="enter image description here"></a></p>
  
  <p>Is anyone aware of a workaround? Thanks.</p>