Release: AWS SDK for PHP 1.5 "Allegro"

Release Notes>PHP>Release: AWS SDK for PHP 1.5 "Allegro"
This release adds support for a new region enumeration for the South America (São Paulo) Region, introduces a new configuration file format, introduces a number of backwards-incompatible changes, adds support for a S3 Stream Wrapper interface, updates support for Amazon EC2, Amazon ElastiCache, Elastic Load Balancing, Amazon Elastic MapReduce, AWS CloudFormation, and resolves issues reported to the forums.

Details

Submitted By: RyanP
Release Date: December 15, 2011 2:39 AM GMT
Latest Version: 1.5.0
Created On: December 15, 2011 2:39 AM GMT
Last Updated: December 15, 2011 2:39 AM GMT

Download

Download the latest AWS SDK for PHP

Backwards-Incompatible Changes!

Change Description

Credentials

The method by which the config.inc.php file maintains its list of credentials has been re-factored and updated to support managing multiple sets of credentials in a single location (e.g., development, staging, production).

Be sure to read through the included config-sample.inc.php file to see how credentials should be refactored.

Constructors

The function signature of all service constructors has changed. Instead of passing a key and secret as the first and second parameters, the constructor now accepts a hash (associative array) containing key and secret keys.

If you are explicitly passing a key and secret to the constructor, you will need to change your code. If you are simply inheriting your default credentials from a config file, you don't need to make any changes beyond upgrading your config file to the new 1.5 format.

Please see the API reference documentation for more information.

Temporary credentials

In version 1.4 we enabled a mode where — for services that supported it — a set of temporary credentials were fetched and cached before the first request. This functionality has been reverted. The use of short-term credentials must be explicitly enabled by instantiating the AmazonSTS class and passing those credentials into the service constructor.

init()

The init() method has been renamed to factory() to better define its job. This still, however, requires PHP 5.3+ to use.

adjust_offset()

The adjust_offset() method has been removed. Instead, please ensure that the machine's time is set correctly using an NTP server.

New Features

Change Description

São Paulo Region

The SDK now has support for the new South America (São Paulo) Region for all services that support it.

The SDK classes that support the South American endpoint are: AmazonAS, AmazonCloudFormation, AmazonCloudWatch, AmazonEC2, AmazonELB, AmazonEMR, AmazonRDS, AmazonS3, AmazonSDB, AmazonSNS, AmazonSQS

Plain-english region constants

In addition to the regional constants that were already provided by the SDK, support has also been added for plain-english "aliases".

These aliases include: REGION_VIRGINA, REGION_CALIFORNIA, REGION_OREGON, REGION_IRELAND, REGION_SINGAPORE, REGION_TOKYO, REGION_SAO_PAULO

Amazon S3

Support for a S3StreamWrapper class has been added to the SDK. This enables users to read/write to Amazon S3 as though it were the local file system.

For more information, please see _docs/STREAMWRAPPER_README.html.

AWS CloudFormation

Support for cost estimation of CloudFormation templates has been added to the SDK.

For more information, please see: AWS CloudFormation.

Amazon EC2

Support for 24x7 Reserved Instances, VPC Spot Instances and VPC Everywhere has been added to the SDK.

For more information, please see New Amazon EC2 Reserved Instance Options Now Available, Announcing Amazon EC2 Spot Integration with Amazon VPC, and Amazon VPC Generally Available in Multiple AZs in All Regions.

Amazon ElastiCache

Support for US-West 1 (California), EU-West (Ireland), Asia Pacific Southeast (Singapore), and Asia Pacific Northeast (Tokyo) regions has been added to the SDK.

For more information, please see Amazon ElastiCache is now available in four additional AWS Regions and as a CloudFormation template.

Elastic Load Balancing

Support for ELBs running in VPC has been added to the SDK.

For more information, please see Announcing Elastic Load Balancing in Amazon VPC.

Amazon Elastic MapReduce

Support for Amazon EMR AMI Versioning, new Hadoop and Pig versions, and Amazon EMR running in Amazon VPC has been added to the SDK.

For more information, please see Amazon Elastic MapReduce Announces Support for New Hadoop and Pig Versions, AMI Versioning, and Amazon VPC.

Plain-english instance type constants

Support has also been added for plain-english constants representing Instance Types in Amazon EC2.

