SlideShare uma empresa Scribd logo
1 de 68
Baixar para ler offline
re:G
ene
rate

AWS  マイスターシリーズ  
AWS  SDK  for  PHP  &
AWS  SDK  for  Ruby  &
boto(Python)  &
JavaScript  in  Node.js

2013.12.20
アマゾン  データ  サービス  ジャパン株式会社
ソリューションアーキテクト
今井  榎並  蒋
© 2012 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.
ウェビナー(Webセミナー)へようこそ!
!   参加者は、⾃自動的にミュートになっています
!   質問を投げることができます!
§  GoToWebinarの仕組みを使って、書き込んでください
§  ただし環境によっては、⽇日本語の直接⼊入⼒力力ができないので、
お⼿手数ですが、テキストエディタ等に打ち込んでから、
コピペしてください

§  最後のQ&Aの時間で、できるだけ回答させて頂きます
§  書き込んだ質問は、主催者にしか⾒見見えません

!   Twitterのハッシュタグは#jawsugでどうぞ

2
© 2012 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.
Webセミナー
週刊AWSマイスターシリーズ  re:Generate!
!   AWSマイスターシリーズ

§  12⽉月4⽇日 AWS  re:Invent  アップデート振り返り
§  12⽉月11⽇日 AWS  SDK  for  Java/.Net
§  申し込みサイト
§  http://aws.amazon.com/jp/event_̲schedule/
§  過去資料料集
§  http://aws.amazon.com/jp/aws-‐‑‒meister/

3

© 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.
Agenda
!   AWS  SDK  概要
!   AWS  SDK  for  PHP
! boto(Python)
!   AWS  SDK  for  Ruby
!   AWS  SDK  for  JavaScript  in  Node.js
!   まとめ

4

© 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.
AWS  SDK概要
© 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.
AWS  SDKの重要性
!   AWSはプログラマブルなインフラ

•  プログラムから扱うためにはSDKが必要
•  ほぼすべてのサービスはマネジメントコンソールから利利⽤用でき
るが、⾃自動化しようと思ったらプログラムから扱うのが必須
•  ⾃自動化するとAWSは何倍も便便利利になる

!   代表的な⽤用途

•  インフラ構築/運⽤用の⾃自動化

•  EC2やRDSを上げたり下げたり、CloudFormationでスタックをデ
プロイしたり

•  アプリケーション的なサービスの利利⽤用

•  S3にデータをアップしたり、DynamoDBやSQSにデータ⼊入れたり
出したり

© 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.
AWS  SDK
!   AWSのサービスはHTTP/HTTPSでREST/SOAP形式の
APIをサポート。
例例えば
•  EC2  :  Start/Stop/Terminate
•  S3  :  GetObject/PutObject
•  DynamoDB  :  Get/Put

!   SDKはこれらのAPIを抽象化し、各⾔言語からの利利⽤用を⾮非
常に簡単にしてくれる

Your  code
AWS  SDK
API
7

EC2

S3

その他サービス

© 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.
AWS  SDK
!   下記の⾔言語/環境で提供中

Java

Python

JavaScript
in  nodeJS

PHP

JavaScript
in  the  Browser

.NET

iOS

Ruby

Android

© 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.
AWS  SDK
!   今回は下記についてお話します。

Java

Python

JavaScript
in  Node.js

PHP

JavaScript
in  the  Browser

.NET

iOS

Ruby

Android

© 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.
AWS  SDKの使い⽅方
!   必要な⾔言語のSDKをインストール

•  ⾔言語ごとにインストール⽅方法が異異なります。このあとの章で⾔言語ご
とに解説します。

!   Credential(AWS  APIの認証情報)を⽤用意する
!   ファクトリーメソッドを利利⽤用してサービス(例例えばS3)のクラ
イアントオブジェクトを⽣生成
•  このときにCredentialを渡す

!   クライアントオブジェクトのメソッドを使ってオペレーショ
ン(例例えばPutObject)
!   ⾔言語によってはより⾼高度度に抽象化されているSDKもあります。
© 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.
Credentialの取り扱い
!   Credentialの取り扱いについてはいくつかのやり⽅方があ
りますが、IAM  Roleもしくは環境変数を使うのがオス
スメです。PHPを例例にそれぞれの実装⽅方法をご案内しま
す。
!   コード内に直接埋め込むパターン(コード内に
Credentialが⼊入り込んでしまうのでやっちゃダメなパ
ターン)
<?php
$s3client  =  S3Client::factory(array(
'key'
=>
'your-‐‑‒aws-‐‑‒access-‐‑‒key-‐‑‒id',
'secretʻ‘ =>
'your-‐‑‒aws-‐‑‒secret-‐‑‒access-‐‑‒key',
));    

© 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.
Credentialの取り扱い

! configファイルでCredentialを設定するパターン

•  PHPとbotoではこの⽅方法が提供されている
•  これもCredentialがファイル化されるので良良くないパターン

