SlideShare a Scribd company logo
1 of 67
Download to read offline
Mastering the AWS SDK for PHP
Michael Dowling & Jeremy Lindblom, AWS Developer Resources
November 15, 2013

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
PART 1
Using the AWS SDK for PHP
by working with
PART 2
Amazon S3
High-level features
for common use cases
with the AWS SDK for PHP
@awsforphp

Follow Us!

AWS SDK for PHP
https://github.com/aws/aws-sdk-php
AWS SDK for PHP
• Suite of HTTP clients for AWS services
• Built on top of Guzzle (guzzlephp.org)
– Persistent connections, parallel requests
– Event hooks, plugins, wire logging

• Helpful functionality
–
–
–
–

Easy pagination
"waiters"
Automatic retries
etc.
AWS SDK for PHP – Installing
•
•
•
•
•

Composer / Packagist
Phar
Zip
PEAR
Yum (Amazon Linux)
AWS SDK for PHP – Installing via Composer
In your composer.json:

{

"require": {
"aws/aws-sdk-php": "~2.4"
}
}
From your terminal:

> composer.phar install

http://getcomposer.org
PART 1
Using the AWS SDK for PHP
Using the AWS SDK for PHP
 CreateBucket
 PutObject
 ListObjects

Amazon S3 operations
Amazon Simple Storage Service (Amazon S3)
Scalable storage in the cloud
http://my-stuff.s3.amazonaws.com/photos/kittens.jpg

Bucket Name

Object Key
Using the AWS SDK for PHP
 CreateBucket
 PutObject
 ListObjects


Creating a Bucket – Complete Example
<?php
require 'vendor/autoload.php';
use AwsCommonAws;
use AwsS3ExceptionS3Exception;
$aws = Aws::factory('config.php');
$s3 = $aws->get('s3');

try {
$result = $s3->createBucket([
'Bucket' => 'bucket-name',
]);
$s3->waitUntilBucketExists([
'Bucket' => 'bucket-name',
]);
} catch (S3Exception $e) {
echo $e->getMessage();
}
Two Ways to Instantiate a Service Client
1. Client factory method
2. Service builder (AwsCommonAws)
Instantiate a Client via its Factory Method
use AwsS3S3Client;
$s3 = S3Client::factory([
'key' => '{your-aws-access-key-id}',
'secret' => '{your-aws-secret-key}',
// 'region' => 'us-east-1',
]);
Instantiate a Client via the Service Builder
<?php
require 'vendor/autoload.php';
use AwsCommonAws;
$aws = Aws::factory('/path/to/config.php');
$s3 = $aws->get('s3');
$s3again = $aws->get('s3');
var_dump($s3 === $s3again); #> bool(true)
Providing Credentials
• Options array ['key' => '?', 'secret' => '?']
• Configuration file
• Environment credentials
– AWS_ACCESS_KEY_ID
– AWS_SECRET_KEY

• IAM Instance Profile credentials
See http://blogs.aws.amazon.com/php
(Providing credentials to the AWS SDK for PHP)
Executing a Command
try {
$result = $s3->createBucket([
'Bucket' => $bucket,
]);
} catch (AwsS3ExceptionS3Exception $e) {
echo $e->getMessage();
}
Executing a Command – API Docs
Handling a Response – Modeled Responses
$result = $s3->listBuckets();
$result['Buckets']; // Implements ArrayAccess
print_r($result->toArray());
echo $result;
$result->getPath('Buckets/0/Name');
$result->getPath('Buckets/*/Name');
Handling a Response – API Docs
Wire Logging – Debug Easily
<?php
require 'vendor/autoload.php';
use AwsCommonAws;
use AwsS3ExceptionS3Exception;
use GuzzlePluginLogLogPlugin;
$aws = Aws::factory('config.php');
$s3 = $aws->get('s3');

$log = LogPlugin::getDebugPlugin();
$s3->addSubscriber($log);

try {
$result = $s3->createBucket([
'Bucket' => 'bucket-name',
]);
$s3->waitUntilBucketExists([
'Bucket' => 'bucket-name',
]);
} catch (S3Exception $e) {
echo $e->getMessage();
}
Wire Logging – Output
# Request:
PUT / HTTP/1.1
Host: this-is-my-test-wonderful-bucket.s3.amazonaws.com
User-Agent: aws-sdk-php2/2.4.6 Guzzle/3.7.3 curl/7.25.0 PHP/5.3.27
Date: Wed, 25 Sep 2013 23:03:13 +0000
Authorization: AWS AKIAEXAMPLEEXAMPLE:Xn2lJPREXAMPLEQkPmY0IAUng=
Content-Length: 0
# Response:
HTTP/1.1 200 OK
x-amz-id-2: eNUZEXAMPLEM4U7c/4WPIlshkfVUEXAMPLEUkyKirVgjEXAMPLEsfwZ3Mx
x-amz-request-id: C91E6E8CD19680F7
Date: Wed, 25 Sep 2013 23:03:15 GMT
Location: /this-is-my-test-wonderful-bucket
Plugins
• Plugin architecture from Guzzle
• Uses the Symfony Event Dispatcher
• Many plugins included with Guzzle
(Log, Backoff, History, Mock, HTTP Cache, etc.)
Wait for it…
<?php
require 'vendor/autoload.php';
use AwsCommonAws;
use AwsS3ExceptionS3Exception;
$aws = Aws::factory('config.php');
$s3 = $aws->get('s3');

