Specify storage when launching ec2 instance with AWS SDK
<p>In could not find in the <a href="http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#runInstances-property" rel="nofollow">docs</a> how to specify the root storage when starting a new ec2 instance. If I start an instance through the web interface, I can go through this step: <a href="https://i.stack.imgur.com/TLMTu.png" rel="nofollow"><img src="https://i.stack.imgur.com/TLMTu.png" alt="enter image description here"></a></p>

<p>to change storage settings before launching the instance. How can I do that with the SDK? Currently I have:</p>

<pre><code>AWS = require('aws-sdk');
var ec2 = new AWS.EC2({
  accessKeyId: accessKeyId,
  secretAccessKey: secretAccessKey,
  region: 'us-east-1'
});

var params = {
  ImageId: 'ami-123456',
  InstanceType: 't2.micro',
  MinCount: 1, MaxCount: 1,
  SecurityGroups: [
    'my-security-group',
  ],
  // how to specify storage settings??
};

// Create the instance
ec2.runInstances(params, function(err, data) {
  if (err) { console.log("Could not create instance", err); return; }

  var instanceId = data.Instances[0].InstanceId;
  console.log("Created instance", instanceId);
});
</code></pre>