$  vim  aws-‐‑‒config.php
<?php
return  array(
        'includes'  =>  array('_̲aws'),
        'services'  =>  array(
                'default_̲settings'  =>  array(
                        'params'  =>  array(
                                'key'        =>  'your-‐‑‒access-‐‑‒key-‐‑‒id',
                                'secret'  =>  'your-‐‑‒secret-‐‑‒access-‐‑‒key',)
                )
        )
);
$  vim  sample.php
<?php
$aws  =  Aws::factory(ʻ‘aws-‐‑‒config.php');
$s3client  =  $aws-‐‑‒>get('s3');
© 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.
Credentialの取り扱い
!   環境変数でCredentialを設定するパターン

•  AWS_̲ACCESS_̲KEY_̲ID,  AWS_̲SECRET_̲KEYという環境変数
を実⾏行行ユーザーで設定しておくことによってコードから
Credentialを追い出せる

$  export  AWS_̲ACCESS_̲KEY_̲ID="your-‐‑‒aws-‐‑‒access-‐‑‒key-‐‑‒id"
$  export  AWS_̲SECRET_̲KEY="your-‐‑‒aws-‐‑‒secret-‐‑‒access-‐‑‒key”
$vim  sample.php
<?php
$s3client  =  S3Client::factory();    

© 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.
Credentialの取り扱い
!   IAM  RoleでCredentialを設定するパターン

•  コードが動くのがEC2上であれば、IAM  Roleを使うことによっ
て、EC2⾃自体にAWS  APIへのアクセス権限を付与できる。よっ
てコードや環境変数にCredentialを持たせずに済む。
例例えばS3フルアクセスの権限を持った
IAM  Roleを作成して・・・

EC2にそのRoleを
割り当てると・・・
© 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.
Credentialの取り扱い
!   IAM  RoleでCredentialを設定するパターン

•  前のページのようにS3アクセス権限を持ったRoleをEC2に割り
当てると、下記を書くだけで利利⽤用可能。
$vim  sample.php
<?php
$s3client  =  S3Client::factory();    

•  これは、SDKが内部でSTS(Security  Token  Service)を利利⽤用し
ており、AccessKey,SecretAccessKey,Tokenを⾃自動的に

© 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.
AWS  SDK  for  PHP
© 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.
AWS  SDK  for  PHP
!
!
!
!
!
!

  Amazon提供のAWS開発⽤用のPHP向けSDK
  現在は、Version2
http://aws.amazon.com/jp/sdkforphp/
  環境:PHP5.3.3以降降
  Guzzle  HTTP  Client  framework上で構築されている
  依存Extension
•  cURL

© 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.
操作可能サービス
Direct Connect

Elasticache

IAM

EC2

SimpleDB

OpsWorks

ELB

S3

Elastic Transcoder

Auto Scaling

Glacier

SQS

EMR

CloudFront

SNS

Route53

Storage Gateway

SES

VPC

Import/Export

SWF

DynamoDB

Elastic Beanstalk

CloudSearch

RDS

Cloud Formation

Redshift

Cloud Watch

© 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.
利利⽤用⽅方法
!   Composerによるインストール(推奨)

•  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/
installation.html#installing-‐‑‒via-‐‑‒composer

!   Pharよるインストール

•  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/
installation.html#installing-‐‑‒via-‐‑‒phar

!   Zipファイルからインストール

•  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/
installation.html#installing-‐‑‒via-‐‑‒zip

!   PEARによるインストール

•  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/
installation.html#installing-‐‑‒via-‐‑‒pear

© 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.
初期設定
!   インストール⽅方法により以下のとおり異異なります
インストール方法

インクルード

Composer

require '/path/to/vendor/autoload.php';

Phar

require '/path/to/aws.phar';

Zip

require '/path/to/aws-autoloader.php';

PEAR

'AWSSDKforPHP/aws.phar';

!   コンフィグレーションファイルの設定

•  クレデンシャル情報などを設定可能
•  factory()の引数として指定することも可能
•  ʻ‘src/Aws/Common/Resources/aws-‐‑‒config.phpʼ’  を参考に追加

© 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.
サンプル:S3  -‐‑‒  putObject

API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒
Aws.S3.S3Client.html#_̲putObject

<?php
require  '/path/to/vendor/autoload.php';
use  AwsCommonAws;
use  AwsS3ExceptionS3Exception;
try  {
        $client  =  S3Client::factory; ①
        $bucket  =  ʼ’your_̲bucket';
        $file  =  'test.txt';
        $result  =  $client-‐‑‒>putObject(array(
'Bucket'  =>  $bucket,
'Key'  =>  $file,
'Body'  =>  fopen($file,  'r'),
        ));
        //  結果表⽰示
        var_̲dump($result);
}  catch  (S3Exception  $e)  {
        echo  '***  Error  ***'  .  "n";
        echo  $e-‐‑‒>getMessage();
}

①  S3クライアント作成
②  putObject実⾏行行

②

  Bucketを指定、Keyは、ファ
イル名、Bodyにアップロードす
るファイルストリームを指定

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:S3  -‐‑‒  getObject

API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒
Aws.S3.S3Client.html#_̲getObject

<?php
require  '/path/to/vendor/autoload.php';
use  AwsCommonAws;
use  AwsS3ExceptionS3Exception;
try  {
        $client  =  S3Client::factory; ①
        $bucket  =  ʼ’your_̲bucket';
        $file  =  'test.txt';
        $result  =  $client-‐‑‒>getObject(array(
'Bucket'  =>  $bucket,
'Key'  =>  $file,
));
        //  結果表⽰示
        echo  $result['Body']; ③
}  catch  (S3Exception  $e)  {
        echo  '***  Error  ***'  .  "n";
        echo  $e-‐‑‒>getMessage();
}

①  S3クライアント作成
②  getObject実⾏行行

②

  Bucketを指定、Keyは、ファイル
名
③  取得したコンテンツを表⽰示

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:SQS  -‐‑‒  sendMessage

API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒
Aws.Sqs.SqsClient.html#_̲sendMessage

<?php
require  '/path/to/vendor/autoload.php';
use  AwsCommonAws;
use  AwsSqsExceptionSqsException;
try  {
        $client  =  SqsClient::factory;        
①
        $queueUrl  =  'https://YourQueue';
        $result  =  $client-‐‑‒>sendMessage(array( ②
'QueueUrl'  =>  $queueUrl,
'MessageBody'  =>  'Send  Message!',
        ));
        //  結果表⽰示
        var_̲dump($result);
}  catch  (SqsException  $e)  {
        echo  '***  Error  ***'  .  "n";
        echo  $e-‐‑‒>getMessage();
}

①  SQSクライアント作成
②  sendMessage実⾏行行
  QueueURLを指定、送りたい
メッセージを指定

(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:SQS  -‐‑‒  receiveMessage

API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒
Aws.Sqs.SqsClient.html#_̲receiveMessage

<?php
require  '/path/to/vendor/autoload.php';
use  AwsCommonAws;
use  AwsSqsExceptionSqsException;

①  コンフィグを指定してインスタン
ス作成

②  SQSクライアント作成
try  {
        $client  =  SqsClient::factory; ①
③  receiveMessage実⾏行行
        $queueUrl  =  'https://YourQueue';
        $result  =  $client-‐‑‒>receiveMessage(array( ②
  QueueURLを指定
'QueueUrl'  =>  $queueUrl,
        ));
        //  結果表⽰示
        var_̲dump($result);
}  catch  (SqsException  $e)  {
        echo  '***  Error  ***'  .  "n";
        echo  $e-‐‑‒>getMessage();
}
(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:DynamoDB  -‐‑‒  putItem

API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒
Aws.DynamoDb.DynamoDbClient.html#_̲putItem
<?php
require  '/path/to/vendor/autoload.php';
use  AwsCommonAws;
use  AwsDynamoDbExceptionDynamoDbException;
try  {
        $client  =  DynamoDbClient::factory; ①
        $result  =  $client-‐‑‒>putItem(array(
                'TableName'  =>  ʼ’table_̲name',
                'Item'  =>  $client-‐‑‒>formatAttributes(array(
                        ʼ’id'                =>  100,
                        'timestamp'  =>  130699342,
                        'message'            =>  'Good  Morning.',
                )),
        ));        
        //  結果表⽰示
        var_̲dump($result);
}  catch  (DynamoDbException  $e)  {
        echo  '***  Error  ***'  .  "n";
        echo  $e-‐‑‒>getMessage();
}

①  DynamoDBクライアント作
成

②

②  putItem実⾏行行
-‐‑‒  TableName:  テーブル名
-‐‑‒  Item:  Putするアイテムを
指定
(例例)
    id  :  Hash  Key
    timestamp  :  Range  Key
    message  :  Attribute

(*)  事前にTableが作成されて
いる必要があります。

© 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.
サンプル:DynamoDB  -‐‑‒  getItem

API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒Aws.DynamoDb.DynamoDbClient.html#_̲getItem

<?php
require  '/path/to/vendor/autoload.php';
use  AwsCommonAws;
use  AwsDynamoDbExceptionDynamoDbException;
try  {
        $client  =  DynamoDbClient::factory; ①
        $result  =  $client-‐‑‒>getItem(array( ②
                'ConsistentRead'  =>  true,
                'TableName'  =>  'table_̲name',
                'Key'  =>  array(
ʼ’id'  =>  array('N'  =>  '100'),
'timestamp'  =>  array('N'  =>  '130699342')
)
        ));  
      //  結果表⽰示
        var_̲dump($result);
}  catch  (DynamoDbException  $e)  {
        echo  '***  Error  ***'  .  "n";
        echo  $e-‐‑‒>getMessage();
}

①  DynamoDBクライアント作
成
②  getItem実⾏行行
-‐‑‒  TableName:  テーブル名
-‐‑‒  Key:GetするアイテムのKey
を指定
(例例)
    id  :  Hash  Key
    timestamp  :  Range  Key

(*)  事前にTableが作成されてい
る必要があります。

© 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.
活⽤用法
!   PHPアプリのバックエンドストレージ呼び出し
•  DynamoDB,SQS,S3を簡単に呼び出し可能

!   PHPベースのアプリケーションの拡張

•  WordpressやEC-‐‑‒CubeなどのPHPベースのアプリケーションと
AWSの連携

!   独⾃自の管理理⽤用Webインターフェースの作成

•  定型作業を簡略略化したり、管理理を容易易にするための独⾃自Webイ
ンターフェースの作成

© 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.
PHP版SDKの便便利利なクラス
! DynamoDBSessionHandler

! DynamoDBを使った、HTTPのセッション共有が可能

EC2

ELB

EC2

EC2

DynamoDB

速い
消えない
管理不要

© 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.
DynamoDBSessionHandlerの利利⽤用
<?php
require  '/home/ec2-‐‑‒user/vendor/autoload.php';
use  AwsCommonAws;
use  AwsDynamoDbExceptionDynamoDbException;
use  AwsDynamoDbDynamoDbClient;
use  AwsDynamoDbSessionSessionHandler;
$aws  =  Aws::factory(ʼ’aws-‐‑‒config.php');
$client  =  $aws-‐‑‒>get('dynamodb');
try  {
        $sessionHandler  =  SessionHandler::factory(array(
                'dynamodb_̲client'  =>  $client,
                'table_̲name'            =>  'sessions',
        ));
        $sessionHandler-‐‑‒>register();
}  catch  (DynamoDbException  $e)  {
        echo  '***  Error  ***'  .  "n";
        echo  $e-‐‑‒>getMessage();
}
session_̲start();
//セッションにデータ登録
$_̲SESSION['username']  =  'jeremy';
$_̲SESSION['role']  =  'admin';
session_̲commit();

© 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.
boto(Python)
© 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.
botoとは
!   Python⽤用のAWS  SDKのデファクトスタンダード
!   最新版は2.19.0  (2013年年12⽉月現在)
!   Python  2.6.6,  2.7.3  on  Mac  OSX  and  Ubuntu  Maverick  
で動作確認している。
!   Python  2.5での互換性もなるべく考慮しているが保証外
!   Python  3.x版はDeveloper  Preview中

© 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.
操作可能サービス
Direct Connect

Elasticache

IAM

EC2

SimpleDB

OpsWorks

ELB

S3

Elastic Transcoder

Auto Scaling

Glacier

SQS

EMR

CloudFront

SNS

Route53

Storage Gateway

SES

VPC

Import/Export

SWF

DynamoDB

Elastic Beanstalk

CloudSearch

RDS

Cloud Formation

Data Pipeline

Redshift

Cloud Watch

CloudTrail

FPS

EBS

© 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.
botoに関するリソース
!   ソースコードリポジトリ

•  https://github.com/boto/boto

! PyPI

•  http://pypi.python.org/pypi/boto

!   オンラインドキュメント

•  http://docs.pythonboto.org/

!   IRC

•  http://webchat.freenode.net/?channels=boto

©  2012  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  
© 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.
Amazon.com,  Inc.
インストール

  $  pip  install  boto

©  2012  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  
© 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.
Amazon.com,  Inc.
初期設定
!   設定ファイルの作成
!   /etc/boto.cfg  -‐‑‒  グローバルな設定を記述
!   ~∼/.boto  ユーザー毎の設定を記述
[Boto]
debug  =  0
num_̲retries  =  10

[DynamoDB]
region  =  ap-‐‑‒northeast-‐‑‒1

©  2012  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  
© 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.
Amazon.com,  Inc.
サンプル:S3  –  set_̲contents_̲from_̲string
>>>  from  boto.s3.connection  import  S3Connection
>>>  conn  =  S3Connection()
>>>  bucket_̲name  =  ”yourBucket"
>>>  bucket  =    conn.get_̲bucket(bucket_̲name)
>>>  from  boto.s3.key  import  Key
>>>  k  =  Key(bucket)
>>>  k.key  =  "test.txt"
>>>  k.set_̲contents_̲from_̲string("Hello  World!")

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:S3  –  get_̲contents_̲as_̲string
>>>  from  boto.s3.connection  import  S3Connection
>>>  conn  =  S3Connection()
>>>  bucket_̲name  =  "yourBucket"
>>>  bucket  =    conn.get_̲bucket(bucket_̲name)
>>>  from  boto.s3.key  import  Key
>>>  k  =  Key(bucket)
>>>  k.key  =  "test.txt"
>>>  k.get_̲contents_̲as_̲string()

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:SQS  –  write
>>>  import  boto.sqs
>>>  conn  =  boto.sqs.connect_̲to_̲region("ap-‐‑‒northeast-‐‑‒1")
>>>  q  =  conn.get_̲queue('YourQueue')
>>>  from  boto.sqs.message  import  Message
>>>  m  =  Message()
>>>  m.set_̲body('Hello  World!!')
>>>  q.write(m)

(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:SQS  –  get_̲messages
>>>  import  boto.sqs
>>>  conn  =  boto.sqs.connect_̲to_̲region("ap-‐‑‒northeast-‐‑‒1")
>>>  q  =  conn.get_̲queue('YourQueue')
>>>  rs  =  q.get_̲messages()
>>>  m  =  rs[0]
>>>  m.get_̲body()
'Hello  World!!'

(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:DynamoDB  –  putItem
>>>  from  boto.dynamodb2.items  import  Item
>>>  from  boto.dynamodb2.table  import  Table
>>>  table  =  Table('table_̲name')
>>>  item  =  Item(table  ,  data={
...  ʼ’id':  100,
...  'timestamp':  130699342,
...  'message'  :  'Good  Morning.',
...  })
>>>  item.save()
True

(*)  事前にTableが作成されてい
る必要があります。

© 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.
サンプル:DynamoDB  –  getItem
>>>  from  boto.dynamodb2.table  import  Table
>>>  table=  Table('table_̲name')
>>>  item  =  table.get_̲item(id=100,timestamp=130699342)
>>>  print  item['message']
Good  Morning.

(*)  事前にTableが作成されてい
る必要があります。

© 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.
その他Tips
!   AWSコマンドラインインタフェース(CLI)もbotoを⼀一部
利利⽤用している

© 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.
AWS  SDK  for  Ruby
© 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.
AWS  SDK  for  Rubyとは
!   Amazon提供のAWS開発⽤用のRuby向けSDK
!   現在のバージョン
•  Version  1  (stable)
•  Version  2  (developer  preview)

! http://aws.amazon.com/sdkforruby/  
!   環境:Ruby  1.8.7  以降降

© 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.
操作可能サービス
Direct Connect

Elasticache

IAM

EC2

SimpleDB

OpsWorks

ELB

S3

Elastic Transcoder

Auto Scaling

Glacier

SQS

EMR

CloudFront

SNS

Route53

Storage Gateway

SES

VPC

Import/Export

SWF

DynamoDB

Elastic Beanstalk

CloudSearch

RDS

Cloud Formation

Data Pipeline

Redshift

Cloud Watch

© 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.
利利⽤用⽅方法
!   Ruby環境のセットアップ
•  Rbenvを利利⽤用する
•  https://github.com/sstephenson/rbenv  
•  RVMを利利⽤用する
•  https://rvm.io/  
! aws-‐‑‒sdk  gemをインストール
$  gem  install  aws-‐‑‒sdk

© 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.
設定の初期化
!   デフォルトのリージョンをセッティング
require  'awsʼ’
AWS.config({
:region  =>  ʻ‘YOUR_̲DEFAULT_̲REGIONʼ’
})

© 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.
サンプル:S3  -‐‑‒  write
API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#write-‐‑‒
instance_̲method

#!/usr/bin/env  ruby
require  'aws'
AWS.config({
    :access_̲key_̲id  =>  
ENV['AWS_̲ACCESS_̲KEY_̲ID'],
    :secret_̲access_̲key  =>  
ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],
    :region  =>  ENV['AWS_̲REGION']
})

①  コンフィグを指定

①

②  S3クライアント作成し、
bucketやkeyを指定
③  putするfile名を指定し、s3に
put

②

s3  =  AWS::S3.new
bucket  =  s3.buckets['your-‐‑‒bucket']
obj  =  bucket.objects['key']
obj.write(Pathname.new('/path/to/file.txt')) ③

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:S3  -‐‑‒  read
API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#read-‐‑‒
instance_̲method

#!/usr/bin/env  ruby
require  'aws'

①  コンフィグを指定

AWS.config({
    :access_̲key_̲id  =>  
ENV['AWS_̲ACCESS_̲KEY_̲ID'],
    :secret_̲access_̲key  =>  
ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],
    :region  =>  ENV['AWS_̲REGION']
})

①

s3  =  AWS::S3.new
bucket  =  s3.buckets['your-‐‑‒bucket']
obj  =  bucket.objects['key']

②

obj.read  do  |chunk|
    puts  chunk
    #=>  data  of  s3://your-‐‑‒bucket/key
end

③

②  S3クライアント作成し、
bucketやkeyを指定
③  s3にあるobjectのデータを取
得

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:SQS  –  send_̲message

API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/SQS/
Client.html#send_̲message-‐‑‒instance_̲method

#!/usr/bin/env  ruby
require  'aws'
require  'pp'

①  コンフィグを指定

AWS.config({
    :access_̲key_̲id  =>  
ENV['AWS_̲ACCESS_̲KEY_̲ID'],
    :secret_̲access_̲key  =>  
ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],
    :region  =>  ENV['AWS_̲REGION']
})

①

sqs  =  AWS::SQS.new

②

queue_̲url  =  'https://your_̲queue'
result  =  sqs.client.send_̲message({
    :queue_̲url        =>  queue_̲url,
    :message_̲body  =>  'Send  Message!'
})
pp  result

②  SQSクライアント作成

③

③  send_̲message実⾏行行
  queue_̲urlを指定、送りたい
メッセージを指定

(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:SQS  –  receive_̲message

API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/SQS/
Client.html#receive_̲message-‐‑‒instance_̲method

#!/usr/bin/env  ruby
require  'aws'
require  'pp'

①  コンフィグを指定

AWS.config({
    :access_̲key_̲id  =>  
ENV['AWS_̲ACCESS_̲KEY_̲ID'],
    :secret_̲access_̲key  =>  
ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],
    :region  =>  ENV['AWS_̲REGION']
})

①

sqs  =  AWS::SQS.new

②

queue_̲url  =  'https://your_̲queue'
result  =  sqs.client.receive_̲message({
    :queue_̲url        =>  queue_̲url
})
pp  result

②  SQSクライアント作成

③

③  receive_̲message実⾏行行
  queue_̲urlを指定

(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:DynamoDB  –  put_̲item

API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/DynamoDB/Client.html#put_̲item-‐‑‒
instance_̲method
#!/usr/bin/env  ruby
require  'aws'
require  'pp'

①  コンフィグを指定

AWS.config({
①
    :access_̲key_̲id  =>  ENV['AWS_̲ACCESS_̲KEY_̲ID'],
    :secret_̲access_̲key  =>  ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],
    :region  =>  ENV['AWS_̲REGION']
})
client  =  AWS::DynamoDB::Client.new
result  =  client.put_̲item({
    :table_̲name  =>  'table_̲nameʼ’,
    :item  =>  {
        'id'                              =>  {:n  =>  '100'},
        'timestamp'  =>  {:n  =>  '130699342'},
        'message'        =>  {:s  =>  'Good  Morning'}
    }
})
pp  result
#=>  {"ConsumedCapacityUnits"=>1.0}

②
③

②  DynamoDBクライアント作成
③  put_̲item実⾏行行
-‐‑‒  :table_̲name:  テーブル名
-‐‑‒  :item:  Putするアイテムを指
定
(例例)
    id  :  Hash  Key
    timestamp  :  Range  Key
    message  :  Attribute

(*)  事前にTableが作成されてい
る必要があります。

© 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.
サンプル:DynamoDB  –  get_̲item

API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/DynamoDB/Client.html#get_̲item-‐‑‒
instance_̲method
#!/usr/bin/env  ruby
require  'aws'
require  'pp'

①  コンフィグを指定

AWS.config({
①
    :access_̲key_̲id  =>  ENV['AWS_̲ACCESS_̲KEY_̲ID'],
    :secret_̲access_̲key  =>  ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],
    :region  =>  ENV['AWS_̲REGION']
})
client  =  AWS::DynamoDB::Client.new
result  =  client.get_̲item({
    :consistent_̲read  =>  true,
    :table_̲name  =>  'table_̲name',
    :key  =>  {
        :hash_̲key_̲element  =>  {:n  =>  '100'},
        :range_̲key_̲element  =>  {:n  =>  '130699342'}
    }
})
pp  result
#=>  {"Item"=>{"id"=>{"N"=>"100"},  
"message"=>{"S"=>"Good  Morning"},  
"timestamp"=>{"N"=>"130699342"}},  
"ConsumedCapacityUnits"=>1.0}

