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

Zend_Service_Amazon_Ec2: Keypairs

Keypairs are used to access instances.

Example 757. Creating a new Amazon Keypair

create, creates a new 2048 bit RSA key pair and returns a unique ID that can be used to reference this key pair when launching new instances.

create returns an array which contains the keyName, keyFingerprint and keyMaterial.

<?php
$ec2_kp 
= new Zend_Service_Amazon_Ec2_Keypair('aws_key','aws_secret_key');
$return $ec2_kp->create('my-new-key');

Example 758. Deleting an Amazon Keypair

delete, will delete the key pair. This will only prevent it from being used with new instances. Instances currently running with the keypair will still allow you to access them.

delete returns boolean TRUE or FALSE

<?php
$ec2_kp 
= new Zend_Service_Amazon_Ec2_Keypair('aws_key','aws_secret_key');
$return $ec2_kp->delete('my-new-key');

Example 759. Describe an Amazon Keypair

describe returns information about key pairs available to you. If you specify key pairs, information about those key pairs is returned. Otherwise, information for all registered key pairs is returned.

describe returns an array which contains keyName and keyFingerprint

<?php
$ec2_kp 
= new Zend_Service_Amazon_Ec2_Keypair('aws_key','aws_secret_key');
$return $ec2_kp->describe('my-new-key');

Zend Framework