try {
$result = $s3->createBucket([
'Bucket' => 'bucket-name',
]);
$s3->waitUntilBucketExists([
'Bucket' => 'bucket-name',
]);
} catch (S3Exception $e) {
echo $e->getMessage();
}
Waiters
$result = $s3->createBucket([ 'Bucket' => $bucket ]);
$s3->waitUntilBucketExists([ 'Bucket' => $bucket ]);

• Poll resources until available
• Handle asynchronous and eventually consistent
operations more easily
Using the AWS SDK for PHP
 CreateBucket
 PutObject 
 ListObjects
Uploading an Object to Amazon S3
$result = $s3->putObject([
'Bucket' => 'my-cool-photos',
'Key' => 'photos/photo01.jpg',
'Body' => fopen('/path/to/photo01.jpg', 'r'),
'ACL' => 'public-read',
]);
$url = $result->get('ObjectURL');
Command Syntax – Short vs. Long Form
// Short form
$result = $s3->putObject([
// ...
]);
// Long form
$command = $s3->getCommand('PutObject', [
// ...
]);
$result = $command->getResult();
Executing Commands in Parallel
$command1 = $s3->getCommand('PutObject', [
'Bucket' => 'my-bucket-name',
'Key' => 'my-first-key',
'Body' => fopen('path/to/file1.ext', 'r')
]);
$command2 = $s3->getCommand('PutObject', [
'Bucket' => 'my-bucket-name',
'Key' => 'my-second-key',
'Body' => fopen('path/to/file2.ext', 'r')
]);
$s3->execute([$command1, $command2]);
Using the AWS SDK for PHP
 CreateBucket
 PutObject
 ListObjects 
Listing Objects in Your Bucket
$result = $s3->listObjects([
'Bucket' => 'my-bucket-name',
]);
$nextResult = $s3->listObjects([
'Bucket' => 'my-bucket-name',
'Marker' => 'photos/photo-1000.jpg',
]);
Iterators – Enumerate Your Data Easily
• Iterate through entire result sets
• No handling of markers or tokens

• Lazy loads results
• Compatible with SPL iterators
Iterators – Enumerating Your Data Easily
$objects = $s3->getListObjectsIterator([
'Bucket' => 'my-bucket-name',
]);
foreach ($objects as $object) {
echo $object['Key'] . "n";
}
SDK 1.x – A Time Before Iterators
$sk = null;
$people = array();
do {
$params = array('TableName'=>'people');
if ($sk) {
$params['ExclusiveStartKey'] = array(
'HashKeyElement' => array(
'S' => $sk
)
);
$sk= null;
}

$r = $dynamo_db->scan($params);
if ($r->isOK()) {
foreach ($r->body->Items as $item) {
echo (string) $item->name->S;
}
if ($lk = $r->body->LastEvaluatedKey) {
$sk = (string) $lk->HashKeyElement->S;
}
} else {
throw new DynamoDB_Exception('...');
}
}
while ($sk);
SDK 1.x – A Time Before Iterators
$sk = null;
$people = array();
do {
$params = array('TableName'=>'people');
if ($sk) {
$params['ExclusiveStartKey'] = array(
'HashKeyElement' => array(
'S' => $sk
)
);
$sk= null;
}

$r = $dynamo_db->scan($params);
if ($r->isOK()) {
foreach ($r->body->Items as $item) {
echo (string) $item->name->S;
}
if ($lk = $r->body->LastEvaluatedKey) {
$sk = (string) $lk->HashKeyElement->S;
}
} else {
throw new DynamoDB_Exception('...');
}
}
while ($sk);
SDK 2.x – The Era of Iterators
$scan = $db->getScanIterator([
'TableName'
=> 'People',
'AttributesToGet' => ['Id', 'Name']
]);
foreach ($scan as $person) {
echo $item['Name']['S'];
}
Advanced Iterator Usage – Example
$objects = $s3->getListObjectsIterator([
'Bucket' => 'my-bucket-name',
]);
$objects = new LimitIterator($objects, 0, 5);
foreach ($objects as $object) {
echo $object['Key'] . "n";
}
Using the AWS SDK for PHP
 CreateBucket
 PutObject
 ListObjects
PART 2
High-level Abstractions in the AWS SDK for PHP
"I want to use Amazon S3 like a local filesystem."

Amazon S3 Stream Wrapper
PHP Stream Wrappers

• Provide a
consistent I/O
interface for
various protocols
– fopen(), fread(),
file_get_contents()
, mkdir(), etc…
– file://, http://, ftp://,
php://, …
PHP Stream Wrapper Protocols
echo file_get_contents('/path/to/file');

Is equivalent to…
echo file_get_contents('file:///path/to/file');

file:// is the protocol
PHP Stream Wrapper Protocols

echo file_get_contents('http://www.amazon.com');

http:// is the protocol
Amazon S3 Stream Wrapper
// First, register the wrapper
$s3 = AwsS3S3Client::factory();
$s3->registerStreamWrapper();
echo file_get_contents('s3://bucket_name/key');
file_put_contents('s3://bucket_name/key', 'hi!');

s3://

bucket_name /key
Pseudo-directory
• Amazon S3 knows about buckets and keys
• There aren't real subdirectories
• Pseudo-directories can be created using a key
prefix
Bucket: foo
Key: baz/bar/bam
URL: http://foo.s3.amazonaws.com/baz/bar/bam
Reading bytes off of a stream

