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

세션 3: IT 담당자를 위한 Cloud 로의 전환
세션 3: IT 담당자를 위한 Cloud 로의 전환세션 3: IT 담당자를 위한 Cloud 로의 전환
세션 3: IT 담당자를 위한 Cloud 로의 전환Amazon Web Services Korea
 
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideAWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideManas Mondal
 
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage GatewayAWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage GatewayAmazon Web Services Japan
 
Deploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control TowerDeploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control TowerAmazon Web Services
 
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...Amazon Web Services
 
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...Amazon Web Services Korea
 
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要Amazon Web Services Japan
 
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
Data Migration Using AWS Snowball, Snowball Edge & SnowmobileData Migration Using AWS Snowball, Snowball Edge & Snowmobile
Data Migration Using AWS Snowball, Snowball Edge & SnowmobileAmazon Web Services
 
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築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
 
Journey Through The Cloud - Disaster Recovery
Journey Through The Cloud - Disaster RecoveryJourney Through The Cloud - Disaster Recovery
Journey Through The Cloud - Disaster RecoveryAmazon Web Services
 
Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기
Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기
Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기Amazon Web Services Korea
 
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順Amazon Web Services Japan
 
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021Amazon Web Services Korea
 
Migración de máquinas virtuales y recuperación ante desastres en AWS
Migración de máquinas virtuales y recuperación ante desastres en AWSMigración de máquinas virtuales y recuperación ante desastres en AWS
Migración de máquinas virtuales y recuperación ante desastres en AWSAmazon Web Services LATAM
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control TowerCloudHesive
 

What's hot (20)

세션 3: IT 담당자를 위한 Cloud 로의 전환
세션 3: IT 담당자를 위한 Cloud 로의 전환세션 3: IT 담당자를 위한 Cloud 로의 전환
세션 3: IT 담당자를 위한 Cloud 로의 전환
 
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideAWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
 
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage GatewayAWS Black Belt Online Seminar 2017 AWS Storage Gateway
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
 
Deploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control TowerDeploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control Tower
 
AWS for Backup and Recovery
AWS for Backup and RecoveryAWS for Backup and Recovery
AWS for Backup and Recovery
 
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
[NEW LAUNCH!] Deep Dive on Amazon FSx for Windows File Server (STG322-R) - AW...
 
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
AWS 클라우드 핵심 서비스로 클라우드 기반 아키텍처 빠르게 구성하기 - 문종민 솔루션즈 아키텍트, AWS :: AWS Summit Seo...
 
Cost Optimisation on AWS
Cost Optimisation on AWSCost Optimisation on AWS
Cost Optimisation on AWS
 
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
 
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
Data Migration Using AWS Snowball, Snowball Edge & SnowmobileData Migration Using AWS Snowball, Snowball Edge & Snowmobile
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
 
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
 
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...
 
Journey Through The Cloud - Disaster Recovery
Journey Through The Cloud - Disaster RecoveryJourney Through The Cloud - Disaster Recovery
Journey Through The Cloud - Disaster Recovery
 
AWS Security Best Practices
AWS Security Best PracticesAWS Security Best Practices
AWS Security Best Practices
 
Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기
Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기
Amazon EMR과 SageMaker를 이용하여 데이터를 준비하고 머신러닝 모델 개발 하기
 
AWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDSAWS Blackbelt 2015シリーズ RDS
AWS Blackbelt 2015シリーズ RDS
 
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
 
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
 
Migración de máquinas virtuales y recuperación ante desastres en AWS
Migración de máquinas virtuales y recuperación ante desastres en AWSMigración de máquinas virtuales y recuperación ante desastres en AWS
Migración de máquinas virtuales y recuperación ante desastres en AWS
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control Tower
 

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

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

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