②
③

②  DynamoDBクライアント
作成
③  get_̲item実⾏行行
-‐‑‒  :table_̲name  テーブル名
-‐‑‒  :consistent_̲read  ⼀一貫性
-‐‑‒  :key  GutするKeyを指定
(例例)
    id  :  Hash  Key
    timestamp  :  Range  Key

(*)  事前にTableが作成され
ている必要があります。

© 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.
その他Tips
!   新しいRuby  SDK  (version  2)
• 
• 
• 
• 

Developer  Preview
バリデーション、ドキュメント、拡張性など改善
プラグイン⽅方式をとっている
Ruby  1.9以降降が必須

!   以下のように利利⽤用可能
$  gem  install  aws-‐‑‒sdk-‐‑‒core

AWS::DynamoDB.new(api_̲version:  ʻ‘2012-‐‑‒08-‐‑‒10ʼ’)
Re:Inventで発表された新Ruby  SDKのスライドはおすすめ

© 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.
その他Tips
!   RailsのセッションをDynamoDBに保存

•  スケーラブルかつ耐障害に優れたセッションストア
•  Rails  3.x  か  4.x  から利利⽤用可能
•  Rackベースのアプリも利利⽤用可能

!   以下の⼿手順で利利⽤用可能
gem  ʻ‘aws-‐‑‒sessionstore-‐‑‒dynamodbʼ’
$  bundle  install
参考:https://github.com/aws/aws-‐‑‒sessionstore-‐‑‒dynamodb-‐‑‒ruby  

© 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.
AWS  SDK  for  JavaScript
in  Node.js
© 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.
AWS  SDK  for  JavaScript  in  Node.jsとは
!   Amazon提供のAWS開発⽤用のnode.js環境で動くJavaScript
向けSDK
•  http://aws.amazon.com/sdkfornodejs/

© 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.
操作可能サービス
Direct Connect

Elasticache

IAM

EC2

SimpleDB

OpsWorks

ELB

S3

Elastic Transcoder

Auto Scaling

Glacier

SQS

EMR

CloudFront

SNS

Route53

Storage Gateway

SES

VPC

Import/Export

SWF

DynamoDB

Elastic Beanstalk

CloudSearch

RDS

Cloud Formation

Data Pipeline

Redshift

Cloud Watch

© 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.
利利⽤用⽅方法
! Node.js環境のセットアップ
•  OSのパッケージマネージャーでnpmをインストール
•  Mac  の場合:
$  brew  install  npm

! aws-‐‑‒sdk  packageをインストール
$  npm  install  aws-‐‑‒sdk

© 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.
サンプル:S3  -‐‑‒  putObject
var  AWS  =  require('aws-‐‑‒sdk');
var  fs  =  require('fs');
var  s3  =  new  AWS.S3();

①