$fp = fopen('s3://bucket_name/key', 'r');
while (!feof($fp)) {
echo fread($fp, 1024);
}
fclose($fp);

Instead of reading all bytes up front and then using them
Using Stream Filters
Filters are used for: Conversion, Compression, Encryption, etc.

$in = fopen('s3://bucket_name/key.zip', 'r');
$out = fopen('/path/to/file', 'w');
stream_filter_append($out, 'zlib.inflate');
stream_copy_to_stream($in, $out);
fclose($in);
fclose($out);
Listing Objects and Buckets
$dir = "s3://bucket_name/";
if (is_dir($dir) && ($dh = opendir($dir))) {
while (($file = readdir($dh)) !== false) {
echo "Name: {$file}n";
}
closedir($dh);
}
Listing Objects and Buckets
The more intuitive recursive iterator iterator iterator iterator …

$dir = 's3://bucket_name';
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($iterator as $file) {
echo $file->getType() . ': ' . $file . "n";
}
Listing Objects and Buckets
file: s3://bucket/aws_logo.png
file: s3://bucket/background.gif
file: s3://bucket/channel.xml
file: s3://bucket/data.txt
file: s3://bucket/destruct
dir: s3://bucket/dirupload
file: s3://bucket/dirupload/aws-autoloader.php
file: s3://bucket/dirupload/aws.zip
file: s3://bucket/dirupload/guzzle/guzzle/.gitignore
file: s3://bucket/dirupload/guzzle/guzzle/.travis.yml
file: s3://bucket/dirupload/guzzle/guzzle/CHANGELOG.md
file: s3://bucket/dirupload/guzzle/guzzle/LICENSE
PHP Stream Wrappers: Summary

•
•
•
•

Access Amazon S3 like a local filesystem
Read bytes off of a stream on demand
Use familiar methods like file_get_contents
Access to PHP's stream filters
"I need to upload a local directory to
an Amazon S3 bucket"

For static blogs, websites, etc.
Local filesystem
.
├── images
│ ├── dotted-border.png
│ ├── email.png
│ ├── noise.png
│ ├── rss.png
│ └── search.png
├── index.html

Amazon S3 Bucket
.
├── images
│ ├── dotted-border.png
│ ├── email.png
│ ├── noise.png
│ ├── rss.png
│ └── search.png
├── index.html
uploadDirectory()
1. Recursively iterates over all local files
2. Checks if the file does not exist or if it has changed
3. Uploads matching files (single or multipart)

$client->uploadDirectory('/local/directory', 'bucket');
public function uploadDirectory(
$directory,
$bucket,
$keyPrefix = null,
array $options = array()
)
Key Prefix?

https://bucket.s3.amazonaws.com/blogs/index.html
$client->uploadDirectory(
'/local/dir',
'bucket',
'blogs/' //  Key prefix
);
uploadDirectory() Options
$client->uploadDirectory('/local/dir', 'bucket', '', [
'params' => ['ACL' => 'public-read'],
'concurrency' => 20,
'debug' => true
]);
Debug output:
Uploading /local/dir/images/email.png -> images/email.png (8 bytes)
Uploading /local/dir/images/noise.png -> images/noise.png (12 bytes)
Uploading /local/dir/images/rss.png -> images/rss.png (100 bytes)
Uploading /local/dir/images/search.png -> images/search.png (200 bytes)
Uploading /local/dir/index.html -> index.html (1024 bytes)
"I need to download an Amazon S3 bucket to
my local filesystem"
downloadBucket()
Works exactly like uploadDirectory()
$client->downloadBucket ('/local/directory', 'bucket');
public function downloadBucket(
$directory,
$bucket,
$keyPrefix = null,
array $options = array()
)
Sync Amazon S3 -> Amazon S3
Upload the contents of one Amazon S3 bucket to another using
uploadDirectory().

$client->uploadDirectory(
's3://bucket_src',
'bucket_dest'
);
"I need to use the SDK with my framework."
Third-party Integrations
• Laravel 4 Service Provider
• Zend Framework 2 Module
• Silex Service Provider
https://github.com/aws
If you'd like to help us or contribute to another
framework integration, please come talk to us.
Mastering the AWS SDK for PHP
 Learned how to use the AWS SDK for PHP by
working with some basic Amazon S3 operations.
 Learned how to speed up some common
development use cases by using some of the
SDK's high-level abstractions.
What you will do next
• Star ★ the AWS SDK for PHP GitHub repo
https://github.com/aws/aws-sdk-php

• composer install the SDK into your project
https://packagist.org/packages/aws/aws-sdk-php

• Subscribe to the AWS PHP Development Blog
http://blogs.aws.amazon.com/php

• Build cool PHP apps on the AWS cloud!
Mastering the AWS SDK for PHP
Please give us your feedback on this
presentation

TLS306
As a thank you, we will select prize
winners daily for completed surveys!

Follow us: @awsforphp

More Related Content

What's hot

DEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIDEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIAmazon Web Services
 
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트:: AWS Summit Online Korea 2020
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트::  AWS Summit Online Korea 2020천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트::  AWS Summit Online Korea 2020
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트:: AWS Summit Online Korea 2020Amazon Web Services Korea
 
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovationsre:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovationsGrant McAlister
 
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS SummitKubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS SummitAmazon Web Services
 
