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 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...
금융권 최신 AWS 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...금융권 최신 AWS 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...
금융권 최신 AWS 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...Amazon Web Services Korea
 
VPC Reachability Analyzer 使って人生が変わった話
VPC Reachability Analyzer 使って人生が変わった話VPC Reachability Analyzer 使って人生が変わった話
VPC Reachability Analyzer 使って人生が変わった話Noritaka Sekiyama
 
reInvent reCap 2022
reInvent reCap 2022reInvent reCap 2022
reInvent reCap 2022CloudHesive
 
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...Amazon Web Services
 
[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론
[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론
[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론Alex Hahn
 
20200811 AWS Black Belt Online Seminar CloudEndure
20200811 AWS Black Belt Online Seminar CloudEndure20200811 AWS Black Belt Online Seminar CloudEndure
20200811 AWS Black Belt Online Seminar CloudEndureAmazon Web Services Japan
 
運用視点でのAWSサポート利用Tips
運用視点でのAWSサポート利用Tips運用視点でのAWSサポート利用Tips
運用視点でのAWSサポート利用TipsNoritaka Sekiyama
 
[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...
[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...
[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...AWS Korea 금융산업팀
 
Oracle Cloud Infrastructure – Storage
Oracle Cloud Infrastructure – StorageOracle Cloud Infrastructure – Storage
Oracle Cloud Infrastructure – StorageMarketingArrowECS_CZ
 
Snowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the UglySnowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the UglyTyler Wishnoff
 
Introduction to snowflake
Introduction to snowflakeIntroduction to snowflake
Introduction to snowflakeSunil Gurav
 
AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음
AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음
AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음Amazon Web Services Korea
 
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例Amazon Web Services Japan
 
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...Edureka!
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Web Services Japan
 
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나Amazon Web Services Korea
 

What's hot (20)

금융권 최신 AWS 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...
금융권 최신 AWS 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...금융권 최신 AWS 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...
금융권 최신 AWS 도입 사례 총정리 – 신한 제주 은행, KB손해보험 사례를 중심으로 - 지성국 사업 개발 담당 이사, AWS / 정을용...
 
VPC Reachability Analyzer 使って人生が変わった話
VPC Reachability Analyzer 使って人生が変わった話VPC Reachability Analyzer 使って人生が変わった話
VPC Reachability Analyzer 使って人生が変わった話
 
reInvent reCap 2022
reInvent reCap 2022reInvent reCap 2022
reInvent reCap 2022
 
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...
AWS Networking – Advanced Concepts and new capabilities | AWS Summit Tel Aviv...
 
Introduction to Amazon Aurora
Introduction to Amazon AuroraIntroduction to Amazon Aurora
Introduction to Amazon Aurora
 
[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론
[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론
[SW 아키텍처 컨퍼런스] 클라우드 아키텍처 개론
 
20200811 AWS Black Belt Online Seminar CloudEndure
20200811 AWS Black Belt Online Seminar CloudEndure20200811 AWS Black Belt Online Seminar CloudEndure
20200811 AWS Black Belt Online Seminar CloudEndure
 
運用視点でのAWSサポート利用Tips
運用視点でのAWSサポート利用Tips運用視点でのAWSサポート利用Tips
運用視点でのAWSサポート利用Tips
 
[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...
[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...
[보험사를 위한 AWS Data Analytics Day] 5_KB금융그룹과 계열사의 AWS 기ᄇ...
 
Oracle Cloud Infrastructure – Storage
Oracle Cloud Infrastructure – StorageOracle Cloud Infrastructure – Storage
Oracle Cloud Infrastructure – Storage
 
Snowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the UglySnowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the Ugly
 
Introduction to snowflake
Introduction to snowflakeIntroduction to snowflake
Introduction to snowflake
 
AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음
AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음
AWS Finance Symposium_금융권을 위한 hybrid 클라우드 도입 첫걸음
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例
 
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
 
AWS Black Belt Techシリーズ AWS Lambda
AWS Black Belt Techシリーズ AWS LambdaAWS Black Belt Techシリーズ AWS Lambda
AWS Black Belt Techシリーズ AWS Lambda
 
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
 
AWS Security and SecOps
AWS Security and SecOpsAWS Security and SecOps
AWS Security and SecOps
 

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

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

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