Tag: SDK


Release: AWS SDK for PHP – Version 2.4.9

by Michael Dowling | on | in PHP | Permalink | Comments |  Share

We would like to announce the release of version 2.4.9 of the AWS SDK for PHP. This release adds support for cross zone load balancing in Elastic Load Balancing, stack policies in AWS CloudFormation, and the Gateway-Virtual Tape Library in AWS Storage Gateway.

Changelog

  • Added support for cross-zone load balancing to the Elastic Load Balancing client.
  • Added support for a new gateway configuration, Gateway-Virtual Tape Library, to the AWS Storage Gateway client.
  • Added support for stack policies to the the AWS CloudFormation client.
  • Fixed issue #176 where attempting to upload a direct to Amazon S3 using the UploadBuilder failed when using a custom iterator that needs to be rewound.

Install/Download the Latest SDK

Release: AWS SDK for PHP – Version 2.4.8

by Michael Dowling | on | in PHP | Permalink | Comments |  Share

We would like to announce the release of version 2.4.8 of the AWS SDK for PHP. This release updates the AWS Direct Connect client and updates the Amazon Elastic MapReduce client to add support for new EMR APIs, termination of specific cluster instances, and unlimited EMR steps.

Changelog

  • Updated the AWS Direct Connect client
  • Updated the Amazon Elastic MapReduce client to add support for new EMR APIs, termination of specific cluster instances, and unlimited EMR steps.

Install/Download the Latest SDK

Sending requests through a proxy

by Michael Dowling | on | in PHP | Permalink | Comments |  Share

Some network configurations require that outbound connections be sent through a proxy server. Requiring a proxy for outbound HTTP requests is a common practice in many companies, and is often something that must be configured in a client.

You can send requests with the AWS SDK for PHP through a proxy using the "request options" of a client. These "request options" are applied to each HTTP request sent from the client. One of the option settings that can be specified is the proxy option. This setting controls how the SDK utilizes a proxy.

Request options are passed to a client through the client’s factory method. Here’s an example of how you can specify a proxy for an Amazon S3 client:

use AwsS3S3Client;

$s3 = S3Client::factory(array(
    'request.options' => array(
        'proxy' => '127.0.0.1:123'
    )
));

The above example tells the client that all requests should be proxied through an HTTP proxy located at the 127.0.0.1 IP address using port 123.

Username and password

You can supply a username and password when specifying your proxy setting if needed:

$s3 = S3Client::factory(array(
    'request.options' => array(
        'proxy' => 'username:password@127.0.0.1:123'
    )
));

Proxy protocols