Building a well-engaged and secure AWS account access management - FND207-R ...
 Building a well-engaged and secure AWS account access management - FND207-R ... Building a well-engaged and secure AWS account access management - FND207-R ...
Building a well-engaged and secure AWS account access management - FND207-R ...Amazon Web Services
 
AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략
AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략
AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략Amazon Web Services Korea
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatchAmazon Web Services
 
20180509 AWS Black Belt Online Seminar Amazon GuardDuty
20180509 AWS Black Belt Online Seminar Amazon GuardDuty20180509 AWS Black Belt Online Seminar Amazon GuardDuty
20180509 AWS Black Belt Online Seminar Amazon GuardDutyAmazon Web Services Japan
 
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Amazon Web Services
 
Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)Amazon Web Services
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceAmazon Web Services
 
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivElastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivAmazon Web Services
 
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpacesAmazon Web Services Japan
 
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...Edureka!
 
(DAT201) Introduction to Amazon Redshift
(DAT201) Introduction to Amazon Redshift(DAT201) Introduction to Amazon Redshift
(DAT201) Introduction to Amazon RedshiftAmazon Web Services
 
AWS Black Belt Online Seminar コストの観点から見るアカウント管理
AWS Black Belt Online Seminar コストの観点から見るアカウント管理AWS Black Belt Online Seminar コストの観点から見るアカウント管理
AWS Black Belt Online Seminar コストの観点から見るアカウント管理Amazon Web Services Japan
 
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model  20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model Amazon Web Services Japan
 
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Amazon Web Services
 

What's hot (20)

DEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIDEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLI
 
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트:: AWS Summit Online Korea 2020
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트::  AWS Summit Online Korea 2020천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트::  AWS Summit Online Korea 2020
천만사용자를 위한 AWS 클라우드 아키텍처 진화하기 – 문종민, AWS솔루션즈 아키텍트:: AWS Summit Online Korea 2020
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovationsre:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
 
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS SummitKubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
 
Building a well-engaged and secure AWS account access management - FND207-R ...
 Building a well-engaged and secure AWS account access management - FND207-R ... Building a well-engaged and secure AWS account access management - FND207-R ...
Building a well-engaged and secure AWS account access management - FND207-R ...
 
AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략
AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략
AWS Summit Seoul 2023 | 스마트한 클라우드 스토리지 비용 관리 전략
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
20180509 AWS Black Belt Online Seminar Amazon GuardDuty
20180509 AWS Black Belt Online Seminar Amazon GuardDuty20180509 AWS Black Belt Online Seminar Amazon GuardDuty
20180509 AWS Black Belt Online Seminar Amazon GuardDuty
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
 
Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
 
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivElastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
 
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
 
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
 
(DAT201) Introduction to Amazon Redshift
(DAT201) Introduction to Amazon Redshift(DAT201) Introduction to Amazon Redshift
(DAT201) Introduction to Amazon Redshift
 
AWS Black Belt Online Seminar コストの観点から見るアカウント管理
AWS Black Belt Online Seminar コストの観点から見るアカウント管理AWS Black Belt Online Seminar コストの観点から見るアカウント管理
AWS Black Belt Online Seminar コストの観点から見るアカウント管理
 
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model  20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
 
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
 

Viewers also liked

Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...
Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...
Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...Amazon Web Services
 
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Enrico Zimuel
 
AWS Summit Tel Aviv - Startup Track - Data Analytics & Big Data
AWS Summit Tel Aviv - Startup Track - Data Analytics & Big DataAWS Summit Tel Aviv - Startup Track - Data Analytics & Big Data
AWS Summit Tel Aviv - Startup Track - Data Analytics & Big DataAmazon Web Services
 
Overview of Windows on AWS (CPN206) | AWS re:Invent 2013
Overview of Windows on AWS (CPN206) | AWS re:Invent 2013Overview of Windows on AWS (CPN206) | AWS re:Invent 2013
Overview of Windows on AWS (CPN206) | AWS re:Invent 2013Amazon Web Services
 
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014Amazon Web Services
 
クラウドの活用で大阪から世界へ。チャットワークの挑戦
クラウドの活用で大阪から世界へ。チャットワークの挑戦クラウドの活用で大阪から世界へ。チャットワークの挑戦
クラウドの活用で大阪から世界へ。チャットワークの挑戦Masaki Yamamoto
 
AWS Webcast - Implementing SAP Solutions on the AWS Cloud
AWS Webcast - Implementing SAP Solutions on the AWS CloudAWS Webcast - Implementing SAP Solutions on the AWS Cloud
AWS Webcast - Implementing SAP Solutions on the AWS CloudAmazon Web Services
 
GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013
GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013
GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013Amazon Web Services
 
Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013
Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013
Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013Amazon Web Services
 
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014Amazon Web Services
 
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社leverages_event
 
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013Amazon Web Services
 
AWSのおはなし at ChatWork
AWSのおはなし at ChatWorkAWSのおはなし at ChatWork
AWSのおはなし at ChatWorkMasaki Yamamoto
 
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜 AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜 崇之 清水
 
サービスをつくりなおす決断をするとき
サービスをつくりなおす決断をするときサービスをつくりなおす決断をするとき
サービスをつくりなおす決断をするときMasaki Yamamoto
 
How I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloudHow I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloudShlomo Swidler
 
AWS Shieldのご紹介 Managed DDoS Protection
AWS Shieldのご紹介 Managed DDoS ProtectionAWS Shieldのご紹介 Managed DDoS Protection
AWS Shieldのご紹介 Managed DDoS ProtectionAmazon Web Services Japan
 
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)Amazon Web Services
 
