It's relatively easy to create a new instance using PHP by using the runInstances()
method.
$instance = $ec2->runInstances(array(
'ImageId' => AMI_ID, // AMI ID
'InstanceType' => AMI_TYPE, // m1.medium etc.
'MinCount' => 1, // Minimum to create
'MaxCount' => 1, // Maximum to create
'SecurityGroups' => SEC_NAME, // Security Group Name
'KeyName' => KEY_NAME // Key Pair to use
))->toArray(); // Get back our data in an array
However, the point of the API is to be able to do everything you can do with the front-end on the amazon website, in a tenth of the time and with your own code.
With that in mind, I need to do the following:
On the front-end, I can change the Volume Size to, say, 40GB.
How can I ask for a 40GB Volume Size when creating a new Instance with PHP? It could even be run after the instance is created, as long as it's automatic - I should be able to do this programatically.
How can I achieve what I require using the AWS SDK for PHP 2?