var  bodyStream  =  fs.createReadStream(  '/path/ ②
to/file.txt'  );
var  params  =  {
    Bucket:  'your-‐‑‒bucket',
    Key:  'key',
    Body:  bodyStream
};
s3.putObject(params,  function(err,  data)  {
    if  (err)
        console.log(err);
    else
        console.log("Successfully  uploaded.");
});

①  S3クライアント作成

②  put時の引数
•  Bucket:  s3  bucket
•  Key:  s3  key
•  Body:  実際のデータ

③ ③  S3へPUT

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:S3  -‐‑‒  getObject
var  AWS  =  require('aws-‐‑‒sdk');
var  fs  =  require('fs');
var  s3  =  new  AWS.S3();

①

var  params  =  {
    Bucket:  ʼ’your-‐‑‒bucket',
    Key:  ʼ’key'
};

②

s3.getObject(params,  function(err,  data)  {
    if  (err)
        console.log(err);
    else
        console.log(data.Body.toString());
});

③

①  S3クライアント作成

②  gut時の引数
•  Bucket:  s3  bucket
•  Key:  s3  key
③  S3からデータ取得

(*)  事前にBucketが作成されて
いる必要があります。

© 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.
サンプル:SQS  -‐‑‒  sendMessage
var  AWS  =  require('aws-‐‑‒sdk');
var  fs  =  require('fs');
var  s3  =  new  AWS.SQS();

①

var  params  =  {
②
    QueueUrl:  'https://your_̲queue',
    MessageBody:  'Send  Message!'
}
sqs.sendMessage(params,  function(err,  data)  {
    if  (err)
        console.log(err);
    else
        console.log("Successfully  sent.");
})

①  SQSクライアント作成

②  queue_̲urlを指定、送りたい
メッセージを指定
③  sendMessage実⾏行行

(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:SQS  -‐‑‒  receiveMessage
var  AWS  =  require('aws-‐‑‒sdk');
var  fs  =  require('fs');
var  s3  =  new  AWS.SQS();

①

①  SQSクライアント作成

var  params  =  {
② ②  queue_̲urlを指定
    QueueUrl:  'https://your_̲queueʼ’
}
sqs.receiveMessage(params,  function(err,  data)   ③  receiveMessage実⾏行行
{
③
  
    if  (err)
        console.log(err);
    else
        console.log(data);
})
(*)  事前にQueueが作成されて
いる必要があります。

© 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.
サンプル:DynamoDB  –  putItem
var  AWS  =  require('aws-‐‑‒sdk');
var  fs  =  require('fs');
var  ddb  =  new  AWS.DynamoDB();

①

var  params  =  {
    TableName:  'my_̲table',
    Item:  {
        'id':  {N:  ʻ‘100'},
        'timestamp':  {N:  '130699342'},
        'message':  {S:  'Good  Morning'}
    }
};

②

ddb.putItem(params,  function(err,  data)  {
    if  (err)
        console.log(err);
    else
        console.log(data);
});

③

①  DynamoDBクライアント
作成
②  パラメータ指定
-‐‑‒  :TableName:  テーブル名
-‐‑‒  :Item:  Putするアイテムを指
定
(例例)
    id  :  Hash  Key
    timestamp  :  Range  Key
    message  :  Attribute
③  Put実⾏行行

(*)  事前にTableが作成され
ている必要があります。

© 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.
サンプル:DynamoDB  –  getItem
var  AWS  =  require('aws-‐‑‒sdk');
var  fs  =  require('fs');
var  ddb  =  new  AWS.DynamoDB();

①

var  params  =  {
    TableName:  'my_̲table',
    Key:  {
        'id':  {N:  ʻ‘100'},
        'timestamp':  {N:  '130699342'}
    }
};

②

ddb.getItem(params,  function(err,  data)  {
    if  (err)
        console.log(err);
    else
        console.log(data);
});

③

①  DynamoDBクライアント作
成
②  パラメータ指定
-‐‑‒  :TableName:  テーブル名
-‐‑‒  :Item:  Putするアイテムを
指定
(例例)
    id  :  Hash  Key
    timestamp  :  Range  Key
    message  :  Attribute
③  Get実⾏行行

(*)  事前にTableが作成されてい
る必要があります。

© 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.
まとめ
© 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.
今回のまとめ
!   AWSはプログラマブルなインフラ

•  ほぼすべてのサービスはマネジメントコンソールから利利⽤用でき
るが、⾃自動化しようと思ったらプログラムから扱うのが必須
•  ⾃自動化するとAWSは何倍も便便利利になる

!   AWSのサービスはHTTP/HTTPSでREST/SOAP形式の
APIをサポート。
例例えば
•  EC2  :  Start/Stop/Terminate
•  S3  :  GetObject/PutObject
•  DynamoDB  :  Get/Put

!   SDKはこれらのAPIを抽象化し、各⾔言語からの利利⽤用を⾮非
常に簡単にしてくれる
© 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.
Q&A

68
© 2012 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.

Mais conteúdo relacionado

Mais procurados

DeNA の AWS アカウント管理とセキュリティ監査自動化
DeNA の AWS アカウント管理とセキュリティ監査自動化DeNA の AWS アカウント管理とセキュリティ監査自動化
DeNA の AWS アカウント管理とセキュリティ監査自動化DeNA
 
Black Belt Online Seminar AWS上の暗号化ソリューション
Black Belt Online Seminar AWS上の暗号化ソリューションBlack Belt Online Seminar AWS上の暗号化ソリューション
Black Belt Online Seminar AWS上の暗号化ソリューションAmazon Web Services Japan
 
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.020191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0Amazon Web Services Japan
 
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@Edge
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@EdgeAWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@Edge
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@EdgeAmazon Web Services Japan
 
20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems ManagerAmazon Web Services Japan
 
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQLAmazon Web Services Japan
 
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design PatternAWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design PatternAmazon Web Services Japan
 
【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践
【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践
【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践日本マイクロソフト株式会社
 
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...Amazon Web Services Japan
 
20190821 AWS Black Belt Online Seminar AWS AppSync
20190821 AWS Black Belt Online Seminar AWS AppSync20190821 AWS Black Belt Online Seminar AWS AppSync
20190821 AWS Black Belt Online Seminar AWS AppSyncAmazon Web Services Japan
 
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
20191016 AWS Black Belt Online Seminar Amazon Route 53 ResolverAmazon Web Services Japan
 
20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-RayAmazon Web Services Japan
 
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipelineAmazon Web Services Japan
 
20200826 AWS Black Belt Online Seminar AWS CloudFormation
20200826 AWS Black Belt Online Seminar AWS CloudFormation 20200826 AWS Black Belt Online Seminar AWS CloudFormation
20200826 AWS Black Belt Online Seminar AWS CloudFormation Amazon Web Services Japan
 

Mais procurados (20)

AWS Black Belt Online Seminar 2017 AWS WAF
AWS Black Belt Online Seminar 2017 AWS WAFAWS Black Belt Online Seminar 2017 AWS WAF
AWS Black Belt Online Seminar 2017 AWS WAF
 
DeNA の AWS アカウント管理とセキュリティ監査自動化
DeNA の AWS アカウント管理とセキュリティ監査自動化DeNA の AWS アカウント管理とセキュリティ監査自動化
DeNA の AWS アカウント管理とセキュリティ監査自動化
 
Black Belt Online Seminar Amazon CloudWatch
Black Belt Online Seminar Amazon CloudWatchBlack Belt Online Seminar Amazon CloudWatch
Black Belt Online Seminar Amazon CloudWatch
 
AWS Black Belt Techシリーズ Amazon EBS
AWS Black Belt Techシリーズ  Amazon EBSAWS Black Belt Techシリーズ  Amazon EBS
AWS Black Belt Techシリーズ Amazon EBS
 
Black Belt Online Seminar AWS上の暗号化ソリューション
Black Belt Online Seminar AWS上の暗号化ソリューションBlack Belt Online Seminar AWS上の暗号化ソリューション
Black Belt Online Seminar AWS上の暗号化ソリューション
 
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.020191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
 
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@Edge
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@EdgeAWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@Edge
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@Edge
 
20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager
 
AWS Lambdaを紐解く
AWS Lambdaを紐解くAWS Lambdaを紐解く
AWS Lambdaを紐解く
 
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
 
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design PatternAWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
 
【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践
【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践
【de:code 2020】 Azure Red hat OpenShift (ARO) によるシステムアーキテクチャ構築の実践
 
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
 
Black Belt Online Seminar AWS Amazon S3
Black Belt Online Seminar AWS Amazon S3Black Belt Online Seminar AWS Amazon S3
Black Belt Online Seminar AWS Amazon S3
 
20190821 AWS Black Belt Online Seminar AWS AppSync
20190821 AWS Black Belt Online Seminar AWS AppSync20190821 AWS Black Belt Online Seminar AWS AppSync
20190821 AWS Black Belt Online Seminar AWS AppSync
 
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
 
20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray20200526 AWS Black Belt Online Seminar AWS X-Ray
20200526 AWS Black Belt Online Seminar AWS X-Ray
 
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
 
20200826 AWS Black Belt Online Seminar AWS CloudFormation
20200826 AWS Black Belt Online Seminar AWS CloudFormation 20200826 AWS Black Belt Online Seminar AWS CloudFormation
20200826 AWS Black Belt Online Seminar AWS CloudFormation
 
俺とHashiCorp
俺とHashiCorp俺とHashiCorp
俺とHashiCorp
 

Semelhante a [AWSマイスターシリーズ] AWS SDK for PHP / Ruby / boto(Python) / JavaScript in Node.js

Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪
Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪
Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪真吾 吉田
 
AWSマイスターシリーズReloaded -AWS SDK for .NET-
AWSマイスターシリーズReloaded -AWS SDK for .NET-AWSマイスターシリーズReloaded -AWS SDK for .NET-
AWSマイスターシリーズReloaded -AWS SDK for .NET-Amazon Web Services Japan
 
Programming AWS with Perl at YAPC::Asia 2013
Programming AWS with Perl at YAPC::Asia 2013Programming AWS with Perl at YAPC::Asia 2013
Programming AWS with Perl at YAPC::Asia 2013Yasuhiro Horiuchi
 
[AWSマイスターシリーズ] AWS SDK for Java / .NET
[AWSマイスターシリーズ] AWS SDK for Java / .NET[AWSマイスターシリーズ] AWS SDK for Java / .NET
[AWSマイスターシリーズ] AWS SDK for Java / .NETAmazon Web Services Japan
 
[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormation[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormationAmazon Web Services Japan
 
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信Amazon Web Services Japan
 
[AWSマイスターシリーズ] AWS OpsWorks
[AWSマイスターシリーズ] AWS OpsWorks[AWSマイスターシリーズ] AWS OpsWorks
[AWSマイスターシリーズ] AWS OpsWorksAmazon Web Services Japan
 
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門Amazon Web Services Japan
 
[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic Beanstalk[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic BeanstalkAmazon Web Services Japan
 
俺の俺による俺のための App Service Environment
俺の俺による俺のための App Service Environment俺の俺による俺のための App Service Environment
俺の俺による俺のための App Service EnvironmentSunao Tomita
 
LambdaとMobileの美味しいかもしれない関係
LambdaとMobileの美味しいかもしれない関係LambdaとMobileの美味しいかもしれない関係
LambdaとMobileの美味しいかもしれない関係Hiraku Komuro
 
インフラ系自主トレするならAWS
インフラ系自主トレするならAWSインフラ系自主トレするならAWS
インフラ系自主トレするならAWSYasuhiro Araki, Ph.D
 
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めよう
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めようAWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めよう
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めようAmazon Web Services Japan
 
20151030 オープンデータとセキュリティon aws
20151030 オープンデータとセキュリティon aws20151030 オープンデータとセキュリティon aws
20151030 オープンデータとセキュリティon awstakaoka susumu
 
May the FaaS be with us!!
May the FaaS be with us!!May the FaaS be with us!!
May the FaaS be with us!!真吾 吉田
 
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)Amazon Web Services Japan
 
AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)
AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)
AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)Mitsuhiro Yamashita
 
20190619 AWS Black Belt Online Seminar Dive Deep into AWS Chalice
20190619 AWS Black Belt Online Seminar Dive Deep into AWS Chalice20190619 AWS Black Belt Online Seminar Dive Deep into AWS Chalice
20190619 AWS Black Belt Online Seminar Dive Deep into AWS ChaliceAmazon Web Services Japan
 

Semelhante a [AWSマイスターシリーズ] AWS SDK for PHP / Ruby / boto(Python) / JavaScript in Node.js (20)

Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪
Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪
Anchors Aweigh!! - re:Invent報告@re:Port 2016 大阪
 
AWSマイスターシリーズReloaded -AWS SDK for .NET-
AWSマイスターシリーズReloaded -AWS SDK for .NET-AWSマイスターシリーズReloaded -AWS SDK for .NET-
AWSマイスターシリーズReloaded -AWS SDK for .NET-
 
Programming AWS with Perl at YAPC::Asia 2013
Programming AWS with Perl at YAPC::Asia 2013Programming AWS with Perl at YAPC::Asia 2013
Programming AWS with Perl at YAPC::Asia 2013
 
[AWSマイスターシリーズ] AWS SDK for Java / .NET
[AWSマイスターシリーズ] AWS SDK for Java / .NET[AWSマイスターシリーズ] AWS SDK for Java / .NET
[AWSマイスターシリーズ] AWS SDK for Java / .NET
 
[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormation[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormation
 
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
 
Using Windows Azure
Using Windows AzureUsing Windows Azure
Using Windows Azure
 
[AWSマイスターシリーズ] AWS OpsWorks
[AWSマイスターシリーズ] AWS OpsWorks[AWSマイスターシリーズ] AWS OpsWorks
[AWSマイスターシリーズ] AWS OpsWorks
 
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
AWSのインフラはプログラミングコードで構築!AWS Cloud Development Kit 入門
 
[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic Beanstalk[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic Beanstalk
 
俺の俺による俺のための App Service Environment
俺の俺による俺のための App Service Environment俺の俺による俺のための App Service Environment
俺の俺による俺のための App Service Environment
 
LambdaとMobileの美味しいかもしれない関係
LambdaとMobileの美味しいかもしれない関係LambdaとMobileの美味しいかもしれない関係
LambdaとMobileの美味しいかもしれない関係
 
インフラ系自主トレするならAWS
インフラ系自主トレするならAWSインフラ系自主トレするならAWS
インフラ系自主トレするならAWS
 
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めよう
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めようAWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めよう
AWS Black Belt Online Seminar AWSサービスを利用したアプリケーション開発を始めよう
 
Amazon Simple Workflow Service (SWF)
Amazon Simple Workflow Service (SWF)Amazon Simple Workflow Service (SWF)
Amazon Simple Workflow Service (SWF)
 
20151030 オープンデータとセキュリティon aws
20151030 オープンデータとセキュリティon aws20151030 オープンデータとセキュリティon aws
20151030 オープンデータとセキュリティon aws
 
May the FaaS be with us!!
May the FaaS be with us!!May the FaaS be with us!!
May the FaaS be with us!!
 
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)
[AWSマイスターシリーズ]Amazon Simple Workflow Service (SWF)
 
AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)
AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)
AWSの勉強は試して試して楽しんで (AWS認定DVA本書きました)
 
20190619 AWS Black Belt Online Seminar Dive Deep into AWS Chalice
20190619 AWS Black Belt Online Seminar Dive Deep into AWS Chalice20190619 AWS Black Belt Online Seminar Dive Deep into AWS Chalice
20190619 AWS Black Belt Online Seminar Dive Deep into AWS Chalice
 

Mais de Amazon Web Services Japan

202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFSAmazon Web Services Japan
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device DefenderAmazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...Amazon Web Services Japan
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Web Services Japan
 
20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したことAmazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用Amazon Web Services Japan
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdfAmazon Web Services Japan
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介Amazon Web Services Japan
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon Web Services Japan
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことAmazon Web Services Japan
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチAmazon Web Services Japan
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer ProfilesAmazon Web Services Japan
 
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
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨Amazon Web Services Japan
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介Amazon Web Services Japan
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介Amazon Web Services Japan
 

Mais de Amazon Web Services Japan (20)

202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
 
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
 
Infrastructure as Code (IaC) 談義 2022
Infrastructure as Code (IaC) 談義 2022Infrastructure as Code (IaC) 談義 2022
Infrastructure as Code (IaC) 談義 2022
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
 
20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDD
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
 

Último

NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NTT DATA Technology & Innovation
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルCRI Japan, Inc.
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptxsn679259
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsWSO2
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Gamesatsushi061452
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...Toru Tamaki
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイスCRI Japan, Inc.
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Hiroshi Tomioka
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video UnderstandingToru Tamaki
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 

Último (12)

NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 

[AWSマイスターシリーズ] AWS SDK for PHP / Ruby / boto(Python) / JavaScript in Node.js

  • 1. re:G ene rate AWS  マイスターシリーズ   AWS  SDK  for  PHP  & AWS  SDK  for  Ruby  & boto(Python)  & JavaScript  in  Node.js 2013.12.20 アマゾン  データ  サービス  ジャパン株式会社 ソリューションアーキテクト 今井  榎並  蒋 © 2012 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. ウェビナー(Webセミナー)へようこそ! !   参加者は、⾃自動的にミュートになっています !   質問を投げることができます! §  GoToWebinarの仕組みを使って、書き込んでください §  ただし環境によっては、⽇日本語の直接⼊入⼒力力ができないので、 お⼿手数ですが、テキストエディタ等に打ち込んでから、 コピペしてください §  最後のQ&Aの時間で、できるだけ回答させて頂きます §  書き込んだ質問は、主催者にしか⾒見見えません !   Twitterのハッシュタグは#jawsugでどうぞ 2 © 2012 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.
  • 3. Webセミナー 週刊AWSマイスターシリーズ  re:Generate! !   AWSマイスターシリーズ §  12⽉月4⽇日 AWS  re:Invent  アップデート振り返り §  12⽉月11⽇日 AWS  SDK  for  Java/.Net §  申し込みサイト §  http://aws.amazon.com/jp/event_̲schedule/ §  過去資料料集 §  http://aws.amazon.com/jp/aws-‐‑‒meister/ 3 © 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.
  • 4. Agenda !   AWS  SDK  概要 !   AWS  SDK  for  PHP ! boto(Python) !   AWS  SDK  for  Ruby !   AWS  SDK  for  JavaScript  in  Node.js !   まとめ 4 © 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.
  • 5. AWS  SDK概要 © 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.
  • 6. AWS  SDKの重要性 !   AWSはプログラマブルなインフラ •  プログラムから扱うためにはSDKが必要 •  ほぼすべてのサービスはマネジメントコンソールから利利⽤用でき るが、⾃自動化しようと思ったらプログラムから扱うのが必須 •  ⾃自動化するとAWSは何倍も便便利利になる !   代表的な⽤用途 •  インフラ構築/運⽤用の⾃自動化 •  EC2やRDSを上げたり下げたり、CloudFormationでスタックをデ プロイしたり •  アプリケーション的なサービスの利利⽤用 •  S3にデータをアップしたり、DynamoDBやSQSにデータ⼊入れたり 出したり © 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.
  • 7. AWS  SDK !   AWSのサービスはHTTP/HTTPSでREST/SOAP形式の APIをサポート。 例例えば •  EC2  :  Start/Stop/Terminate •  S3  :  GetObject/PutObject •  DynamoDB  :  Get/Put !   SDKはこれらのAPIを抽象化し、各⾔言語からの利利⽤用を⾮非 常に簡単にしてくれる Your  code AWS  SDK API 7 EC2 S3 その他サービス © 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.
  • 8. AWS  SDK !   下記の⾔言語/環境で提供中 Java Python JavaScript in  nodeJS PHP JavaScript in  the  Browser .NET iOS Ruby Android © 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.
  • 9. AWS  SDK !   今回は下記についてお話します。 Java Python JavaScript in  Node.js PHP JavaScript in  the  Browser .NET iOS Ruby Android © 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.
  • 10. AWS  SDKの使い⽅方 !   必要な⾔言語のSDKをインストール •  ⾔言語ごとにインストール⽅方法が異異なります。このあとの章で⾔言語ご とに解説します。 !   Credential(AWS  APIの認証情報)を⽤用意する !   ファクトリーメソッドを利利⽤用してサービス(例例えばS3)のクラ イアントオブジェクトを⽣生成 •  このときにCredentialを渡す !   クライアントオブジェクトのメソッドを使ってオペレーショ ン(例例えばPutObject) !   ⾔言語によってはより⾼高度度に抽象化されているSDKもあります。 © 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.
  • 11. Credentialの取り扱い !   Credentialの取り扱いについてはいくつかのやり⽅方があ りますが、IAM  Roleもしくは環境変数を使うのがオス スメです。PHPを例例にそれぞれの実装⽅方法をご案内しま す。 !   コード内に直接埋め込むパターン(コード内に Credentialが⼊入り込んでしまうのでやっちゃダメなパ ターン) <?php $s3client  =  S3Client::factory(array( 'key' => 'your-‐‑‒aws-‐‑‒access-‐‑‒key-‐‑‒id', 'secretʻ‘ => 'your-‐‑‒aws-‐‑‒secret-‐‑‒access-‐‑‒key', ));     © 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.
  • 12. Credentialの取り扱い ! configファイルでCredentialを設定するパターン •  PHPとbotoではこの⽅方法が提供されている •  これもCredentialがファイル化されるので良良くないパターン $  vim  aws-‐‑‒config.php <?php return  array(        'includes'  =>  array('_̲aws'),        'services'  =>  array(                'default_̲settings'  =>  array(                        'params'  =>  array(                                'key'        =>  'your-‐‑‒access-‐‑‒key-‐‑‒id',                                'secret'  =>  'your-‐‑‒secret-‐‑‒access-‐‑‒key',)                )        ) ); $  vim  sample.php <?php $aws  =  Aws::factory(ʻ‘aws-‐‑‒config.php'); $s3client  =  $aws-‐‑‒>get('s3'); © 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.
  • 13. Credentialの取り扱い !   環境変数でCredentialを設定するパターン •  AWS_̲ACCESS_̲KEY_̲ID,  AWS_̲SECRET_̲KEYという環境変数 を実⾏行行ユーザーで設定しておくことによってコードから Credentialを追い出せる $  export  AWS_̲ACCESS_̲KEY_̲ID="your-‐‑‒aws-‐‑‒access-‐‑‒key-‐‑‒id" $  export  AWS_̲SECRET_̲KEY="your-‐‑‒aws-‐‑‒secret-‐‑‒access-‐‑‒key” $vim  sample.php <?php $s3client  =  S3Client::factory();     © 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.
  • 14. Credentialの取り扱い !   IAM  RoleでCredentialを設定するパターン •  コードが動くのがEC2上であれば、IAM  Roleを使うことによっ て、EC2⾃自体にAWS  APIへのアクセス権限を付与できる。よっ てコードや環境変数にCredentialを持たせずに済む。 例例えばS3フルアクセスの権限を持った IAM  Roleを作成して・・・ EC2にそのRoleを 割り当てると・・・ © 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.
  • 15. Credentialの取り扱い !   IAM  RoleでCredentialを設定するパターン •  前のページのようにS3アクセス権限を持ったRoleをEC2に割り 当てると、下記を書くだけで利利⽤用可能。 $vim  sample.php <?php $s3client  =  S3Client::factory();     •  これは、SDKが内部でSTS(Security  Token  Service)を利利⽤用し ており、AccessKey,SecretAccessKey,Tokenを⾃自動的に © 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.
  • 16. AWS  SDK  for  PHP © 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.
  • 17. AWS  SDK  for  PHP ! ! ! ! ! !   Amazon提供のAWS開発⽤用のPHP向けSDK   現在は、Version2 http://aws.amazon.com/jp/sdkforphp/   環境:PHP5.3.3以降降   Guzzle  HTTP  Client  framework上で構築されている   依存Extension •  cURL © 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.
  • 18. 操作可能サービス Direct Connect Elasticache IAM EC2 SimpleDB OpsWorks ELB S3 Elastic Transcoder Auto Scaling Glacier SQS EMR CloudFront SNS Route53 Storage Gateway SES VPC Import/Export SWF DynamoDB Elastic Beanstalk CloudSearch RDS Cloud Formation Redshift Cloud Watch © 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.
  • 19. 利利⽤用⽅方法 !   Composerによるインストール(推奨) •  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/ installation.html#installing-‐‑‒via-‐‑‒composer !   Pharよるインストール •  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/ installation.html#installing-‐‑‒via-‐‑‒phar !   Zipファイルからインストール •  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/ installation.html#installing-‐‑‒via-‐‑‒zip !   PEARによるインストール •  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/guide/latest/ installation.html#installing-‐‑‒via-‐‑‒pear © 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.
  • 20. 初期設定 !   インストール⽅方法により以下のとおり異異なります インストール方法 インクルード Composer require '/path/to/vendor/autoload.php'; Phar require '/path/to/aws.phar'; Zip require '/path/to/aws-autoloader.php'; PEAR 'AWSSDKforPHP/aws.phar'; !   コンフィグレーションファイルの設定 •  クレデンシャル情報などを設定可能 •  factory()の引数として指定することも可能 •  ʻ‘src/Aws/Common/Resources/aws-‐‑‒config.phpʼ’  を参考に追加 © 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.
  • 21. サンプル:S3  -‐‑‒  putObject API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒ Aws.S3.S3Client.html#_̲putObject <?php require  '/path/to/vendor/autoload.php'; use  AwsCommonAws; use  AwsS3ExceptionS3Exception; try  {        $client  =  S3Client::factory; ①        $bucket  =  ʼ’your_̲bucket';        $file  =  'test.txt';        $result  =  $client-‐‑‒>putObject(array( 'Bucket'  =>  $bucket, 'Key'  =>  $file, 'Body'  =>  fopen($file,  'r'),        ));        //  結果表⽰示        var_̲dump($result); }  catch  (S3Exception  $e)  {        echo  '***  Error  ***'  .  "n";        echo  $e-‐‑‒>getMessage(); } ①  S3クライアント作成 ②  putObject実⾏行行 ②   Bucketを指定、Keyは、ファ イル名、Bodyにアップロードす るファイルストリームを指定 (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 22. サンプル:S3  -‐‑‒  getObject API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒ Aws.S3.S3Client.html#_̲getObject <?php require  '/path/to/vendor/autoload.php'; use  AwsCommonAws; use  AwsS3ExceptionS3Exception; try  {        $client  =  S3Client::factory; ①        $bucket  =  ʼ’your_̲bucket';        $file  =  'test.txt';        $result  =  $client-‐‑‒>getObject(array( 'Bucket'  =>  $bucket, 'Key'  =>  $file, ));        //  結果表⽰示        echo  $result['Body']; ③ }  catch  (S3Exception  $e)  {        echo  '***  Error  ***'  .  "n";        echo  $e-‐‑‒>getMessage(); } ①  S3クライアント作成 ②  getObject実⾏行行 ②   Bucketを指定、Keyは、ファイル 名 ③  取得したコンテンツを表⽰示 (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 23. サンプル:SQS  -‐‑‒  sendMessage API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒ Aws.Sqs.SqsClient.html#_̲sendMessage <?php require  '/path/to/vendor/autoload.php'; use  AwsCommonAws; use  AwsSqsExceptionSqsException; try  {        $client  =  SqsClient::factory;         ①        $queueUrl  =  'https://YourQueue';        $result  =  $client-‐‑‒>sendMessage(array( ② 'QueueUrl'  =>  $queueUrl, 'MessageBody'  =>  'Send  Message!',        ));        //  結果表⽰示        var_̲dump($result); }  catch  (SqsException  $e)  {        echo  '***  Error  ***'  .  "n";        echo  $e-‐‑‒>getMessage(); } ①  SQSクライアント作成 ②  sendMessage実⾏行行   QueueURLを指定、送りたい メッセージを指定 (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 24. サンプル:SQS  -‐‑‒  receiveMessage API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒ Aws.Sqs.SqsClient.html#_̲receiveMessage <?php require  '/path/to/vendor/autoload.php'; use  AwsCommonAws; use  AwsSqsExceptionSqsException; ①  コンフィグを指定してインスタン ス作成 ②  SQSクライアント作成 try  {        $client  =  SqsClient::factory; ① ③  receiveMessage実⾏行行        $queueUrl  =  'https://YourQueue';        $result  =  $client-‐‑‒>receiveMessage(array( ②   QueueURLを指定 'QueueUrl'  =>  $queueUrl,        ));        //  結果表⽰示        var_̲dump($result); }  catch  (SqsException  $e)  {        echo  '***  Error  ***'  .  "n";        echo  $e-‐‑‒>getMessage(); } (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 25. サンプル:DynamoDB  -‐‑‒  putItem API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒ Aws.DynamoDb.DynamoDbClient.html#_̲putItem <?php require  '/path/to/vendor/autoload.php'; use  AwsCommonAws; use  AwsDynamoDbExceptionDynamoDbException; try  {        $client  =  DynamoDbClient::factory; ①        $result  =  $client-‐‑‒>putItem(array(                'TableName'  =>  ʼ’table_̲name',                'Item'  =>  $client-‐‑‒>formatAttributes(array(                        ʼ’id'                =>  100,                        'timestamp'  =>  130699342,                        'message'            =>  'Good  Morning.',                )),        ));                //  結果表⽰示        var_̲dump($result); }  catch  (DynamoDbException  $e)  {        echo  '***  Error  ***'  .  "n";        echo  $e-‐‑‒>getMessage(); } ①  DynamoDBクライアント作 成 ② ②  putItem実⾏行行 -‐‑‒  TableName:  テーブル名 -‐‑‒  Item:  Putするアイテムを 指定 (例例)    id  :  Hash  Key    timestamp  :  Range  Key    message  :  Attribute (*)  事前にTableが作成されて いる必要があります。 © 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.
  • 26. サンプル:DynamoDB  -‐‑‒  getItem API仕様:  http://docs.aws.amazon.com/aws-‐‑‒sdk-‐‑‒php/latest/class-‐‑‒Aws.DynamoDb.DynamoDbClient.html#_̲getItem <?php require  '/path/to/vendor/autoload.php'; use  AwsCommonAws; use  AwsDynamoDbExceptionDynamoDbException; try  {        $client  =  DynamoDbClient::factory; ①        $result  =  $client-‐‑‒>getItem(array( ②                'ConsistentRead'  =>  true,                'TableName'  =>  'table_̲name',                'Key'  =>  array( ʼ’id'  =>  array('N'  =>  '100'), 'timestamp'  =>  array('N'  =>  '130699342') )        ));        //  結果表⽰示        var_̲dump($result); }  catch  (DynamoDbException  $e)  {        echo  '***  Error  ***'  .  "n";        echo  $e-‐‑‒>getMessage(); } ①  DynamoDBクライアント作 成 ②  getItem実⾏行行 -‐‑‒  TableName:  テーブル名 -‐‑‒  Key:GetするアイテムのKey を指定 (例例)    id  :  Hash  Key    timestamp  :  Range  Key (*)  事前にTableが作成されてい る必要があります。 © 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.
  • 27. 活⽤用法 !   PHPアプリのバックエンドストレージ呼び出し •  DynamoDB,SQS,S3を簡単に呼び出し可能 !   PHPベースのアプリケーションの拡張 •  WordpressやEC-‐‑‒CubeなどのPHPベースのアプリケーションと AWSの連携 !   独⾃自の管理理⽤用Webインターフェースの作成 •  定型作業を簡略略化したり、管理理を容易易にするための独⾃自Webイ ンターフェースの作成 © 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.
  • 28. PHP版SDKの便便利利なクラス ! DynamoDBSessionHandler ! DynamoDBを使った、HTTPのセッション共有が可能 EC2 ELB EC2 EC2 DynamoDB 速い 消えない 管理不要 © 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.
  • 29. DynamoDBSessionHandlerの利利⽤用 <?php require  '/home/ec2-‐‑‒user/vendor/autoload.php'; use  AwsCommonAws; use  AwsDynamoDbExceptionDynamoDbException; use  AwsDynamoDbDynamoDbClient; use  AwsDynamoDbSessionSessionHandler; $aws  =  Aws::factory(ʼ’aws-‐‑‒config.php'); $client  =  $aws-‐‑‒>get('dynamodb'); try  {        $sessionHandler  =  SessionHandler::factory(array(                'dynamodb_̲client'  =>  $client,                'table_̲name'            =>  'sessions',        ));        $sessionHandler-‐‑‒>register(); }  catch  (DynamoDbException  $e)  {        echo  '***  Error  ***'  .  "n";        echo  $e-‐‑‒>getMessage(); } session_̲start(); //セッションにデータ登録 $_̲SESSION['username']  =  'jeremy'; $_̲SESSION['role']  =  'admin'; session_̲commit(); © 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.
  • 30. boto(Python) © 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.
  • 31. botoとは !   Python⽤用のAWS  SDKのデファクトスタンダード !   最新版は2.19.0  (2013年年12⽉月現在) !   Python  2.6.6,  2.7.3  on  Mac  OSX  and  Ubuntu  Maverick   で動作確認している。 !   Python  2.5での互換性もなるべく考慮しているが保証外 !   Python  3.x版はDeveloper  Preview中 © 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.
  • 32. 操作可能サービス Direct Connect Elasticache IAM EC2 SimpleDB OpsWorks ELB S3 Elastic Transcoder Auto Scaling Glacier SQS EMR CloudFront SNS Route53 Storage Gateway SES VPC Import/Export SWF DynamoDB Elastic Beanstalk CloudSearch RDS Cloud Formation Data Pipeline Redshift Cloud Watch CloudTrail FPS EBS © 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.
  • 33. botoに関するリソース !   ソースコードリポジトリ •  https://github.com/boto/boto ! PyPI •  http://pypi.python.org/pypi/boto !   オンラインドキュメント •  http://docs.pythonboto.org/ !   IRC •  http://webchat.freenode.net/?channels=boto ©  2012  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   © 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. Amazon.com,  Inc.
  • 34. インストール  $  pip  install  boto ©  2012  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   © 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. Amazon.com,  Inc.
  • 35. 初期設定 !   設定ファイルの作成 !   /etc/boto.cfg  -‐‑‒  グローバルな設定を記述 !   ~∼/.boto  ユーザー毎の設定を記述 [Boto] debug  =  0 num_̲retries  =  10 [DynamoDB] region  =  ap-‐‑‒northeast-‐‑‒1 ©  2012  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   © 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. Amazon.com,  Inc.
  • 36. サンプル:S3  –  set_̲contents_̲from_̲string >>>  from  boto.s3.connection  import  S3Connection >>>  conn  =  S3Connection() >>>  bucket_̲name  =  ”yourBucket" >>>  bucket  =    conn.get_̲bucket(bucket_̲name) >>>  from  boto.s3.key  import  Key >>>  k  =  Key(bucket) >>>  k.key  =  "test.txt" >>>  k.set_̲contents_̲from_̲string("Hello  World!") (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 37. サンプル:S3  –  get_̲contents_̲as_̲string >>>  from  boto.s3.connection  import  S3Connection >>>  conn  =  S3Connection() >>>  bucket_̲name  =  "yourBucket" >>>  bucket  =    conn.get_̲bucket(bucket_̲name) >>>  from  boto.s3.key  import  Key >>>  k  =  Key(bucket) >>>  k.key  =  "test.txt" >>>  k.get_̲contents_̲as_̲string() (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 38. サンプル:SQS  –  write >>>  import  boto.sqs >>>  conn  =  boto.sqs.connect_̲to_̲region("ap-‐‑‒northeast-‐‑‒1") >>>  q  =  conn.get_̲queue('YourQueue') >>>  from  boto.sqs.message  import  Message >>>  m  =  Message() >>>  m.set_̲body('Hello  World!!') >>>  q.write(m) (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 39. サンプル:SQS  –  get_̲messages >>>  import  boto.sqs >>>  conn  =  boto.sqs.connect_̲to_̲region("ap-‐‑‒northeast-‐‑‒1") >>>  q  =  conn.get_̲queue('YourQueue') >>>  rs  =  q.get_̲messages() >>>  m  =  rs[0] >>>  m.get_̲body() 'Hello  World!!' (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 40. サンプル:DynamoDB  –  putItem >>>  from  boto.dynamodb2.items  import  Item >>>  from  boto.dynamodb2.table  import  Table >>>  table  =  Table('table_̲name') >>>  item  =  Item(table  ,  data={ ...  ʼ’id':  100, ...  'timestamp':  130699342, ...  'message'  :  'Good  Morning.', ...  }) >>>  item.save() True (*)  事前にTableが作成されてい る必要があります。 © 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.
  • 41. サンプル:DynamoDB  –  getItem >>>  from  boto.dynamodb2.table  import  Table >>>  table=  Table('table_̲name') >>>  item  =  table.get_̲item(id=100,timestamp=130699342) >>>  print  item['message'] Good  Morning. (*)  事前にTableが作成されてい る必要があります。 © 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.
  • 42. その他Tips !   AWSコマンドラインインタフェース(CLI)もbotoを⼀一部 利利⽤用している © 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.
  • 43. AWS  SDK  for  Ruby © 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.
  • 44. AWS  SDK  for  Rubyとは !   Amazon提供のAWS開発⽤用のRuby向けSDK !   現在のバージョン •  Version  1  (stable) •  Version  2  (developer  preview) ! http://aws.amazon.com/sdkforruby/   !   環境:Ruby  1.8.7  以降降 © 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.
  • 45. 操作可能サービス Direct Connect Elasticache IAM EC2 SimpleDB OpsWorks ELB S3 Elastic Transcoder Auto Scaling Glacier SQS EMR CloudFront SNS Route53 Storage Gateway SES VPC Import/Export SWF DynamoDB Elastic Beanstalk CloudSearch RDS Cloud Formation Data Pipeline Redshift Cloud Watch © 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.
  • 46. 利利⽤用⽅方法 !   Ruby環境のセットアップ •  Rbenvを利利⽤用する •  https://github.com/sstephenson/rbenv   •  RVMを利利⽤用する •  https://rvm.io/   ! aws-‐‑‒sdk  gemをインストール $  gem  install  aws-‐‑‒sdk © 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.
  • 47. 設定の初期化 !   デフォルトのリージョンをセッティング require  'awsʼ’ AWS.config({ :region  =>  ʻ‘YOUR_̲DEFAULT_̲REGIONʼ’ }) © 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.
  • 48. サンプル:S3  -‐‑‒  write API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#write-‐‑‒ instance_̲method #!/usr/bin/env  ruby require  'aws' AWS.config({    :access_̲key_̲id  =>   ENV['AWS_̲ACCESS_̲KEY_̲ID'],    :secret_̲access_̲key  =>   ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],    :region  =>  ENV['AWS_̲REGION'] }) ①  コンフィグを指定 ① ②  S3クライアント作成し、 bucketやkeyを指定 ③  putするfile名を指定し、s3に put ② s3  =  AWS::S3.new bucket  =  s3.buckets['your-‐‑‒bucket'] obj  =  bucket.objects['key'] obj.write(Pathname.new('/path/to/file.txt')) ③ (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 49. サンプル:S3  -‐‑‒  read API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#read-‐‑‒ instance_̲method #!/usr/bin/env  ruby require  'aws' ①  コンフィグを指定 AWS.config({    :access_̲key_̲id  =>   ENV['AWS_̲ACCESS_̲KEY_̲ID'],    :secret_̲access_̲key  =>   ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],    :region  =>  ENV['AWS_̲REGION'] }) ① s3  =  AWS::S3.new bucket  =  s3.buckets['your-‐‑‒bucket'] obj  =  bucket.objects['key'] ② obj.read  do  |chunk|    puts  chunk    #=>  data  of  s3://your-‐‑‒bucket/key end ③ ②  S3クライアント作成し、 bucketやkeyを指定 ③  s3にあるobjectのデータを取 得 (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 50. サンプル:SQS  –  send_̲message API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/SQS/ Client.html#send_̲message-‐‑‒instance_̲method #!/usr/bin/env  ruby require  'aws' require  'pp' ①  コンフィグを指定 AWS.config({    :access_̲key_̲id  =>   ENV['AWS_̲ACCESS_̲KEY_̲ID'],    :secret_̲access_̲key  =>   ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],    :region  =>  ENV['AWS_̲REGION'] }) ① sqs  =  AWS::SQS.new ② queue_̲url  =  'https://your_̲queue' result  =  sqs.client.send_̲message({    :queue_̲url        =>  queue_̲url,    :message_̲body  =>  'Send  Message!' }) pp  result ②  SQSクライアント作成 ③ ③  send_̲message実⾏行行   queue_̲urlを指定、送りたい メッセージを指定 (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 51. サンプル:SQS  –  receive_̲message API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/SQS/ Client.html#receive_̲message-‐‑‒instance_̲method #!/usr/bin/env  ruby require  'aws' require  'pp' ①  コンフィグを指定 AWS.config({    :access_̲key_̲id  =>   ENV['AWS_̲ACCESS_̲KEY_̲ID'],    :secret_̲access_̲key  =>   ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],    :region  =>  ENV['AWS_̲REGION'] }) ① sqs  =  AWS::SQS.new ② queue_̲url  =  'https://your_̲queue' result  =  sqs.client.receive_̲message({    :queue_̲url        =>  queue_̲url }) pp  result ②  SQSクライアント作成 ③ ③  receive_̲message実⾏行行   queue_̲urlを指定 (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 52. サンプル:DynamoDB  –  put_̲item API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/DynamoDB/Client.html#put_̲item-‐‑‒ instance_̲method #!/usr/bin/env  ruby require  'aws' require  'pp' ①  コンフィグを指定 AWS.config({ ①    :access_̲key_̲id  =>  ENV['AWS_̲ACCESS_̲KEY_̲ID'],    :secret_̲access_̲key  =>  ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],    :region  =>  ENV['AWS_̲REGION'] }) client  =  AWS::DynamoDB::Client.new result  =  client.put_̲item({    :table_̲name  =>  'table_̲nameʼ’,    :item  =>  {        'id'                              =>  {:n  =>  '100'},        'timestamp'  =>  {:n  =>  '130699342'},        'message'        =>  {:s  =>  'Good  Morning'}    } }) pp  result #=>  {"ConsumedCapacityUnits"=>1.0} ② ③ ②  DynamoDBクライアント作成 ③  put_̲item実⾏行行 -‐‑‒  :table_̲name:  テーブル名 -‐‑‒  :item:  Putするアイテムを指 定 (例例)    id  :  Hash  Key    timestamp  :  Range  Key    message  :  Attribute (*)  事前にTableが作成されてい る必要があります。 © 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.
  • 53. サンプル:DynamoDB  –  get_̲item API仕様:  http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/DynamoDB/Client.html#get_̲item-‐‑‒ instance_̲method #!/usr/bin/env  ruby require  'aws' require  'pp' ①  コンフィグを指定 AWS.config({ ①    :access_̲key_̲id  =>  ENV['AWS_̲ACCESS_̲KEY_̲ID'],    :secret_̲access_̲key  =>  ENV['AWS_̲SECRET_̲ACCESS_̲KEY'],    :region  =>  ENV['AWS_̲REGION'] }) client  =  AWS::DynamoDB::Client.new result  =  client.get_̲item({    :consistent_̲read  =>  true,    :table_̲name  =>  'table_̲name',    :key  =>  {        :hash_̲key_̲element  =>  {:n  =>  '100'},        :range_̲key_̲element  =>  {:n  =>  '130699342'}    } }) pp  result #=>  {"Item"=>{"id"=>{"N"=>"100"},   "message"=>{"S"=>"Good  Morning"},   "timestamp"=>{"N"=>"130699342"}},   "ConsumedCapacityUnits"=>1.0} ② ③ ②  DynamoDBクライアント 作成 ③  get_̲item実⾏行行 -‐‑‒  :table_̲name  テーブル名 -‐‑‒  :consistent_̲read  ⼀一貫性 -‐‑‒  :key  GutするKeyを指定 (例例)    id  :  Hash  Key    timestamp  :  Range  Key (*)  事前にTableが作成され ている必要があります。 © 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.
  • 54. その他Tips !   新しいRuby  SDK  (version  2) •  •  •  •  Developer  Preview バリデーション、ドキュメント、拡張性など改善 プラグイン⽅方式をとっている Ruby  1.9以降降が必須 !   以下のように利利⽤用可能 $  gem  install  aws-‐‑‒sdk-‐‑‒core AWS::DynamoDB.new(api_̲version:  ʻ‘2012-‐‑‒08-‐‑‒10ʼ’) Re:Inventで発表された新Ruby  SDKのスライドはおすすめ © 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.
  • 55. その他Tips !   RailsのセッションをDynamoDBに保存 •  スケーラブルかつ耐障害に優れたセッションストア •  Rails  3.x  か  4.x  から利利⽤用可能 •  Rackベースのアプリも利利⽤用可能 !   以下の⼿手順で利利⽤用可能 gem  ʻ‘aws-‐‑‒sessionstore-‐‑‒dynamodbʼ’ $  bundle  install 参考:https://github.com/aws/aws-‐‑‒sessionstore-‐‑‒dynamodb-‐‑‒ruby   © 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.
  • 56. AWS  SDK  for  JavaScript in  Node.js © 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.
  • 57. AWS  SDK  for  JavaScript  in  Node.jsとは !   Amazon提供のAWS開発⽤用のnode.js環境で動くJavaScript 向けSDK •  http://aws.amazon.com/sdkfornodejs/ © 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.
  • 58. 操作可能サービス Direct Connect Elasticache IAM EC2 SimpleDB OpsWorks ELB S3 Elastic Transcoder Auto Scaling Glacier SQS EMR CloudFront SNS Route53 Storage Gateway SES VPC Import/Export SWF DynamoDB Elastic Beanstalk CloudSearch RDS Cloud Formation Data Pipeline Redshift Cloud Watch © 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.
  • 59. 利利⽤用⽅方法 ! Node.js環境のセットアップ •  OSのパッケージマネージャーでnpmをインストール •  Mac  の場合: $  brew  install  npm ! aws-‐‑‒sdk  packageをインストール $  npm  install  aws-‐‑‒sdk © 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.
  • 60. サンプル:S3  -‐‑‒  putObject var  AWS  =  require('aws-‐‑‒sdk'); var  fs  =  require('fs'); var  s3  =  new  AWS.S3(); ① var  bodyStream  =  fs.createReadStream(  '/path/ ② to/file.txt'  ); var  params  =  {    Bucket:  'your-‐‑‒bucket',    Key:  'key',    Body:  bodyStream }; s3.putObject(params,  function(err,  data)  {    if  (err)        console.log(err);    else        console.log("Successfully  uploaded."); }); ①  S3クライアント作成 ②  put時の引数 •  Bucket:  s3  bucket •  Key:  s3  key •  Body:  実際のデータ ③ ③  S3へPUT (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 61. サンプル:S3  -‐‑‒  getObject var  AWS  =  require('aws-‐‑‒sdk'); var  fs  =  require('fs'); var  s3  =  new  AWS.S3(); ① var  params  =  {    Bucket:  ʼ’your-‐‑‒bucket',    Key:  ʼ’key' }; ② s3.getObject(params,  function(err,  data)  {    if  (err)        console.log(err);    else        console.log(data.Body.toString()); }); ③ ①  S3クライアント作成 ②  gut時の引数 •  Bucket:  s3  bucket •  Key:  s3  key ③  S3からデータ取得 (*)  事前にBucketが作成されて いる必要があります。 © 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.
  • 62. サンプル:SQS  -‐‑‒  sendMessage var  AWS  =  require('aws-‐‑‒sdk'); var  fs  =  require('fs'); var  s3  =  new  AWS.SQS(); ① var  params  =  { ②    QueueUrl:  'https://your_̲queue',    MessageBody:  'Send  Message!' } sqs.sendMessage(params,  function(err,  data)  {    if  (err)        console.log(err);    else        console.log("Successfully  sent."); }) ①  SQSクライアント作成 ②  queue_̲urlを指定、送りたい メッセージを指定 ③  sendMessage実⾏行行 (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 63. サンプル:SQS  -‐‑‒  receiveMessage var  AWS  =  require('aws-‐‑‒sdk'); var  fs  =  require('fs'); var  s3  =  new  AWS.SQS(); ① ①  SQSクライアント作成 var  params  =  { ② ②  queue_̲urlを指定    QueueUrl:  'https://your_̲queueʼ’ } sqs.receiveMessage(params,  function(err,  data)   ③  receiveMessage実⾏行行 { ③       if  (err)        console.log(err);    else        console.log(data); }) (*)  事前にQueueが作成されて いる必要があります。 © 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.
  • 64. サンプル:DynamoDB  –  putItem var  AWS  =  require('aws-‐‑‒sdk'); var  fs  =  require('fs'); var  ddb  =  new  AWS.DynamoDB(); ① var  params  =  {    TableName:  'my_̲table',    Item:  {        'id':  {N:  ʻ‘100'},        'timestamp':  {N:  '130699342'},        'message':  {S:  'Good  Morning'}    } }; ② ddb.putItem(params,  function(err,  data)  {    if  (err)        console.log(err);    else        console.log(data); }); ③ ①  DynamoDBクライアント 作成 ②  パラメータ指定 -‐‑‒  :TableName:  テーブル名 -‐‑‒  :Item:  Putするアイテムを指 定 (例例)    id  :  Hash  Key    timestamp  :  Range  Key    message  :  Attribute ③  Put実⾏行行 (*)  事前にTableが作成され ている必要があります。 © 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.
  • 65. サンプル:DynamoDB  –  getItem var  AWS  =  require('aws-‐‑‒sdk'); var  fs  =  require('fs'); var  ddb  =  new  AWS.DynamoDB(); ① var  params  =  {    TableName:  'my_̲table',    Key:  {        'id':  {N:  ʻ‘100'},        'timestamp':  {N:  '130699342'}    } }; ② ddb.getItem(params,  function(err,  data)  {    if  (err)        console.log(err);    else        console.log(data); }); ③ ①  DynamoDBクライアント作 成 ②  パラメータ指定 -‐‑‒  :TableName:  テーブル名 -‐‑‒  :Item:  Putするアイテムを 指定 (例例)    id  :  Hash  Key    timestamp  :  Range  Key    message  :  Attribute ③  Get実⾏行行 (*)  事前にTableが作成されてい る必要があります。 © 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.
  • 66. まとめ © 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.
  • 67. 今回のまとめ !   AWSはプログラマブルなインフラ •  ほぼすべてのサービスはマネジメントコンソールから利利⽤用でき るが、⾃自動化しようと思ったらプログラムから扱うのが必須 •  ⾃自動化するとAWSは何倍も便便利利になる !   AWSのサービスはHTTP/HTTPSでREST/SOAP形式の APIをサポート。 例例えば •  EC2  :  Start/Stop/Terminate •  S3  :  GetObject/PutObject •  DynamoDB  :  Get/Put !   SDKはこれらのAPIを抽象化し、各⾔言語からの利利⽤用を⾮非 常に簡単にしてくれる © 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.
  • 68. Q&A 68 © 2012 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.