PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Create EBS Volumes and Snapshots

Example 742. Create a new EBS Volume

Creating a brand new EBS Volume requires the size and which zone you want the EBS Volume to be in.

createNewVolume will return an array containing information about the new Volume which includes the volumeId, size, zone, status and createTime.

<?php
$ec2_ebs 
= new Zend_Service_Amazon_Ec2_Ebs('aws_key','aws_secret_key');
$return $ec2_ebs->createNewVolume(40'us-east-1a');

Example 743. Create an EBS Volume from a Snapshot

Creating an EBS Volume from a snapshot requires the snapshot_id and which zone you want the EBS Volume to be in.

createVolumeFromSnapshot will return an array containing information about the new Volume which includes the volumeId, size, zone, status, createTime and snapshotId.

<?php
$ec2_ebs 
= new Zend_Service_Amazon_Ec2_Ebs('aws_key','aws_secret_key');
$return $ec2_ebs->createVolumeFromSnapshot('snap-78a54011''us-east-1a');

Example 744. Create a Snapshot of an EBS Volume

Creating a Snapshot of an EBS Volume requires the volumeId of the EBS Volume.

createSnapshot will return an array containing information about the new Volume Snapshot which includes the snapshotId, volumeId, status, startTime and progress.

<?php
$ec2_ebs 
= new Zend_Service_Amazon_Ec2_Ebs('aws_key','aws_secret_key');
$return $ec2_ebs->createSnapshot('volumeId');

Zend Framework