ユーザーからみたre:Inventのこれまでと今後
ユーザーからみたre:Inventのこれまでと今後ユーザーからみたre:Inventのこれまでと今後
ユーザーからみたre:Inventのこれまでと今後Recruit Technologies
 

Viewers also liked (20)

Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...
Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...
Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212)...
 
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
 
AWS Summit Tel Aviv - Startup Track - Data Analytics & Big Data
AWS Summit Tel Aviv - Startup Track - Data Analytics & Big DataAWS Summit Tel Aviv - Startup Track - Data Analytics & Big Data
AWS Summit Tel Aviv - Startup Track - Data Analytics & Big Data
 
Overview of Windows on AWS (CPN206) | AWS re:Invent 2013
Overview of Windows on AWS (CPN206) | AWS re:Invent 2013Overview of Windows on AWS (CPN206) | AWS re:Invent 2013
Overview of Windows on AWS (CPN206) | AWS re:Invent 2013
 
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
 
クラウドの活用で大阪から世界へ。チャットワークの挑戦
クラウドの活用で大阪から世界へ。チャットワークの挑戦クラウドの活用で大阪から世界へ。チャットワークの挑戦
クラウドの活用で大阪から世界へ。チャットワークの挑戦
 
Packagist
PackagistPackagist
Packagist
 
AWS Webcast - Implementing SAP Solutions on the AWS Cloud
AWS Webcast - Implementing SAP Solutions on the AWS CloudAWS Webcast - Implementing SAP Solutions on the AWS Cloud
AWS Webcast - Implementing SAP Solutions on the AWS Cloud
 
GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013
GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013
GraphLab: Large-Scale Machine Learning on Graphs (BDT204) | AWS re:Invent 2013
 
Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013
Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013
Data Science at Netflix with Amazon EMR (BDT306) | AWS re:Invent 2013
 
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
 
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
【 ITベンチャーを支えるテクノロジー 】チャットワークを支える技術|Chatwork株式会社
 
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
Getting Maximum Performance from Amazon Redshift (DAT305) | AWS re:Invent 2013
 
AWSのおはなし at ChatWork
AWSのおはなし at ChatWorkAWSのおはなし at ChatWork
AWSのおはなし at ChatWork
 
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜 AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
 
サービスをつくりなおす決断をするとき
サービスをつくりなおす決断をするときサービスをつくりなおす決断をするとき
サービスをつくりなおす決断をするとき
 
How I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloudHow I learned to stop worrying and love the cloud
How I learned to stop worrying and love the cloud
 
AWS Shieldのご紹介 Managed DDoS Protection
AWS Shieldのご紹介 Managed DDoS ProtectionAWS Shieldのご紹介 Managed DDoS Protection
AWS Shieldのご紹介 Managed DDoS Protection
 
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
AWS re:Invent 2016: Scaling Up to Your First 10 Million Users (ARC201)
 
ユーザーからみたre:Inventのこれまでと今後
ユーザーからみたre:Inventのこれまでと今後ユーザーからみたre:Inventのこれまでと今後
ユーザーからみたre:Inventのこれまでと今後
 

Similar to Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013

Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkShahar Evron
 
AWS for Startups, London - Programming AWS
AWS for Startups, London - Programming AWSAWS for Startups, London - Programming AWS
AWS for Startups, London - Programming AWSAmazon Web Services
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersJeremy Lindblom
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門lestrrat
 
AWS Hadoop and PIG and overview
AWS Hadoop and PIG and overviewAWS Hadoop and PIG and overview
AWS Hadoop and PIG and overviewDan Morrill
 
Controlling The Cloud With Python
Controlling The Cloud With PythonControlling The Cloud With Python
Controlling The Cloud With PythonLuca Mearelli
 
Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...Codemotion
 
Supercharging WordPress Development in 2018
Supercharging WordPress Development in 2018Supercharging WordPress Development in 2018
Supercharging WordPress Development in 2018Adam Tomat
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?Tushar Sharma
 
Introduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateIntroduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateAlex Pop
 
Filesystem abstractions and msg queue sergeev - symfony camp 2018
Filesystem abstractions and msg queue   sergeev - symfony camp 2018Filesystem abstractions and msg queue   sergeev - symfony camp 2018
Filesystem abstractions and msg queue sergeev - symfony camp 2018Юлия Коваленко
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony TechniquesKris Wallsmith
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)Enrico Zimuel
 
On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappersPositive Hack Days
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Puppet
 
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜崇之 清水
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHPHari K T
 

Similar to Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013 (20)

Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
 
AWS for Startups, London - Programming AWS
AWS for Startups, London - Programming AWSAWS for Startups, London - Programming AWS
AWS for Startups, London - Programming AWS
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP Developers
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
AWS Hadoop and PIG and overview
AWS Hadoop and PIG and overviewAWS Hadoop and PIG and overview
AWS Hadoop and PIG and overview
 
Controlling The Cloud With Python
Controlling The Cloud With PythonControlling The Cloud With Python
Controlling The Cloud With Python
 
Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...
 
Supercharging WordPress Development in 2018
Supercharging WordPress Development in 2018Supercharging WordPress Development in 2018
Supercharging WordPress Development in 2018
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
 
Introduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateIntroduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release update
 
