ZendService\Amazon\Ec2

Introduction

ZendService\Amazon\Ec2 provides an interface to Amazon Elastic Cloud Computing (EC2).

What is Amazon Ec2?

Amazon EC2 is a web service that enables you to launch and manage server instances in Amazon’s data centers using APIs or available tools and utilities. You can use Amazon EC2 server instances at any time, for as long as you need, and for any legal purpose.

Static Methods

To make using the Ec2 class easier to use there are two static methods that can be invoked from any of the Ec2 Elements. The first static method is setKeys which will defind you AWS Access Keys as default keys. When you then create any new object you don’t need to pass in any keys to the constructor.

setKeys() Example

1
ZendService\Amazon\Ec2\Ebs::setKeys('aws_key','aws_secret_key');

To set the region that you are working in you can call the setRegion to set which Amazon Ec2 Region you are working in. Currently there is only two region available us-east-1 and eu-west-1. If an invalid value is passed it will throw an exception stating that.

setRegion() Example

1
ZendService\Amazon\Ec2\Ebs::setRegion('us-east-1');

Note

Set Amazon Ec2 Region

Alternatively you can set the region when you create each class as the third parameter in the constructor method.

Table Of Contents

Previous topic

ZendService\Amazon\Sqs

Next topic

ZendService\Amazon\Ec2: CloudWatch Monitoring

This Page

Note: You need to stay logged into your GitHub account to contribute to the documentation.

Edit this document

Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.

  1. Login with your GitHub account.
  2. Go to ZendService\Amazon\Ec2 on GitHub.
  3. Edit file contents using GitHub's text editor in your web browser
  4. Fill in the Commit message text box at the end of the page telling why you did the changes. Press Propose file change button next to it when done.
  5. On Send a pull request page you don't need to fill in text anymore. Just press Send pull request button.
  6. Your changes are now queued for review under project's Pull requests tab on GitHub.