© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Keisuke Nishitani (@Keisuke69)
Amazon Web Services Japan K.K.
July 19, 2017
AWS Lambda
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Black Belt Online Seminar へようこそ!
• 質問を投げることができます!
- Adobe Connect のチャット機能を使って、質問を書き込んでく
ださい。(書き込んだ質問は、主催者にしか見えません)
- Twitterへツイートする際はハッシュタグ #awsblackbelt をご利用
ください。
①画面右下の
チャットボックス
に質問を書き込ん
でください
②吹き出しマーク
で送信してくださ
い
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Black Belt Online Seminar とは
AWSJのTechメンバがAWSに関する様々な事を紹介するオンラインセミナーです
【火曜 12:00~13:00】
主にAWSのソリューションや
業界カットでの使いどころなどを紹介
(例:IoT、金融業界向け etc.)
【水曜 18:00~19:00】
主にAWSサービスの紹介や
アップデートの解説
(例:EC2、RDS、Lambda etc.)
※開催曜日と時間帯は変更となる場合がございます。
最新の情報は下記をご確認下さい。
オンラインセミナーのスケジュール&申し込みサイト
https://aws.amazon.com/jp/about-aws/events/webinars/
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Who am I
Keisuke Nishitani
Specialist Solutions Architect, Serverless
Amazon Web Service Japan K.K
@Keisuke69 Keisuke69 Keisuke69 Keisuke69Keisuke69x
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
サーバのプロビジョニング
や管理が不要
利用量に応じたスケール
アイドル時の支払いは一切なし 組み込まれた可用性と耐障害性
AWS Lambdaとは
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アプリケーションモデル
イベントソース ファンクション サービスなど
Java
C#
Node.js
Python
λ
イベント
S3にオブジェクトが作られる
Kinesisにストリームデータが保存される
HTTPSによるリクエスト
etc...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
内容
• S3にオブジェクト(画像)を保存すると、Lambdaファ
ンクションがサイズを変更してDestinationバケットに保
存
• やること
- SourceバケットとDestinationバケットの作成
- Lambdaファンクションの作成
- デプロイパッケージの作成
- イベントソースの設定
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
内容
元画像
イベント
1. 画像アップロード
2. 画像サイズ変更 3. 変更後画像の保存
Sourceバケット Destinationバケット
Lambda
ファンクション
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
直近のアップデート
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
コンソール上でLambda関数ポリシーが確認可能に
• これまでCLIかSDKで確認しかできなかった関数ポリ
シーがマネジメントコンソール上で確認可能に
- トリガータブ内で確認可能
• リソースベースのポリシー設定が可能に
- CreateEventSourceMapping
- UpdateEventSourceMapping
- DeleteEventSourceMapping
- AddPermission
- RemovePermission
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ファンクションへのタグ付けをサポート
• ファンクションへKey-Value形式のタグを付与すること
が可能に
- ファンクションのグルーピングが簡単に
• ダッシュボード画面においてタグと値を指定してのフィ
ルタリングが可能に
• AWS Billingともインテグレーション
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
利用可能なリージョンが追加
• Canada (Central)
• South America (São Paulo)
• Asia Pacific (Mumbai)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デフォルトの同時実行数が増加
• セーフガードとして設定されている同時実行数がデフォ
ルトで1000まで増加
- 従来は100
• 3000までであればこれまでより簡単に上限緩和可能に
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
(参考)同時実行数
1s 2s 3s 4s 5s
秒間リクエスト:
10 req/sec
関数の平均実行時間: 3s / exec
同時実行数
= “同時”に実行されているタイミング
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
(参考)同時実行数 - ストリームベースの場合
同時実行数
ストリーム
シャード1
シャード2
シャード3
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

20170705 blackbelt AWS Lambda

  • 1.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Keisuke Nishitani (@Keisuke69) Amazon Web Services Japan K.K. July 19, 2017 AWS Lambda
  • 2.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS Black Belt Online Seminar へようこそ! • 質問を投げることができます! - Adobe Connect のチャット機能を使って、質問を書き込んでく ださい。(書き込んだ質問は、主催者にしか見えません) - Twitterへツイートする際はハッシュタグ #awsblackbelt をご利用 ください。 ①画面右下の チャットボックス に質問を書き込ん でください ②吹き出しマーク で送信してくださ い
  • 3.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS Black Belt Online Seminar とは AWSJのTechメンバがAWSに関する様々な事を紹介するオンラインセミナーです 【火曜 12:00~13:00】 主にAWSのソリューションや 業界カットでの使いどころなどを紹介 (例:IoT、金融業界向け etc.) 【水曜 18:00~19:00】 主にAWSサービスの紹介や アップデートの解説 (例:EC2、RDS、Lambda etc.) ※開催曜日と時間帯は変更となる場合がございます。 最新の情報は下記をご確認下さい。 オンラインセミナーのスケジュール&申し込みサイト https://aws.amazon.com/jp/about-aws/events/webinars/
  • 4.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Who am I Keisuke Nishitani Specialist Solutions Architect, Serverless Amazon Web Service Japan K.K @Keisuke69 Keisuke69 Keisuke69 Keisuke69Keisuke69x
  • 5.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. サーバのプロビジョニング や管理が不要 利用量に応じたスケール アイドル時の支払いは一切なし 組み込まれた可用性と耐障害性 AWS Lambdaとは
  • 6.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. アプリケーションモデル イベントソース ファンクション サービスなど Java C# Node.js Python λ イベント S3にオブジェクトが作られる Kinesisにストリームデータが保存される HTTPSによるリクエスト etc...
  • 7.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Demo
  • 8.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 内容 • S3にオブジェクト(画像)を保存すると、Lambdaファ ンクションがサイズを変更してDestinationバケットに保 存 • やること - SourceバケットとDestinationバケットの作成 - Lambdaファンクションの作成 - デプロイパッケージの作成 - イベントソースの設定
  • 9.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 内容 元画像 イベント 1. 画像アップロード 2. 画像サイズ変更 3. 変更後画像の保存 Sourceバケット Destinationバケット Lambda ファンクション
  • 10.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 直近のアップデート
  • 11.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. コンソール上でLambda関数ポリシーが確認可能に • これまでCLIかSDKで確認しかできなかった関数ポリ シーがマネジメントコンソール上で確認可能に - トリガータブ内で確認可能 • リソースベースのポリシー設定が可能に - CreateEventSourceMapping - UpdateEventSourceMapping - DeleteEventSourceMapping - AddPermission - RemovePermission
  • 12.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. ファンクションへのタグ付けをサポート • ファンクションへKey-Value形式のタグを付与すること が可能に - ファンクションのグルーピングが簡単に • ダッシュボード画面においてタグと値を指定してのフィ ルタリングが可能に • AWS Billingともインテグレーション
  • 13.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 利用可能なリージョンが追加 • Canada (Central) • South America (São Paulo) • Asia Pacific (Mumbai)
  • 14.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. デフォルトの同時実行数が増加 • セーフガードとして設定されている同時実行数がデフォ ルトで1000まで増加 - 従来は100 • 3000までであればこれまでより簡単に上限緩和可能に
  • 15.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. (参考)同時実行数 1s 2s 3s 4s 5s 秒間リクエスト: 10 req/sec 関数の平均実行時間: 3s / exec 同時実行数 = “同時”に実行されているタイミング
  • 16.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. (参考)同時実行数 - ストリームベースの場合 同時実行数 ストリーム シャード1 シャード2 シャード3
  • 17.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.