Filesystem abstractions and msg queue sergeev - symfony camp 2018
Filesystem abstractions and msg queue   sergeev - symfony camp 2018Filesystem abstractions and msg queue   sergeev - symfony camp 2018
Filesystem abstractions and msg queue sergeev - symfony camp 2018
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
 
On secure application of PHP wrappers
On secure application  of PHP wrappersOn secure application  of PHP wrappers
On secure application of PHP wrappers
 
My First Big Data Application
My First Big Data ApplicationMy First Big Data Application
My First Big Data Application
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014
 
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
RESTful API を Chalice で紐解く 〜 Python Serverless Microframework for AWS 〜
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Mastering the AWS SDK for PHP (TLS306) | AWS re:Invent 2013

  • 1. Mastering the AWS SDK for PHP Michael Dowling & Jeremy Lindblom, AWS Developer Resources November 15, 2013 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 2. PART 1 Using the AWS SDK for PHP by working with PART 2 Amazon S3 High-level features for common use cases with the AWS SDK for PHP
  • 3. @awsforphp Follow Us! AWS SDK for PHP https://github.com/aws/aws-sdk-php
  • 4. AWS SDK for PHP • Suite of HTTP clients for AWS services • Built on top of Guzzle (guzzlephp.org) – Persistent connections, parallel requests – Event hooks, plugins, wire logging • Helpful functionality – – – – Easy pagination "waiters" Automatic retries etc.
  • 5. AWS SDK for PHP – Installing • • • • • Composer / Packagist Phar Zip PEAR Yum (Amazon Linux)
  • 6. AWS SDK for PHP – Installing via Composer In your composer.json: { "require": { "aws/aws-sdk-php": "~2.4" } } From your terminal: > composer.phar install http://getcomposer.org
  • 7. PART 1 Using the AWS SDK for PHP
  • 8. Using the AWS SDK for PHP  CreateBucket  PutObject  ListObjects Amazon S3 operations
  • 9. Amazon Simple Storage Service (Amazon S3) Scalable storage in the cloud http://my-stuff.s3.amazonaws.com/photos/kittens.jpg Bucket Name Object Key
  • 10. Using the AWS SDK for PHP  CreateBucket  PutObject  ListObjects 
  • 11. Creating a Bucket – Complete Example <?php require 'vendor/autoload.php'; use AwsCommonAws; use AwsS3ExceptionS3Exception; $aws = Aws::factory('config.php'); $s3 = $aws->get('s3'); try { $result = $s3->createBucket([ 'Bucket' => 'bucket-name', ]); $s3->waitUntilBucketExists([ 'Bucket' => 'bucket-name', ]); } catch (S3Exception $e) { echo $e->getMessage(); }
  • 12. Two Ways to Instantiate a Service Client 1. Client factory method 2. Service builder (AwsCommonAws)
  • 13. Instantiate a Client via its Factory Method use AwsS3S3Client; $s3 = S3Client::factory([ 'key' => '{your-aws-access-key-id}', 'secret' => '{your-aws-secret-key}', // 'region' => 'us-east-1', ]);
  • 14. Instantiate a Client via the Service Builder <?php require 'vendor/autoload.php'; use AwsCommonAws; $aws = Aws::factory('/path/to/config.php'); $s3 = $aws->get('s3'); $s3again = $aws->get('s3'); var_dump($s3 === $s3again); #> bool(true)
  • 15. Providing Credentials • Options array ['key' => '?', 'secret' => '?'] • Configuration file • Environment credentials – AWS_ACCESS_KEY_ID – AWS_SECRET_KEY • IAM Instance Profile credentials See http://blogs.aws.amazon.com/php (Providing credentials to the AWS SDK for PHP)
  • 16. Executing a Command try { $result = $s3->createBucket([ 'Bucket' => $bucket, ]); } catch (AwsS3ExceptionS3Exception $e) { echo $e->getMessage(); }
  • 17. Executing a Command – API Docs
  • 18. Handling a Response – Modeled Responses $result = $s3->listBuckets(); $result['Buckets']; // Implements ArrayAccess print_r($result->toArray()); echo $result; $result->getPath('Buckets/0/Name'); $result->getPath('Buckets/*/Name');
  • 19. Handling a Response – API Docs
  • 20. Wire Logging – Debug Easily <?php require 'vendor/autoload.php'; use AwsCommonAws; use AwsS3ExceptionS3Exception; use GuzzlePluginLogLogPlugin; $aws = Aws::factory('config.php'); $s3 = $aws->get('s3'); $log = LogPlugin::getDebugPlugin(); $s3->addSubscriber($log); try { $result = $s3->createBucket([ 'Bucket' => 'bucket-name', ]); $s3->waitUntilBucketExists([ 'Bucket' => 'bucket-name', ]); } catch (S3Exception $e) { echo $e->getMessage(); }
  • 21. Wire Logging – Output # Request: PUT / HTTP/1.1 Host: this-is-my-test-wonderful-bucket.s3.amazonaws.com User-Agent: aws-sdk-php2/2.4.6 Guzzle/3.7.3 curl/7.25.0 PHP/5.3.27 Date: Wed, 25 Sep 2013 23:03:13 +0000 Authorization: AWS AKIAEXAMPLEEXAMPLE:Xn2lJPREXAMPLEQkPmY0IAUng= Content-Length: 0 # Response: HTTP/1.1 200 OK x-amz-id-2: eNUZEXAMPLEM4U7c/4WPIlshkfVUEXAMPLEUkyKirVgjEXAMPLEsfwZ3Mx x-amz-request-id: C91E6E8CD19680F7 Date: Wed, 25 Sep 2013 23:03:15 GMT Location: /this-is-my-test-wonderful-bucket
  • 22. Plugins • Plugin architecture from Guzzle • Uses the Symfony Event Dispatcher • Many plugins included with Guzzle (Log, Backoff, History, Mock, HTTP Cache, etc.)
  • 23. Wait for it… <?php require 'vendor/autoload.php'; use AwsCommonAws; use AwsS3ExceptionS3Exception; $aws = Aws::factory('config.php'); $s3 = $aws->get('s3'); try { $result = $s3->createBucket([ 'Bucket' => 'bucket-name', ]); $s3->waitUntilBucketExists([ 'Bucket' => 'bucket-name', ]); } catch (S3Exception $e) { echo $e->getMessage(); }
  • 24. Waiters $result = $s3->createBucket([ 'Bucket' => $bucket ]); $s3->waitUntilBucketExists([ 'Bucket' => $bucket ]); • Poll resources until available • Handle asynchronous and eventually consistent operations more easily
  • 25. Using the AWS SDK for PHP  CreateBucket  PutObject   ListObjects
  • 26. Uploading an Object to Amazon S3 $result = $s3->putObject([ 'Bucket' => 'my-cool-photos', 'Key' => 'photos/photo01.jpg', 'Body' => fopen('/path/to/photo01.jpg', 'r'), 'ACL' => 'public-read', ]); $url = $result->get('ObjectURL');
  • 27. Command Syntax – Short vs. Long Form // Short form $result = $s3->putObject([ // ... ]); // Long form $command = $s3->getCommand('PutObject', [ // ... ]); $result = $command->getResult();
  • 28. Executing Commands in Parallel $command1 = $s3->getCommand('PutObject', [ 'Bucket' => 'my-bucket-name', 'Key' => 'my-first-key', 'Body' => fopen('path/to/file1.ext', 'r') ]); $command2 = $s3->getCommand('PutObject', [ 'Bucket' => 'my-bucket-name', 'Key' => 'my-second-key', 'Body' => fopen('path/to/file2.ext', 'r') ]); $s3->execute([$command1, $command2]);
  • 29. Using the AWS SDK for PHP  CreateBucket  PutObject  ListObjects 
  • 30. Listing Objects in Your Bucket $result = $s3->listObjects([ 'Bucket' => 'my-bucket-name', ]); $nextResult = $s3->listObjects([ 'Bucket' => 'my-bucket-name', 'Marker' => 'photos/photo-1000.jpg', ]);
  • 31. Iterators – Enumerate Your Data Easily • Iterate through entire result sets • No handling of markers or tokens • Lazy loads results • Compatible with SPL iterators
  • 32. Iterators – Enumerating Your Data Easily $objects = $s3->getListObjectsIterator([ 'Bucket' => 'my-bucket-name', ]); foreach ($objects as $object) { echo $object['Key'] . "n"; }
  • 33. SDK 1.x – A Time Before Iterators $sk = null; $people = array(); do { $params = array('TableName'=>'people'); if ($sk) { $params['ExclusiveStartKey'] = array( 'HashKeyElement' => array( 'S' => $sk ) ); $sk= null; } $r = $dynamo_db->scan($params); if ($r->isOK()) { foreach ($r->body->Items as $item) { echo (string) $item->name->S; } if ($lk = $r->body->LastEvaluatedKey) { $sk = (string) $lk->HashKeyElement->S; } } else { throw new DynamoDB_Exception('...'); } } while ($sk);
  • 34. SDK 1.x – A Time Before Iterators $sk = null; $people = array(); do { $params = array('TableName'=>'people'); if ($sk) { $params['ExclusiveStartKey'] = array( 'HashKeyElement' => array( 'S' => $sk ) ); $sk= null; } $r = $dynamo_db->scan($params); if ($r->isOK()) { foreach ($r->body->Items as $item) { echo (string) $item->name->S; } if ($lk = $r->body->LastEvaluatedKey) { $sk = (string) $lk->HashKeyElement->S; } } else { throw new DynamoDB_Exception('...'); } } while ($sk);
  • 35. SDK 2.x – The Era of Iterators $scan = $db->getScanIterator([ 'TableName' => 'People', 'AttributesToGet' => ['Id', 'Name'] ]); foreach ($scan as $person) { echo $item['Name']['S']; }
  • 36. Advanced Iterator Usage – Example $objects = $s3->getListObjectsIterator([ 'Bucket' => 'my-bucket-name', ]); $objects = new LimitIterator($objects, 0, 5); foreach ($objects as $object) { echo $object['Key'] . "n"; }
  • 37. Using the AWS SDK for PHP  CreateBucket  PutObject  ListObjects
  • 38. PART 2 High-level Abstractions in the AWS SDK for PHP
  • 39. "I want to use Amazon S3 like a local filesystem." Amazon S3 Stream Wrapper
  • 40. PHP Stream Wrappers • Provide a consistent I/O interface for various protocols – fopen(), fread(), file_get_contents() , mkdir(), etc… – file://, http://, ftp://, php://, …
  • 41. PHP Stream Wrapper Protocols echo file_get_contents('/path/to/file'); Is equivalent to… echo file_get_contents('file:///path/to/file'); file:// is the protocol
  • 42. PHP Stream Wrapper Protocols echo file_get_contents('http://www.amazon.com'); http:// is the protocol
  • 43. Amazon S3 Stream Wrapper // First, register the wrapper $s3 = AwsS3S3Client::factory(); $s3->registerStreamWrapper(); echo file_get_contents('s3://bucket_name/key'); file_put_contents('s3://bucket_name/key', 'hi!'); s3:// bucket_name /key
  • 44. Pseudo-directory • Amazon S3 knows about buckets and keys • There aren't real subdirectories • Pseudo-directories can be created using a key prefix Bucket: foo Key: baz/bar/bam URL: http://foo.s3.amazonaws.com/baz/bar/bam
  • 45. Reading bytes off of a stream $fp = fopen('s3://bucket_name/key', 'r'); while (!feof($fp)) { echo fread($fp, 1024); } fclose($fp); Instead of reading all bytes up front and then using them
  • 46. Using Stream Filters Filters are used for: Conversion, Compression, Encryption, etc. $in = fopen('s3://bucket_name/key.zip', 'r'); $out = fopen('/path/to/file', 'w'); stream_filter_append($out, 'zlib.inflate'); stream_copy_to_stream($in, $out); fclose($in); fclose($out);
  • 47. Listing Objects and Buckets $dir = "s3://bucket_name/"; if (is_dir($dir) && ($dh = opendir($dir))) { while (($file = readdir($dh)) !== false) { echo "Name: {$file}n"; } closedir($dh); }
  • 48. Listing Objects and Buckets The more intuitive recursive iterator iterator iterator iterator … $dir = 's3://bucket_name'; $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST ); foreach ($iterator as $file) { echo $file->getType() . ': ' . $file . "n"; }
  • 49. Listing Objects and Buckets file: s3://bucket/aws_logo.png file: s3://bucket/background.gif file: s3://bucket/channel.xml file: s3://bucket/data.txt file: s3://bucket/destruct dir: s3://bucket/dirupload file: s3://bucket/dirupload/aws-autoloader.php file: s3://bucket/dirupload/aws.zip file: s3://bucket/dirupload/guzzle/guzzle/.gitignore file: s3://bucket/dirupload/guzzle/guzzle/.travis.yml file: s3://bucket/dirupload/guzzle/guzzle/CHANGELOG.md file: s3://bucket/dirupload/guzzle/guzzle/LICENSE
  • 50. PHP Stream Wrappers: Summary • • • • Access Amazon S3 like a local filesystem Read bytes off of a stream on demand Use familiar methods like file_get_contents Access to PHP's stream filters
  • 51. "I need to upload a local directory to an Amazon S3 bucket" For static blogs, websites, etc.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56. Local filesystem . ├── images │ ├── dotted-border.png │ ├── email.png │ ├── noise.png │ ├── rss.png │ └── search.png ├── index.html Amazon S3 Bucket . ├── images │ ├── dotted-border.png │ ├── email.png │ ├── noise.png │ ├── rss.png │ └── search.png ├── index.html
  • 57. uploadDirectory() 1. Recursively iterates over all local files 2. Checks if the file does not exist or if it has changed 3. Uploads matching files (single or multipart) $client->uploadDirectory('/local/directory', 'bucket'); public function uploadDirectory( $directory, $bucket, $keyPrefix = null, array $options = array() )
  • 59. uploadDirectory() Options $client->uploadDirectory('/local/dir', 'bucket', '', [ 'params' => ['ACL' => 'public-read'], 'concurrency' => 20, 'debug' => true ]); Debug output: Uploading /local/dir/images/email.png -> images/email.png (8 bytes) Uploading /local/dir/images/noise.png -> images/noise.png (12 bytes) Uploading /local/dir/images/rss.png -> images/rss.png (100 bytes) Uploading /local/dir/images/search.png -> images/search.png (200 bytes) Uploading /local/dir/index.html -> index.html (1024 bytes)
  • 60. "I need to download an Amazon S3 bucket to my local filesystem"
  • 61. downloadBucket() Works exactly like uploadDirectory() $client->downloadBucket ('/local/directory', 'bucket'); public function downloadBucket( $directory, $bucket, $keyPrefix = null, array $options = array() )
  • 62. Sync Amazon S3 -> Amazon S3 Upload the contents of one Amazon S3 bucket to another using uploadDirectory(). $client->uploadDirectory( 's3://bucket_src', 'bucket_dest' );
  • 63. "I need to use the SDK with my framework."
  • 64. Third-party Integrations • Laravel 4 Service Provider • Zend Framework 2 Module • Silex Service Provider https://github.com/aws If you'd like to help us or contribute to another framework integration, please come talk to us.
  • 65. Mastering the AWS SDK for PHP  Learned how to use the AWS SDK for PHP by working with some basic Amazon S3 operations.  Learned how to speed up some common development use cases by using some of the SDK's high-level abstractions.
  • 66. What you will do next • Star ★ the AWS SDK for PHP GitHub repo https://github.com/aws/aws-sdk-php • composer install the SDK into your project https://packagist.org/packages/aws/aws-sdk-php • Subscribe to the AWS PHP Development Blog http://blogs.aws.amazon.com/php • Build cool PHP apps on the AWS cloud!
  • 67. Mastering the AWS SDK for PHP Please give us your feedback on this presentation TLS306 As a thank you, we will select prize winners daily for completed surveys! Follow us: @awsforphp