AWS SDK for PHP

AWS Resource APIs provide an object-oriected abstraction over the "low-level" or RPC-style interface in the AWS SDK for PHP, for a simpler and more intuitive coding experience. A resource object is a reference to an AWS resource (such as an Amazon EC2 instance or an Amazon S3 object) that exposes the resource's attributes and actions as properties and methods of the resource object. Details of the underlying HTTP API requests become transparent, and you get to work with AWS resources as if they are local PHP objects. The sample code below demonstrates how this works. Supported services include Amazon EC2, Amazon S3, Amazon SNS, Amazon SQS, AWS IAM, Amazon Glacier, and AWS CloudFormation, and more services will be added in the future.

aws = new Aws($config);
// Get references to resource objects
$bucket = $aws->s3->bucket('my-bucket');
$object = $bucket->object('image/bird.jpg');
// Access resource attributes
echo $object['LastModified'];
// Call resource methods to take action
$object->delete();
$bucket->delete();

Comments

Popular posts from this blog

Styling Bottom Navigation

Lottie Animation in Android

Set Up the AWS Mobile SDK for Android