Add a very basic AWS API to libphutil
Summary:
I want programmatic access to EC2 in order to make DryDock do something
nontrivial. The two major PHP EC2 implementations I could find weren't thrilling
to me:
- AWS PHP SDK: http://aws.amazon.com/sdkforphp/ - Major drawback is that it's
gigantic (27,000 lines) and very heavyweight (defines its own array-like class,
for instance).
- Amazon EC2 Client in PHP: http://aws.amazon.com/code/442 - Lightweight, but
uses SOAP and thus has 1K lines of envelope-signing stuff. Defines a bunch of
classes like "images" and "groups". Assumes key information is in declare()s,
etc.
Instead, just provide simple Query API access on top of Futures.
Test Plan:
Wrote a little script like this:
#!/usr/bin/env php <?php $root = dirname(dirname(dirname(__FILE__))); require_once $root.'/scripts/__init_script__.php'; $future = new PhutilAWSEC2Future(); $future->setAWSKeys( 'YOUR-ACCESS-KEY', 'YOUR-PRIVATE-KEY'); $future->setRawAWSQuery( 'DescribeInstances', array( )); var_dump($future->resolve());
...and issued some queries, including allocating an instance.
Reviewers: btrahan, jungejason
Reviewed By: btrahan
CC: aran
Differential Revision: https://secure.phabricator.com/D1452