2017 © Pedro Peláez
 

library ec2-wrapper

Package for making it easier to work with AWS EC2.

image

irap/ec2-wrapper

Package for making it easier to work with AWS EC2.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 130 % Grown

The README.md

AWS EC2 Wrapper for PHP

This package wraps around Amazon's SDK for EC2 to provide a more object-orientated interface. Thus the developer will spend less time looking up the parameters they can pass into an array. This version of the wrapper is based on version 3 of the SDK., (*1)

Example Usage

<?php 

require_once(__DIR__ . '/vendor/autoload.php');

// create the ec2 client.
$ec2Client = new iRAP\Ec2Wrapper\Ec2Client(
    'myApiKey', 
    'myApiSecret', 
    \iRAP\Ec2Wrapper\Enums\AwsRegion::create_EU_W1()
);

$ubuntuImage = 'ami-cc166eb5';

$launchSpec = new \iRAP\Ec2Wrapper\Objects\LaunchSpecification(
    \iRAP\Ec2Wrapper\Enums\Ec2InstanceType::createT2($size=1),  // 1 = nano
    $ubuntuImage,
    "Name for my instance"
);

// launch 3 instances
$request = new iRAP\Ec2Wrapper\Requests\RequestRunInstances($launchSpec, 3, 3); 
$launchResponse = $ec2client->launchInstances($request);

// get info on the instances we launched.
$launchedInstances = $launchResponse->getEc2Instances();

// Get all of our running instances...
$response = $ec2client->describeInstances();
$instances = $response->getEc2Instances();

// ...and terminate them.
foreach ($instances as $instance)
{
    /* @var $instance \iRAP\Ec2Wrapper\Objects\Ec2Instance */
    $instance->terminate($ec2client);
}

The Versions

09/07 2018

dev-master

9999999-dev http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

The Development Requires

aws ec2

09/07 2018

0.3.1

0.3.1.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

The Development Requires

aws ec2

08/07 2018

dev-sp-stop-instances

dev-sp-stop-instances http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

The Development Requires

aws ec2

08/07 2018

0.3.0

0.3.0.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

The Development Requires

aws ec2

03/07 2018

0.2.2

0.2.2.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

The Development Requires

aws ec2

01/03 2018

0.2.1

0.2.1.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

aws ec2

01/03 2018

0.2.0

0.2.0.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

aws ec2

01/03 2018

0.1.1

0.1.1.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

aws ec2

01/03 2018

0.1.0

0.1.0.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

aws ec2

01/03 2018

0.0.1

0.0.1.0 http://www.irap.org/

Package for making it easier to work with AWS EC2.

  Sources   Download

MIT

The Requires

 

aws ec2