These aliases include: INSTANCE_SMALL, INSTANCE_LARGE, INSTANCE_XLARGE, INSTANCE_HIGH_MEM_XLARGE, INSTANCE_HIGH_MEM_2XLARGE, INSTANCE_HIGH_MEM_4XLARGE, INSTANCE_HIGH_CPU_MEDIUM, INSTANCE_HIGH_CPU_XLARGE, INSTANCE_CLUSTER_4XLARGE, INSTANCE_CLUSTER_8XLARGE, INSTANCE_CLUSTER_GPU_XLARGE.

Config file lookup

The SDK now works harder to locate a user's home directory to find a valid config.inc.php file in cases where PHP's $_ENV['HOME'] variable isn't set correctly.

Resolved Issues

Change Description

set_region()

The set_region() method is now an alias of set_hostname(), as all regional constants are now fully-qualified domain names.

Amazon S3 regions

The region logic for the AmazonS3 class has been simplified. The class now uses fully-qualified domain names across the board.

XML/JSON parsing

The get_object() method no longer attempts to parse XML/JSON content.

For more information, please see: S3 data being retrieved as JSON - SDK 1.3.5

Known Issues

Issue Description

2GB limit for 32-bit stacks; all Windows stacks.

Because PHP's integer type is signed and many platforms use 32-bit integers, the AWS SDK for PHP does not correctly handle files larger than 2GB on a 32-bit stack (whereby "stack" includes CPU, OS, web server, and PHP binary). This is a well-known PHP issue. In the case of Microsoft® Windows®, there are no official builds of PHP that support 64-bit integers.

The recommended solution is to use a 64-bit Linux stack, such as the 64-bit Amazon Linux AMI with the latest version of PHP installed.

For more information, please see: PHP filesize: Return values. A workaround is suggested in AmazonS3::create_mpu_object() with files bigger than 2GB.

S3 Buckets containing periods

Amazon S3's SSL certificate covers domains that match *.s3.amazonaws.com. When buckets (e.g., my-bucket) are accessed using DNS-style addressing (e.g., my-bucket.s3.amazonaws.com), those SSL/HTTPS connections are covered by the certificate.

However, when a bucket name contains one or more periods (e.g., s3.my-domain.com) and is accessed using DNS-style addressing (e.g., s3.my-domain.com.s3.amazonaws.com), that SSL/HTTPS connection will fail because the certificate doesn't match.

The most secure workaround is to change the bucket name to one that does not contain periods. Less secure workarounds are to use disable_ssl() or disable_ssl_verification(). Because of the security implications, calling either of these methods will throw a warning. You can avoid the warning by adjusting your error_reporting() settings.

Expiring request signatures

When leveraging AmazonS3::create_mpu_object(), it's possible that later parts of the multipart upload will fail if the upload takes more than 15 minutes.

Too many open file connections

When leveraging AmazonS3::create_mpu_object(), it's possible that the SDK will attempt to open too many file resources at once. Because the file connection limit is not available to the PHP environment, the SDK is unable to automatically adjust the number of connections it attempts to open.

A workaround is to increase the part size so that fewer file connections are opened.

Exceptionally large batch requests

When leveraging the batch request feature to execute multiple requests in parallel, it's possible that the SDK will throw a fatal exception if a particular batch pool is exceptionally large and a service gets overloaded with requests.

This seems to be most common when attempting to send a large number of emails with the SES service.

Supported API Versions

The AWS SDK for PHP supports the following services and API versions:

Service API Version
Amazon CloudFront 2010-11-01
Amazon CloudWatch 2010-08-01
Amazon Elastic Compute Cloud (Amazon EC2) with Amazon Virtual Private Cloud (Amazon VPC) 2011-11-01
Amazon ElastiCache 2011-07-15
Amazon Elastic MapReduce (Amazon EMR) 2009-03-31
Amazon Relational Database Service (Amazon RDS) 2011-04-01
Amazon Simple Storage Service (Amazon S3) 2006-03-01
Amazon SimpleDB 2009-04-15
Amazon Simple Email Service (Amazon SES) 2010-12-01
Amazon Simple Notification Service (Amazon SNS) 2010-03-31
Amazon Simple Queue Service (Amazon SQS) 2011-10-01
Auto Scaling 2010-08-01
AWS CloudFormation 2010-05-15
AWS Elastic Beanstalk 2010-12-01
AWS Identity and Access Management 2010-05-08
AWS Import/Export 2010-06-01
AWS Security Token Service 2011-06-15
Elastic Load Balancing (ELB) 2011-11-15
©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.