論文紹介:Automated Classification of Model Errors on ImageNet
AWS Black Belt Online Seminar 2016 Amazon API Gateway
1. 【AWS Black Belt Online Seminar】
Amazon API Gateway
Keisuke Nishitani (@Keisuke69)
Amazon Web Services Japan K.K.
Nov 16, 2016
2. Profile
Keisuke Nishitani
Specialist Solutions Architect, Amazon Web Service Japan K.K
@Keisuke69 Keisuke69
✤ スペシャリストSA
- Serverless
- Mobile
- DevOps
- Application Service
✤ RESTおじさん
✤ 餃子の王将エヴァンジェリスト(自称)
✤ 音楽が好きです、フジロッカーです、今年も行きました
✤ 小説大好き、マンガ大好き、空想好き
✤ ブログ: http://keisuke69.hatenablog.jp/
Keisuke69 Keisuke69Keisuke69x
3. 内容についての注意点
✤ 本資料では2016年11月16日時点のサービス内容および価格について
ご説明しています。最新の情報は AWS 公式ウェブサイト
(http://aws.amazon.com) にてご確認ください。
✤ 資料作成には十分注意しておりますが、資料内の価格と AWS 公式
ウェブサイト記載の価格に相違があった場合、AWS 公式ウェブサイ
トの価格を優先とさせていただきます。
✤ 価格は税抜表記となっています。日本居住者のお客様がサービスを使
用する場合、別途消費税をご請求させていただきます。
AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with
the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this
document is provided only as an estimate of usage charges for AWS services based on certain information that you have
provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
19. フロントエンドの統一
InternetMobile Apps Amazon
API Gateway
On premise
web server
1. オンプレのWebサービスの手前にAPI Gatewayを配置
2. オンプレのWebサービスをAWSへポーティング
3. API Gatewayのコール先を新規サービスのAPIに変更する
30. API
✤ API自身を最上位とした階層構造になっている
✤ API内にリソースを定義
⎻ リソース名がURLのパスの一部となる
⎻ ネストすることやパスパラメータの設定も可能
ex) /pets/{petId}
✤ 各リソースにメソッドを定義
⎻ メソッドはリソース+HTTPメソッドで構成される
⎻ スタンダードな7つのHTTPメソッドとANYをサポート
Pet Store
/pets
/pets/{petId}
• GET
• POST
• PUT
31. APIのデプロイ
✤ APIはステージにデプロイされる
✤ ステージはそれぞれ個別の環境を表す
✤ ステージ名はURIの一部となる
⎻ 例:
Dev (e.g. awsapigateway.com/dev)
Beta (e.g. awsapigateway.com/beta)
Prod (e.g. awsapigateway.com/prod)
Pet Store
dev
beta
gamma
prod
47. Custom authorizers
Client
Lambda Auth
function
API Gateway
OAuth token
OAuth
provider
Policy is
evaluated
Policy is
cached
Endpoints on
Amazon EC2
Any other publicly
accessible endpoint
AWS Lambda
functions
403 バックエンドの呼び出し前にトークンを検証するファンク
ションを呼び出す
73. Amazon API Gateway Tips
✤ エンドポイントへのアクセスに地域による制限をかけたい
⎻ API Gateway自身には機能はないですがバックエンド側のロジックでチェック
をして弾く、もしくはCloudFrontを使用してAPI Gatewayをオリジンとして設
定することで利用可能です。ただし、2段になるためレイテンシを考慮する必
要があります。
✤ HTTPでリクエストを受けたい
⎻ CloudFrontを使用してAPI Gatewayをオリジンとして設定することで利用可能
です。ただし、2段になるためレイテンシを考慮する必要があります。
74. API Gatewayの手前にCloudFrontを利用する
✤ API Gateway自身もCloudFrontを利用してディストリビューションさ
れていますが、CloudFrontの設定は変更不可となっています
⎻ API Gatewayでの利用はDDoSプロテクション(L7, L3およびSyn flood)目的
✤ CloudFrontをAPI Gatewayの前段で利用することでCloudFrontの持つ
機能を活かすことが可能となります
⎻ ただし、2段となるためレイテンシの影響を考慮する必要があります
POP
POP
(API Gatewayが利用)