Submit Search
[AWSマイスターシリーズ] AWS Client Side SDK -Android,iOS & JavaScript-
10 likes
9,579 views
Amazon Web Services Japan
1 of 76
Download now
Downloaded 54 times
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
More Related Content
PDF
[AWSマイスターシリーズ] AWS SDK for PHP / Ruby / boto(Python) / JavaScript in Node.js
Amazon Web Services Japan
PDF
20190122 AWS Black Belt Online Seminar Amazon Redshift Update
Amazon Web Services Japan
PDF
20201118 AWS Black Belt Online Seminar 形で考えるサーバーレス設計 サーバーレスユースケースパターン解説
Amazon Web Services Japan
PDF
[AWS初心者向けWebinar] 利用者が実施するAWS上でのセキュリティ対策
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2017 AWS OpsWorks
Amazon Web Services Japan
PDF
AWS Well-Architected Security とベストプラクティス
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2017 AWS体験ハンズオン~Deploy with EB CLI編~
Amazon Web Services Japan
PDF
20191120 AWS Black Belt Online Seminar Amazon Managed Streaming for Apache Ka...
Amazon Web Services Japan
[AWSマイスターシリーズ] AWS SDK for PHP / Ruby / boto(Python) / JavaScript in Node.js
Amazon Web Services Japan
20190122 AWS Black Belt Online Seminar Amazon Redshift Update
Amazon Web Services Japan
20201118 AWS Black Belt Online Seminar 形で考えるサーバーレス設計 サーバーレスユースケースパターン解説
Amazon Web Services Japan
[AWS初心者向けWebinar] 利用者が実施するAWS上でのセキュリティ対策
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 AWS OpsWorks
Amazon Web Services Japan
AWS Well-Architected Security とベストプラクティス
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 AWS体験ハンズオン~Deploy with EB CLI編~
Amazon Web Services Japan
20191120 AWS Black Belt Online Seminar Amazon Managed Streaming for Apache Ka...
Amazon Web Services Japan
What's hot
(20)
PDF
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2017 Amazon Connect
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2017 Amazon Kinesis
Amazon Web Services Japan
PDF
20190320 AWS Black Belt Online Seminar Amazon EBS
Amazon Web Services Japan
PDF
20190911 AWS Black Belt Online Seminar AWS Batch
Amazon Web Services Japan
PDF
20191127 AWS Black Belt Online Seminar Amazon CloudWatch Container Insights で...
Amazon Web Services Japan
PDF
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
PPTX
いまさら、AWSのネットワーク設計
Serverworks Co.,Ltd.
PDF
[AWSマイスターシリーズ]Amazon CloudWatch & Auto Scaling
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
Amazon Web Services Japan
PDF
AWS 技術者向け Azure サービス解説 de:code2019版 #CD81
Minoru Naito
PDF
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
Amazon Web Services Korea
PDF
20190919 よくご相談いただくセキュリティの質問と考え方
Amazon Web Services Japan
PDF
20210126 AWS Black Belt Online Seminar AWS CodeDeploy
Amazon Web Services Japan
PDF
AWS 初心者向けWebinar Amazon Web Services料金の見積り方法 -料金計算の考え方・見積り方法・お支払方法-
Amazon Web Services Japan
PDF
AWS Black Belt Techシリーズ Amazon Kinesis
Amazon Web Services Japan
PDF
20210526 AWS Expert Online マルチアカウント管理の基本
Amazon Web Services Japan
PDF
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
PDF
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
Amazon Web Services Japan
PDF
20191023 AWS Black Belt Online Seminar Amazon EMR
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 Amazon Connect
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 Amazon Kinesis
Amazon Web Services Japan
20190320 AWS Black Belt Online Seminar Amazon EBS
Amazon Web Services Japan
20190911 AWS Black Belt Online Seminar AWS Batch
Amazon Web Services Japan
20191127 AWS Black Belt Online Seminar Amazon CloudWatch Container Insights で...
Amazon Web Services Japan
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
いまさら、AWSのネットワーク設計
Serverworks Co.,Ltd.
[AWSマイスターシリーズ]Amazon CloudWatch & Auto Scaling
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
Amazon Web Services Japan
AWS 技術者向け Azure サービス解説 de:code2019版 #CD81
Minoru Naito
데브옵스 엔지니어를 위한 신규 운영 서비스 - 김필중, AWS 개발 전문 솔루션즈 아키텍트 / 김현민, 메가존클라우드 솔루션즈 아키텍트 :...
Amazon Web Services Korea
20190919 よくご相談いただくセキュリティの質問と考え方
Amazon Web Services Japan
20210126 AWS Black Belt Online Seminar AWS CodeDeploy
Amazon Web Services Japan
AWS 初心者向けWebinar Amazon Web Services料金の見積り方法 -料金計算の考え方・見積り方法・お支払方法-
Amazon Web Services Japan
AWS Black Belt Techシリーズ Amazon Kinesis
Amazon Web Services Japan
20210526 AWS Expert Online マルチアカウント管理の基本
Amazon Web Services Japan
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
Amazon Web Services Japan
20191023 AWS Black Belt Online Seminar Amazon EMR
Amazon Web Services Japan
Ad
Viewers also liked
(20)
PDF
AWS Black Belt Techシリーズ Amazon Cognito / Amazon Mobile Analytics
Amazon Web Services Japan
PDF
AWS Mobile SDK利用時のテスト手法
yuki0211s
PDF
Atomic designで助かった人たち
Iida Yukako
PPTX
React を導入したフロントエンド開発
daisuke-a-matsui
PDF
SDK不要で高パフォーマンス!AppLovinのネイティブ広告_20160427
Tatsuo Sakamoto
PDF
Atomic Design powered by React @ AbemaTV
Yusuke Goto
PDF
Provisioning & Deploy on AWS
Amazon Web Services Japan
PDF
[AWSマイスターシリーズ] AWS SDK for Java / .NET
Amazon Web Services Japan
PDF
AWS 初心者向けWebinar AWS上にWebサーバシステムを作ってみましょう~まずは仮想サーバーから[演習つき]
Amazon Web Services Japan
PDF
AWS Black Belt Techシリーズ Amazon AppStream
Amazon Web Services Japan
PDF
AWS初心者向けWebinar .NET開発者のためのAWS超入門
Amazon Web Services Japan
PDF
SAP on AWS 実際の導入例と導入効果
Amazon Web Services Japan
PDF
Blackbelt Online Serminar Parse.comからAWSへのモバイルアプリの移行
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 10 Years of AWS
Amazon Web Services Japan
PDF
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
Amazon Web Services Japan
PDF
初心者向けWebinar AWSでDRを構築しよう
Amazon Web Services Japan
PDF
WS Black Belt Online Seminar 2016 RDBのAWSへの移行
Amazon Web Services Japan
PDF
AWS Black Belt Techシリーズ AWS re:Invent 2014 最新情報のアップデート
Amazon Web Services Japan
PDF
20120625 aws meister-reloaded-sg-vmie-public
Amazon Web Services Japan
PDF
[AWSマイスターシリーズ] AWS Billingについて
Amazon Web Services Japan
AWS Black Belt Techシリーズ Amazon Cognito / Amazon Mobile Analytics
Amazon Web Services Japan
AWS Mobile SDK利用時のテスト手法
yuki0211s
Atomic designで助かった人たち
Iida Yukako
React を導入したフロントエンド開発
daisuke-a-matsui
SDK不要で高パフォーマンス!AppLovinのネイティブ広告_20160427
Tatsuo Sakamoto
Atomic Design powered by React @ AbemaTV
Yusuke Goto
Provisioning & Deploy on AWS
Amazon Web Services Japan
[AWSマイスターシリーズ] AWS SDK for Java / .NET
Amazon Web Services Japan
AWS 初心者向けWebinar AWS上にWebサーバシステムを作ってみましょう~まずは仮想サーバーから[演習つき]
Amazon Web Services Japan
AWS Black Belt Techシリーズ Amazon AppStream
Amazon Web Services Japan
AWS初心者向けWebinar .NET開発者のためのAWS超入門
Amazon Web Services Japan
SAP on AWS 実際の導入例と導入効果
Amazon Web Services Japan
Blackbelt Online Serminar Parse.comからAWSへのモバイルアプリの移行
Amazon Web Services Japan
AWS Black Belt Online Seminar 10 Years of AWS
Amazon Web Services Japan
AWS Black Belt Tech シリーズ 2015 AWS CLI & AWS Tools for Windows Powershell
Amazon Web Services Japan
初心者向けWebinar AWSでDRを構築しよう
Amazon Web Services Japan
WS Black Belt Online Seminar 2016 RDBのAWSへの移行
Amazon Web Services Japan
AWS Black Belt Techシリーズ AWS re:Invent 2014 最新情報のアップデート
Amazon Web Services Japan
20120625 aws meister-reloaded-sg-vmie-public
Amazon Web Services Japan
[AWSマイスターシリーズ] AWS Billingについて
Amazon Web Services Japan
Ad
Similar to [AWSマイスターシリーズ] AWS Client Side SDK -Android,iOS & JavaScript-
(20)
PDF
AWS SDK for Android and iOS
Amazon Web Services Japan
PDF
AWSマイスターシリーズReloaded -AWS SDK for .NET-
Amazon Web Services Japan
PDF
AWS Black Belt Techシリーズ AWS SDK
Amazon Web Services Japan
PDF
20200630 AWS Black Belt Online Seminar Amazon Cognito
Amazon Web Services Japan
PDF
Gaming cicd-pipeline gaming-technight-2
Amazon Web Services Japan
PDF
AWS re:Invent 2019 Recap IoT アップデート
Amazon Web Services Japan
PDF
GoodBye AD FS - Azure Active Directory Only の認証方式へ切り替えよう!
Yusuke Kodama
PDF
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例
Amazon Web Services Japan
PDF
[AWSマイスターシリーズ] AWS Elastic Beanstalk
Amazon Web Services Japan
PDF
[AWSマイスターシリーズ] Amazon Virtual Private Cloud (VPC)
Amazon Web Services Japan
PDF
20151030 オープンデータとセキュリティon aws
takaoka susumu
PPTX
いまさら聞けない Amazon EC2
Yasuhiro Matsuo
PDF
Amazon Cognito Deep Dive @ JAWS DAYS 2016
akitsukada
PDF
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud (EC2) Windows編
Amazon Web Services Japan
PDF
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
PPTX
AWS が提供する IoT ソリューションと ITS における活用
Amazon Web Services Japan
PDF
Amazon EKS上の開発体験を最大化するプレビュー環境の作り方
理弘 山崎
PDF
ビッグデータサービス群のおさらい & AWS Data Pipeline
Amazon Web Services Japan
PDF
[AWSマイスターシリーズ] AWS CloudFormation
Amazon Web Services Japan
PPTX
AlexaのSmart HomeをAWSで作る方法
Jun Ichikawa
AWS SDK for Android and iOS
Amazon Web Services Japan
AWSマイスターシリーズReloaded -AWS SDK for .NET-
Amazon Web Services Japan
AWS Black Belt Techシリーズ AWS SDK
Amazon Web Services Japan
20200630 AWS Black Belt Online Seminar Amazon Cognito
Amazon Web Services Japan
Gaming cicd-pipeline gaming-technight-2
Amazon Web Services Japan
AWS re:Invent 2019 Recap IoT アップデート
Amazon Web Services Japan
GoodBye AD FS - Azure Active Directory Only の認証方式へ切り替えよう!
Yusuke Kodama
[よくわかるクラウドデータベース] CassandraからAmazon DynamoDBへの移行事例
Amazon Web Services Japan
[AWSマイスターシリーズ] AWS Elastic Beanstalk
Amazon Web Services Japan
[AWSマイスターシリーズ] Amazon Virtual Private Cloud (VPC)
Amazon Web Services Japan
20151030 オープンデータとセキュリティon aws
takaoka susumu
いまさら聞けない Amazon EC2
Yasuhiro Matsuo
Amazon Cognito Deep Dive @ JAWS DAYS 2016
akitsukada
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud (EC2) Windows編
Amazon Web Services Japan
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
AWS が提供する IoT ソリューションと ITS における活用
Amazon Web Services Japan
Amazon EKS上の開発体験を最大化するプレビュー環境の作り方
理弘 山崎
ビッグデータサービス群のおさらい & AWS Data Pipeline
Amazon Web Services Japan
[AWSマイスターシリーズ] AWS CloudFormation
Amazon Web Services Japan
AlexaのSmart HomeをAWSで作る方法
Jun Ichikawa
More from Amazon Web Services Japan
(20)
PDF
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
PDF
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
Amazon Web Services Japan
PDF
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
PDF
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
PDF
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
PDF
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
PDF
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
PPTX
20220409 AWS BLEA 開発にあたって検討したこと
Amazon Web Services Japan
PDF
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
Amazon Web Services Japan
PDF
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
Amazon Web Services Japan
PDF
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
PDF
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
PDF
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
PDF
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
PDF
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
PDF
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
PPTX
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
PDF
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
PDF
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
Amazon Web Services Japan
PDF
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
Amazon Web Services Japan
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
Amazon Web Services Japan
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
20220409 AWS BLEA 開発にあたって検討したこと
Amazon Web Services Japan
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
Amazon Web Services Japan
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
Amazon Web Services Japan
202112 AWS Black Belt Online Seminar 店内の「今」をお届けする小売業向けリアルタイム配信基盤のレシピ
Amazon Web Services Japan
[AWSマイスターシリーズ] AWS Client Side SDK -Android,iOS & JavaScript-
1.
re:G ene rate AWSマイスターシリーズ AWS Client-‐‑‒side
SDK -‐‑‒ Android, iOS and Javascript -‐‑‒ 2014.2.5 ソリューションアーキテクト 安川 健太 今井 雄太 © 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.
Agenda ! AWS
SDK オーバービュー ! クライアント側SDKの活⽤用法 ! クライアント側SDKにおけるAWS Credentialsの取り扱い ! 各クライアント側SDKの紹介 • AWS SDK for Android • AWS SDK for iOS • AWS SDK for JavaScript in the Browser ! まとめ © 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.
AWS SDK オーバービュー ©
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.
4.
AWSのサービス操作と⾔言えば AWS Management Console AWSコマンドラインツール ©
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.
5.
これらの裏裏側では・・・ !
各サービスの各操作にAPIが定義されている ! AWSでは・・・ • ⼈人間がGUIまたはCUI越しに叩く • プログラミングしてそれを⾃自動化・簡易易化・カスタ マイズ • ⼈人間が⼿手でやらなくてはいけない事をプログラミングして⾃自 動化できる、これがSDKで簡単に実現可能 à AWSの実は最も優れた⼀一⾯面 © 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.
6.
AWS SDKとは !
AWSのサービスをプログラムで操作できるSDK • さまざまな⾔言語で • • • • • • • • • • AWS SDK for Java AWS SDK for .Net AWS SDK for Ruby AWS SDK for PHP AWS SDK for Python (boto) AWS SDK for node.js AWS SDK for Android AWS SDK for iOS AWS SDK for Javascript in Browser 有志の⽅方による実装(ActionScript)も • 通信は原則HTTPS © 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.
7.
SDK⼀一般の動作イメージ 起動、停⽌止 REST AWS SDK SOAP Put,Get DB起動 バックアップ 認証情報 情報取得 © 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.
8.
AWS SDKをある観点でざっくり分けると 開発者の環境(サーバやバッチ処理理ワーカーなど)で動かすコードで利利⽤用 Java nodeJS .NET PHP Python Ruby エンドユーザの端末あるいはサービスのクライアント側で動くコードで利利⽤用 Android iOS Javascript in Browser クライアント側SDK ©
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.
9.
クライアント側SDKの活⽤用法 © 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.
10.
AWSのマネージドサービスを活⽤用した 2-‐‑‒tierのアーキテクチャが組める ! モバイル端末やブラウザからAWSの各種サービスを呼ぶ •
AWSのマネージドサービスを組み合わせてバックエンドに • しかもプラットフォーム横断で連携! © 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.
11.
例例1:静的ファイルだけで動的サイト ! DynamoDBやS3などをデータの保存先とするHTML +JSをS3に置けばWebサーバ無しで動的サイトを構築可 データの 読み書き HTML+JS https://s3.amazonaws.com/aws.mattgy.net/dynamodb-‐‑‒d3/index.html © 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.
12.
例例2: モバイルアプリ間でメッセージング !
AWSサービスのみで作るチャットアプリ • サーバ側のコーディングなしで掲⽰示板/チャットサービスを提供 DynamoDB ・メッセージの保存 ・チャットグループとメッセージの紐紐付 Simple Notification Service (SNS) ・新規メッセージの通知 Simple Queue Service (SQS) ・SNSの通知受け⼝口 Simple Storage Service (S3) ・画像等のデータの保存先・配信元 © 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.
13.
例例2: モバイルアプリ間でメッセージング ! DynamoDB,
S3を使ってデータ共有 2. DBクエリ / ファイルリクエスト DynamoDB 1. DB書き込み / ファイルアップロード 3. DB応答 / ファイルダウンロード S3 © 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.
14.
例例2: モバイルアプリ間でメッセージング !
SNSとSQSを使ってPub/Sub SNS: Simple Notification Service SQS: Simple Queue Service + SNS topic SQS queue 2. Notify 1. Publish © 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.
15.
例例2: モバイルアプリ間でメッセージング チャットグループへのSubscribe !
過去メッセージはDynamoDBから取得 ! SQSでキューを作成し、SNSにSubscribe 1. SQSのキューを作成 チャットグループの SNSトピック 2. SNSトピックにSubscribe 4. SNSトピックにPublish 5. SQSを通じて通知 クライアントA 0. メッセージ ⼀一覧取得 クライアントB 3. 新メッセージ書き込み © 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.
16.
例例2: モバイルアプリ間でメッセージング チャットグループへのファイルアップロード !
S3にファイルをアップロード ! SNSで通知 チャットグループの SNSトピック 3. SNSトピックにPublish 4. SQSを通じて通知 クライアントA 5. ファイルダウンロード 2. メッセージ書き込み クライアントB 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 Amazon.com, Inc.
17.
その他の例例 ⾮非同期バッチ処理理 ! ⾮非同期バッチ処理理要求を直接登録 •
通常のWebアプリ等 Job queue Client Workers Web Frontend • Android/iOS/Javascript SDKを使った場合 Job queue Workers © 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.
18.
その他の例例 ログやイベント情報の集計処理理 ! ログやイベント情報を直接登録 •
通常のWebアプリ等 Client Web Frontend ログ・イベント集計 • Android/iOS/Javascript SDKを使った場合 ログ・イベント集計 © 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.
19.
Amazon SNSへのデバイストークンの登録も直接可能 Apple Devices Google
Devices ント・ 3. エンドポイ ユーザ情報登録 2. エ ンド ポイ ント Amazon Kindle Fire Devices エンドポイント 取得 Push通知 Amazon SNS Mobile Push © 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.
20.
クライアント側SDK活⽤用のメリット ! アプリの開発に多くのメリット: • • • • バックエンド側の開発コストを最⼩小化 バックエンド側の運⽤用コストを最⼩小化 スケーラビリティの⼼心配なし ⾦金金額⾯面でもローコスト(当社⽐比*) !
必要に応じてEC2も導⼊入できる安⼼心感 • 後からバックエンド側にロジックを⼊入れてシステムの最適化 * EC2で同規模のサーバを⽴立立てる場合に⽐比べ © 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.
21.
AWS CREDENTIALSの取扱い © 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.
22.
誰のAWSアカウントを使う? ! AWSのコンソールアプリを作る場合 •
エンドユーザはAWSユーザ àAWSのアクセスキーとシークレットキーを⼊入⼒力力してもらえばOK ! AWSの各種サービスを使ったアプリを作る場合 • AWSの各種サービスはあくまでバックエンド • エンドユーザは必ずしもAWSユーザではない àアプリは開発者のアカウントで認証・認可を受ける必要 © 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.
23.
開発者アカウントを使うとして… ! アプリに開発者アカウントのアクセスキー等を埋め込ん だら •
アクセスキーが広範にばら撒かれることに • アクセスキーの不不正利利⽤用を⽌止めるためにキーを無効化したら à全ユーザへのサービスが停⽌止!! ! アクセスキーの定期的な更更新で対処するにしても • 更更新のたびにバージョンアップは⾮非現実的 • 更更新前のアプリからはサービス利利⽤用不不可に © 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.
24.
セキュアなAWSアクセスを提供するには ! アプリに認証情報を埋め込むべきではない !
エンドユーザ/端末ごとに異異なるCredentialsを提供すべ き • ユーザごとに必要最⼩小限の権限を与えるのは重要 • 不不正利利⽤用発覚時に不不正ユーザのみ権限を停⽌止 ! Credentialsは期限が来たら無効化されるべき • 不不正ユーザの影響も期限付きに これを実現する仕組みあります! © 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.
25.
Security Token Service !
AWSに対する、⼀一時的な認証情報を作成する仕組み • 期限付きの認証情報(認証チケット)を発⾏行行 • Identity and Access Management (IAM)サービスの機能 ! ユーザーに対して、以下の3つのキーを発⾏行行 § アクセスID § シークレットキー § セッショントークン ! 作成した認証情報の有効期限設定が可能 § デフォルト12時間 最⼩小1時間 最⼤大36時間 § ただし延⻑⾧長・短縮は出来ない 但し、STS⾃自体は認証の機能を持たないため、認証の仕組みは別途必要 © 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.
26.
認証機構とSTSとを インテグレーションする際の選択肢 {Facebook, Google, Amazon}
のIDで認証 Yes Web Identity Federationを利利⽤用可! Yes Identity TVMが選択 肢に No 独⾃自の認証付き Token Vending Machine (TVM)実装 が必要 ユーザごとに異異なる権限を 与える必要あり No Anonymous TVMが選択肢に © 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.
27.
Web Identity Federation !
Web Identity Providerの認証結果を受けてAWSの各種 サービスへのアクセスを認可する仕組み ! IAM RoleのAssume機能を利用して実現 • Web Identity Providerによって認証されたユーザは特定のIAM Role を持つものと見なす(Assume)する ! 対応Identity Providerは • Facebook • Google • Amazon © 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.
28.
Web Identity Federationの動作フロー STS⾃自体が認証済みユーザに アクセストークンを発⾏行行する Token
Vending Machine (TVM)の役割を担っている 詳細はマイスターシリーズIAM回を参照: http://www.slideshare.net/AmazonWebServicesJapan/20130716-‐‑‒aws-‐‑‒meisterregenerateiampublic © 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.
29.
Web Identity Federation利利⽤用時のコード例例 !
Android WebIdentityFederationSessionCredentialsProvider wif = new WebIdentityFederationSessionCredentialsProvider(fbSession.getAccessToken(), "graph.facebook.com", ROLE_̲ARN); String subjectFromWIF = wif.getSubjectFromWIF(); s3 = new AmazonS3Client(wif); ! iOS AmazonWIFCredentialsProvider *wif = [[AmazonWIFCredentialsProvider alloc] initWithRole:ROLE_̲ARN andWebIdentityToken:self.session.accessTokenData.accessToken fromProvider:@"graph.facebook.com"]; NSString *subjectFromWIF = wif.subjectFromWIF; s3 = [[[AmazonS3Client alloc] autorelease] initWithCredentialsProvider:wif]; © 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.
30.
独⾃自の認証機構を⽤用いる場合 Token Vending Machine
(TVM)を導⼊入 • ユーザ/端末の認証とトークンの発⾏行行を実施 • アプリケーションごとの認証とSTSを結びつけるための仕組み 1. Security Token Serviceか ら認証トークンを取得 1 STSから 2. クライアントに認証トーク ンを提供 3. クライアントは認証トーク ンを⽤用いてAWSにアクセス 3 アプリの認証 機構に合わせて 任意の実装 1 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.
31.
TVMの実装⽅方針を⼤大別すると ! AnonymousTVM • ユーザ認証を必要とせず、⼀一時認証トークンの機能のみ利利⽤用し たいユースケース向け •
例例:誰でも参加出来る掲⽰示板システム、ログの記録 ! IdentityTVM • ユーザ認証を実施し、認証されたユーザにのみ認証トークンを 発⾏行行するユースケース向け • 例例:ユーザ認証を伴うソーシャルアプリ、ゲーム等 どちらもサンプルの実装がサーバ側・クライアント側とも公開されている © 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.
32.
Anonymous TVM !
デバイス固有のIDと対応する秘密鍵をTVMに登録 ! 秘密鍵を使って認証トークンを暗号化して提供 デバイス固有のID と秘密鍵を登録 秘密鍵を使って © 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.
33.
Identity TVM ! ! ! ! Facebook, Twitter, Out-‐‑‒of-‐‑‒bandでユーザ登録 LDAPやAD等の基幹システ ムによる認証で置き換え可 登録したユーザ情報でログイン処理理 TVM⽤用秘密鍵の共有 秘密鍵を使って認証トークンを暗号化して提供 Anonymousの場合と同 様 ユーザのパスワー ドで暗号化 ©
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.
34.
Web Identityを⽤用いた Fine Grained
Access Control ! 例例1: S3バケット内にユーザごとのプライベートな領領域 を作成 { "Version":"2012-‐‑‒10-‐‑‒17", "Statement":[ { "Effect":"Allow", "Action":["s3:GetObject", "s3:PutObject", "s3:DeleteObject"], "Resource":[ "arn:aws:s3:::myBucket/myApp/${graph.facebook.com:id}", "arn:aws:s3:::myBucket/myApp/${graph.facebook.com:id}/*“ ] } ] Facebookにログインした } ユーザーのIDが⼊入る © 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.
35.
Web Identityを⽤用いた Fine Grained
Access Control ! 例例2: DynamoDBのテーブル内にユーザごとにプライ ベートな⾏行行/列列を定義する "Condition": { "ForAllValues:StringEquals": { "dynamodb:LeadingKeys": [ "${www.amazon.com:user_̲id}" ], "dynamodb:Attributes": [ "UserId”,"GameTitle”, "Wins”, "Losses” ] }, "StringEqualsIfExists": { "dynamodb:Select": "SPECIFIC_̲ATTRIBUTES" } } © 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.
36.
各クライアント側SDKの紹介 © 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.
37.
AWS SDK FOR
ANDROID © 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.
38.
AWS SDK for
Androidとは ! Amazon提供のAWS開発⽤用のAndroid向けSDK ! 公式ページ:http://aws.amazon.com/jp/sdkforandroid/ ! 環境:Android 2.3 (API level 10)以上 ! 利利⽤用⽅方法 • 公式ページからダウンロード • Gitレポジトリから Mavenをお使いの場合: 公式MavenレポジトリLocalレポジトリにインストー ルしての利利⽤用は可(但し、正式サポートの範囲外) © 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.
39.
操作可能サービス EC2 S3 DynamoDB SimpleDB SNS SQS SES ELB CloudWatch Autoscaling ※サポートするサービスの範囲はiOS SDKと同様 © 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.
40.
SDKに含まれるもの ! AWS
Android ライブラリ • 各種サービス向けAPIを提供するJavaライブラリ • Androidアプリのプロジェクトから参照 • 最終的にはAPKに内包 ! ソースコード ! ドキュメント (コードサンプルはGitレポジトリに移動) https://github.com/awslabs/aws-‐‑‒sdk-‐‑‒android-‐‑‒samples • • • • • • 各種サービスの操作 SNSとSQSを使ったメッセージボード S3アップローダ SimpleDB ハイスコア SESフィードバックフォーム DynamoDBを使ったユーザプリファレンス © 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.
41.
初期設定 ! プロジェクトの依存関係にAndroid
SDKを追加 • EclipseとAndroid SDKを使っている場合の例例: 必要なライブラリをプロジェ クトのlibs配下にコピー 注:他の場所に配置する場合は最終的なAPKにクラスファ イルが含まれるようにすること © 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.
42.
依存するJarファイルについてTips ! 開発時はデバッグシンボル付きのライブラリを使⽤用 aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒debug.jar aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒ddb-‐‑‒mapper-‐‑‒debug.jar !
配布時は必要なサービスのみ同梱 全部⼊入り aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>.jar aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒ddb-‐‑‒mapper.jar DynamoDBMapper を使う場合に必要 必要なサービスのみ aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒core.jar + aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒ddb.jar aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒s3.jar aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒sns.jar aws-‐‑‒android-‐‑‒sdk-‐‑‒<version>-‐‑‒sqs.jar あるいはproguardを使って必要なパッケージのみ同梱 © 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.
43.
コード例例 ! 基本的な流流れ(iOSも同様) • • • • 利利⽤用するサービスのクライアントオブジェクトの作成 サービスのリクエストオブジェクトを作成 クライアントオブジェクトを通じてリクエスト レスポンスを受け取る S3にファイルをアップロードする例例 void
uploadToS3 (String bucketName, String objectName, File file){ AmazonCredentials credentials = new BasicAmazonCredentials(ACCESS_̲KEY, SECRET_̲KEY); AmazonS3Client s3 = new AmazonS3Client(credentials); PutObjectRequest req = new PutObjectRequest(bucketName, objectName, file)); PutObjectResponse resp = s3.putObject(req); } © 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.
44.
コード例例:S3へのアップロード (⾮非同期) S3UploadTask uploadTask
= new S3UploadTask(); uploadTask.execute(new PutObjectRequest(bucketName, objectName, tempFile)); private class S3UploadTask extends AsyncTask<PutObjectRequest, Long, Long> implements ProgressListener { protected Long totalSent; バック グラウ ンド実 ⾏行行 // AsyncTask#doInBackground() protected Long doInBackground (PutObjectRequest... reqs) { totalSent = 0L; reqs[0].setProgressListener(this); S3.getInstance().putObject(reqs[0]); return totalSent; } // ProgressListener#progressChanged() 進⾏行行状 public void progressChanged (ProgressEvent progressEvent) { totalSent += progressEvent.getBytesTransfered(); publishProgress(totalSent); 況の更更 } 新 } © 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.
45.
コード例例:DynamoDBへのQuery ハッシュキーとレンジキーのMaxを指定して特定のテーブルにクエリを送る例 QueryResult doQuery (String
hashKey, String max) { ハッシュ キーを AttributeValue hashKey = new AttributeValue().withS(hashKey); 指定 Condition lessThanMax = new Condition() .withComparisonOperator(ComparisonOperator.LT) 条件を .withAttributeValueList(new AttributeValue().withN(max)); 指定 QueryResult result = dynamoClient.query(new QueryRequest() .withTableName(TABLE_NAME) クエリを .withLimit(NUMBER_OF_ITEMS_TO_GET_AT_ONCE) 実行 .withHashKeyValue(hashKey) .withRangeKeyCondition(lessThanMax) ); return result; } © 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.
46.
コード例例:DynamoDBMapperで DynamoDBにオブジェクトを永続化 POJOを定義 @DynamoDBTable(tableName = “meisters_items”) public
class MeistersItem { private String id; private long value; @DynamoDBHashKey(attributeName = “id”) public String getId() { return id; } @DynamoDBHashKey(attributeName = “id”) public void setId(String id) { this.id = id; } @DynamoDBAttribute(attributeName = “value”) public long getValue() { return time; } } DynamoDBMapperを初期化 AmazonDynamoDBClient dynamoClient = new AmazonDynamoDBClient(getCredentials()); AmazonDynamoDBMapper dbMapper = new DynamoDBMapper(getDynamoClient()); POJOの保存 MeisterItem item = new MeisterItem(); item.setId(“Expensive item”); item.setValue(10000); dbMapper.save(item); POJOの読み込み MeisterItem item = dbMapper.load(MeisterItem.class, “Expensive item”); @DynamoDBAttribute(attributeName = “value”) public void setValue(long time) { this.time = time; } © 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.
47.
Android SDK利利⽤用時のTips !
UIスレッドからAWSのAPIを呼ぶのは避ける • 適宜AsyncTaskや別Threadを使⽤用 ! 各サービスクライアントのインスタンスは再利利⽤用 • サービスクライアントの実装はThread Safe • Singletonにすることで重いオブジェクト⽣生成を最⼩小限に • 例例:サンプル内のAmazonClientManager public class AmazonClientManager { // 下記コードは簡易易版 private AmazonS3Client s3Client = null; public AmazonS3Client s3() { if (s3Client == null) s3Client = new AmazonS3Client( credentials ); return s3Client; } } ! ユースケース別の解説付きコードサンプルがこちらに: • http://aws.amazon.com/articles/SDKs/Android © 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.
48.
AWS SDK FOR
IOS © 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.
49.
AWS SDK for
iOSとは ! Amazon提供のAWS開発⽤用iOS SDK ! 公式ページ: http://aws.amazon.com/jp/sdkforios/ ! 動作環境:iOS 4.3以上 ! 開発環境:Xcode v4以上 ! 利利⽤用⽅方法 • 公式ページからダウンロード • Gitレポジトリから © 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.
50.
操作可能サービス EC2 S3 DynamoDB SimpleDB SNS SQS SES ELB CloudWatch Autoscaling ※サポートするサービスの範囲はAndroid SDKと同様 © 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.
51.
SDKに含まれるもの ! AWS
iOSライブラリ • 各種サービス向けAPIを提供するObjective-‐‑‒Cライブラリ • iOSアプリプロジェクトのフレームワークの1つとして参照 ! ドキュメント ! ソースコード (コードサンプルはGitレポジトリに移動) https://github.com/awslabs/aws-‐‑‒sdk-‐‑‒ios-‐‑‒samples • • • • • • • 各種サービスの操作 SNSとSQSを使ったメッセージボード S3アップローダ SimpleDB ハイスコア SESフィードバックフォーム DynamoDBを使ったユーザプリファレンス DynamoDB を CoreDataフレームワークのバックエンドに © 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.
52.
初期設定 〜~Frameworkの追加〜~ !
プロジェクトにSDKを追加 1. Xcodeにてプロジェクトを開く 2. Frameworks GroupをCtrlを押しながら クリック 3. AWSiOSSDK.frameworkを追加 • AWSPersistence.frameworkは任意 (DynamoDB + CoreDataを使った Persistenceを利利⽤用する場合) 4. ソースコードで必要なヘッダファイルを インクルード • 例例 #import <AWSiOSSDK/S3/AmazonS3Client.h> #import <AWSiOSSDK/SimpleDB/AmazonSimpleDBClient.h> #import <AWSiOSSDK/SQS/AmazonSQSClient.h> #import <AWSiOSSDK/SNS/AmazonSNSClient.h> © 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.
53.
初期設定 〜~ドキュメントのインストール〜~ !
ドキュメントセットをXcodeにインストール • SDKのディレクトリからdocsetファイルをコピー • これを – • Documentation/com.amazon.aws.ios.docset ここに – $HOME/Library/Developer/Shared/Documentaion/DocSets $ mkdir –p $HOME/Library/Developer/Shared/Documentaion/DocSets $ cp Documentation/com.amazon.aws.ios.docset $HOME/Library/Developer/Shared/Documentaion/DocSets • Xcodeを再起動 © 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.
54.
コード例例 ! 基本的な流流れ
(Androidも同様) • • • • 利利⽤用するサービスのクライアントオブジェクトの作成 サービスのリクエストオブジェクトを作成 クライアントオブジェクトを通じてリクエスト レスポンスを受け取る S3にファイルをアップロードする例例 -‐‑‒ void uploadToS3: (NSString*) bucketName keyName: (NSString *) keyName fileName: (NSString *) fileName { S3PutObjectRequest *putObjectRequest = [[[S3PutObjectRequest alloc] initWithKey:keyName inBucket:bucketName] autorelease]; putObjectRequest.filename = fileName; [[AmazonClientManager s3] putObject:putObjectRequest]; } © 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.
55.
コード例例:S3へのアップロード(⾮非同期) 1/2 NSOperationのサブクラスとしてS3 Uploaderを実装 #import
<Foundation/Foundation.h> #import <AWSiOSSDK/AmazonServiceRequest.h> @interface AsyncImageUploader:NSOperation<AmazonServiceRequestDelegate> { … - (void) start { …. // Puts the file as an object in the bucket. S3PutObjectRequest *putObjectRequest = [[[S3PutObjectRequest alloc] initWithKey:keyName inBucket:bucketName] autorelease]; putObjectRequest.filename = filename; Delegateとして途中経過や結果を受け putObjectRequest.delegate = self; 取れるように登録 [[AmazonClientManager s3] putObject:putObjectRequest]; } © 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.
56.
コード例例:S3へのアップロード(⾮非同期) 2/2 Delegateパターンで途中経過や結果を受け取り 完了時 の処理 -(void) request:(AmazonServiceRequest
*)request didCompleteWithResponse:(AmazonServiceResponse *)response { [self performSelectorOnMainThread:@selector(hideProgressView) withObject:nil waitUntilDone:NO]; [self finish]; } 進行状 況の更 新処理 -(void) request:(AmazonServiceRequest *)request didSendData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger) totalBytesWritten totalBytesExpectedToWrite:(NSInteger) totalBytesExpectedToWrite { [self performSelectorOnMainThread:@selector(updateProgressView:) withObject: [NSNumber numberWithFloat: (float)totalBytesWritten / totalBytesExpectedToWrite] waitUntilDone:NO]; } © 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.
57.
コード例例:DynamoDBへのQuery -(DynamoDynamoDBQueryResponse *) doQuery:
(NSString*) hashKey max: (NSString *) max { DynamoDBQueryRequest *req = [[DynamoDBQueryRequest alloc] autorelease]; req.tableName = TABLE_NAME; ハッシュ req.limit = [[NSNumber alloc] initWithInt: NUMBER_OF_ITEMS_TO_GET_AT_ONCE]; キーを req.hashKeyValue = [[DynamoDBAttributeValue alloc] initWithS: hashKey] autorelease]; 指定 DynamoDBCondition *lessThanMax = [[DynamoDBCondition alloc] autorelease]; [req.rangeKeyCondition setComparisonOperator: @“LT"]; [req.rangeKeyCondition addAttributeValueList: [[[DynamoDBAttributeValue alloc] initWithN: max] autorelease]]; req.rangeKeyCondition = lessThanMax; 条件を 指定 クエリを DynamoDBQueryResponse *resp = [[AmazonClientManager dynamodb] query: req]; 実行 return resp; } © 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.
58.
iOS SDK利利⽤用時のTips !
UIスレッドからAWSのAPIを呼ぶのは避ける • 適宜NSOperationやGCD等を使⽤用 ! 各サービスクライアントのインスタンスは再利利⽤用 • サービスクライアントの実装はThread Safe • 例例:サンプル内のAmazonClientManager #import "AmazonClientManager.h" static AmazonS3Client *s3 = nil; @implementation AmazonClientManager +(AmazonS3Client *)s3 { if(s3 == nil) s3 = [[AmazonS3Client alloc] initWithCredentials:credentials]; return s3; } ! ユースケース別の解説付きコードサンプルがこちらに: • http://aws.amazon.com/articles/SDKs/iOS © 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.
59.
AWS SDK FOR
JAVASCRIPT IN WEB BROWSER © 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.
60.
AWS SDK for
JavaScript in the Browserとは ! Amazon提供のブラウザで動作するJavaScript環境 のためのAWS SDK • node.js環境のためのSDKは別に存在する ! 公式ページ:http://aws.amazon.com/jp/sdkforbrowser/ ! 環境: ! 利利⽤用⽅方法 • 公式ページからダウンロード • Gitレポジトリから © 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.
61.
操作可能サービス DynamoDB S3 SQS SNS © 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.
62.
初期設定(1/2) ! HTML内にJavaScriptを読み込む •
SDKをインターネット上の任意の場所に配置し、Scriptタグで 読み込む • <script type="text/javascript" src=”PATH/TO/YOUR/ SDK"></script> • AWSで⽤用意するCDN上に配置されたSDKを使う • <script type="text/javascript" src="https:// sdk.amazonaws.com/js/aws-‐‑‒sdk-‐‑‒2.0.0-‐‑‒rc1.min.js"></ script> ! 読み込まれると、“AWS”というグローバル変数が利利⽤用可 能になる © 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.
63.
初期設定(2/2) ! WebIdentityFederationでAWS Credentialを取得 //
FacebookのAccessTokenを使ってAWSのCredentialを取得する window.fbAsyncInit = function() { FB.init({ appId: appId }); FB.login(function(response) { AWS.config.credentials = new AWS.WebIdentityCredentials({ ProviderId: 'graph.facebook.com', RoleArn: roleArn, // IAM RoleのARN WebIdentityToken: response.authResponse.accessToken }); fbUserId = response.authResponse.userID; button.style.display = 'block'; }); }; // FacebookのSDK読み込み (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_̲US/all.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-‐‑‒jssdk')); be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. © 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not
64.
コード例例:S3へのアップロード <input type="file" id="file-‐‑‒chooser"
/> <button id="upload-‐‑‒button" style="display: none”>Upload to S3</button> <script type="text/javascript”> //AWS.config.credentialにCredentialが取得済みの状態で var bucket = new AWS.S3({params: {Bucket: “YOUR_̲BUCKET_̲NAME”}}); button.addEventListener('click', function() { var file = fileChooser.files[0]; if (file) { results.innerHTML = ''; var objKey = “KEY_̲NAME”; var params = {Key: objKey, Body: file, ACL: 'public-‐‑‒read'}; bucket.putObject(params, function (err, data) { if (err) { console.log(err); } else { console.log(data); } }); } }, false); </script> © 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.
65.
コード例例:DynamoDBへのputItem <button id="upload-‐‑‒button" style="display:
none">Put to DynamoDB</button> <script type="text/javascript”> //AWS.config.credentialにCredentialが取得済みの状態で var dynamodb = new AWS.DynamoDB({region:'ap-‐‑‒northeast-‐‑‒1'}); button.addEventListener('click', function() { var params = { TableName: 'test', Item: { 'title': {S: appId + 'aaa'}, 'message': {S: 'Good Morning'} } }; dynamodb.putItem(params, function(err, data) { if (err) { console.log(err); }else{ console.log(data); } }); }, false); </script> © 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.
66.
まとめ © 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.
67.
まとめ ! クライアント側SDKを⽤用いて2-‐‑‒tierアーキテクチャを実現 • • • • バックエンド側の開発コストを最⼩小化 バックエンド側の運⽤用コストを最⼩小化 スケーラビリティの⼼心配なし ⾦金金額⾯面でもコスト削減に !
Web Identity Federationや認証トークン機構を使うことで クライアントアプリからのAWSへのアクセスも安⼼心 ! AWSはコーディングする⽅方の⼒力力を最⼤大限に引き出すインフラ • その恩恵はサーバ側だけでなくクライアントアプリにも! • HAPPY CODING!! © 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.
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.
69.
TVM導⼊入の流流れ ! 認証トークンに割り当てるユーザ権限を設定 •
Identity and Access Management (IAM)でユーザを作成 • アプリケーションに合わせたポリシーを割り当て ! TVMを実装し、デプロイ • サンプルはWARファイルをデプロイするだけで実⾏行行可 • AnonymousTVM • IdentityTVM àElasticBeanstalkを使うと簡単! ! TVMの各種設定 • Security Token Serviceにアクセスするためのアクセスキー設定 • SSLの設定(推奨) © 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.
70.
認証トークンに割り当てるユーザ権限を設定 (1/2) ! IAMでTVM⽤用の新しいユーザを作成(例例:TVMUser) !
認証情報(アクセスキー・シークレットキー)を保存 後でTVMアプリケーション側に設定するので大切に保存 © 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.
71.
認証トークンに割り当てるユーザ権限を設定 (2/2) ! カスタムポリシーを作成して割り当て !
カスタムポリシーの例例 (TVMのサンプルに同梱) { "Statement": [ { "Effect": "Allow", "Action": "sts:GetFederationToken", "Resource": "*" }, { "Effect": "Allow", "Action": "iam:GetUser", "Resource": "*" }, { "Effect": "Allow", "Action": "sdb:*", "Resource": "*" }, { "Effect":"Allow", "Action":"dynamodb:*", "Resource":"*" }, { "Effect": "Allow", "Action": "sqs:*", "Resource": "*" }, { "Effect": "Allow", "Action": "s3:*", "Resource": "*" }, {"Effect": "Allow", "Action": "sns:*", "Resource": "*" } ] } アプリケーションで必要最小限な権限になるよう更新 © 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.
72.
TVMがデプロイされたことを確認 ! TVMをデプロイしたHTTPコンテナにアクセス 設定に関する警告が消え て、Security
Token Serviceにアクセス出来る ようになったことを確認 本番ではSSL必須: 平文ではデバイス/ユーザ 登録で秘密鍵/パスワード が流出するリスク © 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.
73.
[再掲] 認証トークンを⽤用いたサービス利利⽤用の流流れ Token Vending
Machine (TVM)を導入 • ユーザ/端末の認証とトークンの発行を実施 • アプリケーションごとの認証とAWSの認証機構を結びつけるサービス 1. Security Token Serviceか 1ら認証トークンを取得 STSから 2. クライアントに認証トークン を提供 3. クライアントは認証トークン を用いてAWSにアクセス 3 TVMのサンプル を利用 1 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.
74.
TVMを⽤用いたサンプルを試す AnonymousTVMの動作確認 ! samples/S3_̲SimpleDB_̲SNS_̲SQS_̲DemoTVM •
設定例例: • TVM URL: http://anon-‐‑‒example.elasticbeanstalk.com Android: AwsCredentials.propertiesを編集 tokenVendingMachineURL=anon-example.elasticbeanstalk.com iOS: Constants.hを編集 #define TOKEN_VENDING_MACHINE_URL @“anon-example.elasticbeanstalk.com” /registerdevice?uid=<UID>&key=<KEY> /gettoken? uid=<UID>×tamp=<timestamp>&signature=<Sig http://anonexample.elasticbeanstalk.com nature> <Encrypted token credentials> © 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.
75.
TVMを⽤用いたサンプルを試す IdentityTVMの動作確認 ! samples/S3_̲SimpleDB_̲SNS_̲SQS_̲DemoTVMIdentity •
設定例例: • TVM URL: http://id-‐‑‒example.elasticbeanstalk.com • アプリ名: exampleApp (TVMの環境変数”PARAM1”に設定した値) Android: AwsCredentials.propertiesを編集 tokenVendingMachineURL=id-example.elasticbeanstalk.com appName=exampleApp iOS: Constants.hを編集 #define TOKEN_VENDING_MACHINE_URL @“id-example.elasticbeanstalk.com” #define APP_NAME @“exampleApp" login() registeruser() © 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.
76.
TVM Clientのインテグレーション !
Android / iOSともにTVM Clientの実装がサンプルに • 各サンプル内のAmazonClientManagerの実装はTVM Clientを利利⽤用 • S3_̲SimpleDB_̲SNS_̲SQS_̲DemoTVM à Anonymous TVM • S3_̲SimpleDB_̲SNS_̲SQS_̲DemoTVMIdentity à IdentityTVM ! おすすめのステップは… 1. ベースとするTVMの実装を決定 (Anonymous or Identity) 2. 対応するサンプルコード内の実装をコピー • • AmazonClientManager TVMClient 3. 必要に応じてTVM, TVM Client, 認証メカニズムをカスタマイズ • Identity TVMをカスタマイズすればSNSとのID連携も © 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.
Download