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

[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをなAmazon Web Services Japan
 
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)Masaya Tahara
 
20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기Doyoon Kim
 
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...Amazon Web Services Korea
 
AWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAmazon Web Services Japan
 
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報Amazon Web Services Japan
 
20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-RayAmazon Web Services Japan
 
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017Amazon Web Services Korea
 
AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018
AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018
AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018Amazon Web Services Korea
 
CAF presentation 09 16-2020
CAF presentation 09 16-2020CAF presentation 09 16-2020
CAF presentation 09 16-2020Michael Nichols
 
Introduce Google Kubernetes
Introduce Google KubernetesIntroduce Google Kubernetes
Introduce Google KubernetesYongbok Kim
 
The Layman's Guide to Microsoft Azure
The Layman's Guide to Microsoft AzureThe Layman's Guide to Microsoft Azure
The Layman's Guide to Microsoft AzureAptera Inc
 
Aws organizations
Aws organizationsAws organizations
Aws organizationsOlaf Conijn
 
Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016
Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016
Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016Amazon Web Services
 
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...Amazon Web Services Korea
 

What's hot (20)

[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
 
Amazon EC2 Masterclass
Amazon EC2 MasterclassAmazon EC2 Masterclass
Amazon EC2 Masterclass
 
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)
OSS+AWSでここまでできるDevSecOps (Security-JAWS第24回)
 
20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기20명 규모의 팀에서 Vault 사용하기
20명 규모의 팀에서 Vault 사용하기
 
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
 
AWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct ConnectAWS Black Belt Techシリーズ AWS Direct Connect
AWS Black Belt Techシリーズ AWS Direct Connect
 
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
20211203 AWS Black Belt Online Seminar AWS re:Invent 2021アップデート速報
 
20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray
 
Amazon SQS overview
Amazon SQS overviewAmazon SQS overview
Amazon SQS overview
 
Black Belt Online Seminar AWS Amazon S3
Black Belt Online Seminar AWS Amazon S3Black Belt Online Seminar AWS Amazon S3
Black Belt Online Seminar AWS Amazon S3
 
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
금융권을 위한 AWS Direct Connect 기반 하이브리드 구성 방법 - AWS Summit Seoul 2017
 
AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018
AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018
AWS KMS를 활용하여 안전한 AWS 환경을 구축하기 위한 전략::임기성::AWS Summit Seoul 2018
 
CAF presentation 09 16-2020
CAF presentation 09 16-2020CAF presentation 09 16-2020
CAF presentation 09 16-2020
 
Introduce Google Kubernetes
Introduce Google KubernetesIntroduce Google Kubernetes
Introduce Google Kubernetes
 
The Layman's Guide to Microsoft Azure
The Layman's Guide to Microsoft AzureThe Layman's Guide to Microsoft Azure
The Layman's Guide to Microsoft Azure
 
Aws organizations
Aws organizationsAws organizations
Aws organizations
 
Azure storage
Azure storageAzure storage
Azure storage
 
Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016
Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016
Introduction to AWS Cloud Computing | AWS Public Sector Summit 2016
 
AWS SQS SNS
AWS SQS SNSAWS SQS SNS
AWS SQS SNS
 
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
 

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

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

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