Because proxy support is handled through cURL, you can specify various protocols when specifying the proxy (e.g., socks5://127.0.0.1). More information on the proxy protocols supported by cURL can be found in the online cURL documentation.

Wire Logging in the AWS SDK for PHP

by Jeremy Lindblom | on | in PHP | Permalink | Comments |  Share

One of the features of the AWS SDK for PHP that I often recommend to customers is the LogPlugin, that can be used to do wire logging. It is one of the many plugins included with Guzzle, which is the underlying HTTP library used by the SDK. Guzzle’s LogPlugin includes a default configuration that will output the content of the requests and responses sent over the wire to AWS. You can use it to help debug requests or just learn more about how the AWS APIs work.

Adding the LogPlugin to any client in the SDK is simple. The following shows how to set it up.

$logPlugin = GuzzlePluginLogLogPlugin::getDebugPlugin();
$client->addSubscriber($logPlugin);

The output generated by LogPlugin for a single request looks similar to the following text (this request was for executing an Amazon S3 ListBuckets operation).

# Request:
GET / HTTP/1.1
Host: s3.amazonaws.com
User-Agent: aws-sdk-php2/2.4.6 Guzzle/3.7.3 curl/7.25.0 PHP/5.3.27
Date: Fri, 27 Sep 2013 15:53:10 +0000
Authorization: AWS AKIAEXAMPLEEXAMPLE:eEXAMPLEEsREXAMPLEWEFo=

# Response:
HTTP/1.1 200 OK
x-amz-id-2: EXAMPLE4j/v8onDxyeuFaQFsNvN66EXAMPLE30KQLfq0T6sVcLxj
x-amz-request-id: 4F3EXAMPLEE14
Date: Fri, 27 Sep 2013 15:53:09 GMT
Content-Type: application/xml
Transfer-Encoding: chunked
Server: AmazonS3

<?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">[...]</ListAllMyBucketsResult>

This is the output generated using the default configuration. You can configure the LogPlugin to customize the behavior, format, and location of what is logged. It’s also possible to integrate with third-party logging libraries like Monolog. For more information, see the section about the wire logger in the AWS SDK for PHP User Guide.

AWS at Web & PHP Con 2013

by Jeremy Lindblom | on | in PHP | Permalink | Comments |  Share

In September, I was able to attend and speak at Web & PHP Con in San
Jose, CA. It was great to be around a good group of PHP developers, talk about web development and AWS, and meet new
friends.

Getting Good with the AWS SDK for PHP

On Wednesday, September 17th, I gave a talk called Getting Good with the AWS SDK for PHP. In my session, I gave a
brief introduction to AWS and its services, taught how to use the AWS SDK for PHP, and walked through some code examples
from a small PHP application built with the SDK using Amazon S3, Amazon DynamoDB, and AWS Elastic Beanstalk. Here is the
slide deck,
joind.in page, and Lanyrd page for the
talk.

Git Educated About Git

On September 18th, I gave a talk called Git Educated About Git – 20 Essential Commands
(slide deck). This talk was not
related to AWS or the AWS SDK for PHP, but I used the development of the SDK as a use case during the presentation.
Since we work on a combination of both publicly available and unannounced features, we don’t have a single canonical
repository. Instead we have two remotes, our public GitHub repository and another private, internal repository. For fun,
I also wrote and performed a song called You’re Doing Git! during my session, and you can watch the performance on
YouTube
.

Attending PHP Conferences

I’ve enjoyed my opportunities to attend various PHP and developer conferences and user group meetings throughout this
year. I’ve found it to be a great opportunity to connect to PHP developers and help them learn more about developing on
AWS and with the AWS SDK for PHP. I hope to see you at future conferences.

Release: AWS SDK for PHP 2.4.4

by Jeremy Lindblom | on | in PHP | Permalink | Comments |  Share

We would like to announce the release of version 2.4.4 of the
AWS SDK for PHP. This release updates the Amazon EC2 client to use the
2013-07-15 API version and fixes issues reported on the forums and GitHub.

Changelog

  • Added support for assigning a public IP address to a VPC instance at launch to the Amazon EC2 client
  • Updated the Amazon EC2 client to use the 2013-07-15 API version
  • Updated the Amazon SWF client to sign requests with Signature V4
  • Updated the Instance Metadata client to allow for higher and more customizable connection timeouts
  • Fixed an issue with the SDK where XML map structures were not being serialized correctly in some cases
  • Fixed issue #136 where a few of the new Amazon SNS mobile push operations were not working properly
  • Fixed an issue where the AWS STS AssumeRoleWithWebIdentity operation was requiring credentials and a signature
    unnecessarily
  • Fixed and issue with the S3Client::uploadDirectory method so that true key prefixes can be used
  • Updated the API docs to include sample code for each operation that indicates the parameter structure
  • Updated the API docs to include more information in the descriptions of operations and parameters
  • Added a page about Iterators to the user guide

Install/Download the Latest SDK

Release: AWS SDK for PHP 2.4.3

by Michael Dowling | on | in PHP | Permalink | Comments |  Share

We would like to announce the release of version 2.4.3 of the AWS SDK for PHP. This release adds support for the Amazon Simple Notification Service mobile push API, adds progress reporting on snapshot restore operations for Amazon Redshift, and addresses an issue with directories and the Amazon S3 stream wrapper.

Changelog

  • Updated the Amazon SNS client API to support mobile push
  • Updated the Amazon Redshift client API to support progress reporting on snapshot restore operations
  • Updated the Amazon Elastic MapReduce client to now use JSON serialization and AWS Signature V4 to securely sign requests
  • AWS SDK for PHP clients now throw AwsCommonExceptionTransferException exceptions when a network error occurs instead of a GuzzleHttpExceptionCurlException. The TransferException class, however, extends from GuzzleHttpExceptionCurlException. You can continue to catch the Guzzle CurlException or catch AwsCommonExceptionAwsException to catch any exception that can be thrown by an AWS client.
  • Fixed an issue with the Amazon S3 stream wrapper where trailing slashes were being added when listing directories

Install/Download the Latest SDK

Release: AWS SDK for PHP 2.4.2

by Jeremy Lindblom | on | in PHP | Permalink | Comments |  Share

We would like to announce the release of version 2.4.2 of the AWS SDK for PHP. This release adds support for custom Amazon Machine Images (AMIs) and Chef 11 to the AWS OpsWorks client, adds the latest snapshot permission features to the Amazon Redshift client, and updates the Amazon EC2 and AWS Security Token Service clients.

Changelog

  • Added support for cross-account snapshot access control to the Amazon Redshift client
  • Added support for decoding authorization messages to the AWS STS client
  • Added support for checking for required permissions via the DryRun parameter to the Amazon EC2 client
  • Added support for custom Amazon Machine Images (AMIs) and Chef 11 to the AWS OpsWorks client
  • Added an SDK compatibility test to allow users to quickly determine if their system meets the requirements of the SDK
  • Updated the Amazon EC2 client to use the 2013-06-15 API version
  • Fixed an unmarshalling error with the Amazon EC2 CreateKeyPair operation
  • Fixed an unmarshalling error with the Amazon S3 ListMultipartUploads operation
  • Fixed an issue with the Amazon S3 stream wrapper "x" fopen mode
  • Fixed an issue with AwsS3S3Client::downloadBucket by removing leading slashes from the passed $keyPrefix argument

Install/Download the Latest SDK

Release: AWS SDK for PHP 2.4.1

by Michael Dowling | on | in PHP | Permalink | Comments |  Share

We would like to announce the release of version 2.4.1 of the AWS SDK for PHP. This release adds support for setting watermark and max frame rate parameters in the Amazon Elastic Transcoder client and resolves issues with the Amazon S3, Amazon EC2, Amazon ElastiCache, AWS Elastic Beanstalk, Amazon EMR, and Amazon RDS clients.

Changelog

  • Added support for setting watermarks and max frame rates to the Amazon Elastic Transcoder client
  • Added MD5 validation to Amazon SQS ReceiveMessage operations
  • Added the AwsDynamoDbIteratorItemIterator class to make it easier to get items from the results of DynamoDB operations in a simpler form
  • Added support for the cr1.8xlarge EC2 instance type. Use AwsEc2EnumInstanceType::CR1_8XLARGE
  • Added support for the suppression list SES mailbox simulator. Use AwsSesEnumMailboxSimulator::SUPPRESSION_LIST
  • Fixed an issue with data formats throughout the SDK due to a regression. Dates are now sent over the wire with the correct format. This issue affected the Amazon EC2, Amazon ElastiCache, AWS Elastic Beanstalk, Amazon EMR, and Amazon RDS clients
  • Fixed an issue with the parameter serialization of the ImportInstance operation in the Amazon EC2 client
  • Fixed an issue with the Amazon S3 client where the RoutingRules.Redirect.HostName parameter of the PutBucketWebsite operation was erroneously marked as required
  • Fixed an issue with the Amazon S3 client where the DeleteObject operation was missing parameters
  • Fixed an issue with the Amazon S3 client where the Status parameter of the PutBucketVersioning operation did not properly support the "Suspended" value
  • Fixed an issue with the Amazon Glacier UploadPartGenerator class so that an exception is thrown if the provided body to upload is less than 1 byte

Install/Download the SDK

You can get the latest version of the SDK via:

New Blog for the AWS SDK for PHP

by Jeremy Lindblom | on | in PHP | Permalink | Comments |  Share

Hello fellow PHP developers!

Welcome to our new blog for the AWS SDK for PHP. I’m Jeremy Lindblom, and I work with Michael Dowling on the AWS SDK for PHP here at Amazon Web Services. We will be working together on this blog to bring you articles and tips about the PHP SDK and post related announcements. As passionate PHP developers, Michael and I hope you enjoy using the SDK and will find the posts on this blog helpful for your PHP projects using AWS.

Let me also quickly point you to some links for our SDK and documentation:

We hope you subscribe to our blog using the RSS feed button at the top of the page and come back often. If you would like us to blog about any specific topics, please let us know and we’ll see what we can do.