This is a code snippet I am using to manipulate my EC2 instance.
$ec2 = Aws::factory(array(
'key' => $key,
'secret' => $secret,
'region' => $region)
)->get('ec2', true);
$volId = createVol();// This step creates the volume correctly
$ec2->waitUntil('__VolumeStatus', array(
'VolumeIds' => array($volId),
'waiter.success.value' => VolumeState::AVAILABLE
));
attachVolume();//Error
The problem is attachVolume function is throwing error that volume is not available that means waitUntil function is not working correctly. Is there somethings wrong with the way I called this function?