or its affiliates. AWS Lambda の Invoke API 13 def lambda_handler(event, context): # do something return { … } handler Invoke API Client Service 実行環境 Runtime API Lambda Service Lambda Function Instance
or its affiliates. AWS Lambda の Event Source Mapping 14 def lambda_handler(event, context): # do something return { … } handler Service 実行環境 Runtime API Lambda Service Lambda Function Instance poller Event Source Mapping
or its affiliates. EventBridge Pipes を構成する要素 16 API Destination API Gateway Lambda Batch CloudWatch ECS EventBridge Bus Kinesis Data Firehose Inspector Kinesis Data Streams Redshift SageMaker pipeline SNS SQS Step Functions filter Step Functions Lambda API Destination API Gateway transform transform EventBridge Pipes enrich
or its affiliates. Lambda 関数ジョブの並列化 with Map 21 AWS Step Functions workflow Start End Transform Load S3 Extract function Transform function Load function Transform Load Extract Transform Load Map Lambda関数でのETLを Map State により並列化 [data1, data2, …, dataN] https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html
or its affiliates. Webhook を投げる側 37 function Amazon EventBridge ⾮同期 API Destination SaaS や 別システムで公開して いる Webhook にメッセージを 送信する際に EventBridge API Destination が利用できる
or its affiliates. Archive / Replay 40 function table function table Event ユーザー定義 Rule Archive Rule event bus ターゲット ターゲット ユーザー定義 Rule Archive Replay now Replay end time Replay start time • Event Bus に対して Archive設定 をしておくことで、Archive rule にマッチしたイベントを複製し アーカイブ • アーカイブされたイベントは、 アーカイブ時間(start – end)を指 示することで Replay 可能 00:15 00:30
or its affiliates. global endpoints for Amazon EventBridge / cross region 41 https://aws.amazon.com/jp/blogs/compute/introd ucing-global-endpoints-for-amazon-eventbridge
or its affiliates. 論理アーキテクチャ 44 Orange Service Context Blue service team Purple service team Orange service team P-E2 S-E2 S-E2 S-E3 P-E3 P-E1 S-E1 Purple service context Blue service context = Publisher = Subscriber E = Event S P
or its affiliates. [Centralized] Single-bus, single-account pattern 46 Orange service context Blue service team Purple service team Orange service team Service stack P-E2 S-E2 S-E2 S-E3 P-E1 S-E1 Purple service context Blue service context E1 rule DevOps team Event bus stack E2 rule E3 rule AWS account 特徴 • 各サービスからのすべての イベントは、アカウント内 の単一のバスを介してルー ティングされる • 対象のサービスを簡単に呼 び出すことが可能 チーム • 各リソース スタックを運用 チームが集中管理 • サービス チームは 集中管理 チームと協力してリソース の仕様や用件を調整 ポイント • 開発速度とリソース管理効 率はトレードオフの関係 P-E3 Service stack DevOps event bus Service stack
or its affiliates. [Centralized] Single-bus, multi-account pattern 47 AWS account Orange service context P-E2 S-E2 S-E2 P-E1 S-E1 Purple service context Blue service context AWS account AWS account AWS account S-E3 特徴 • AWS アカウントの境界を除 いてアーキテクチャは同一 チーム • イベント バス リソース ス タックは「DevOps」チーム によって管理されます • サービス チームは DevOps チームと協力してリソース のニーズを調整します ポイント • 開発速度とリソース管理効 率はトレードオフの関係 P-E3 Orange service team Service stack E1 rule DevOps team Event bus stack E2 rule E3 rule DevOps event bus Blue service team Service stack Purple service team Service stack
or its affiliates. [Centralized] Single-bus*, multi-account pattern 48 AWS account Orange service context P-E2 S-E2 S-E2 P-E3 P-E1 S-E1 Blue service context AWS account AWS account AWS account 特徴 • アカウント間でイベントを転 送するために複数のイベント バスが必要になる • ルーティング ルールは引き 続き中央バス経由 • ターゲット、ルールはサービ スアカウントのイベントバス に移行 チーム • サービスチームはターゲット 構成を管理しますが、ルー ティングは管理しません ポイント • クロスアカウントのポリシー 管理が必要 S-E3 Purple service context Blue service team Service stack Orange service team Service stack E1 rule DevOps team Event bus stack E2 rule E3 rule DevOps event bus Purple service team Service stack
or its affiliates. [Distributed] Multi-bus, single account pattern 50 Blue service context Orange service context P-E2 S-E2 S-E2 P-E3 P-E1 S-E1 Purple service context AWS account E1 rule E3 rule E2 rule Orange service event bus Purple service event bus Blue service event bus 特徴 • サービスチームが所有する 複数のイベントバス • 集中ルーティングなし チーム • チームはサービス イベント バスを管理します • サービスチームは互いに協 力してリソース資料を調整 ポイント • アプリケーションとチーム の自律性の向上 • 開発速度の向上 S-E3 Blue service team Service stack Orange service team Service stack Purple service team Service stack
or its affiliates. [Distributed] Multi-bus, multi-account pattern 51 Blue service context Orange service context P-E2 S-E2 S-E2 P-E3 P-E1 S-E1 Purple service context AWS account E1 rule E3 rule E1 rule Purple service event bus Blue service event bus E2 rule E2 rule AWS account AWS account E2 rule E2 rule 特徴 • AWS アカウントの境界を除 いて、アーキテクチャは同一 • クロスアカウントのイベント 配信を促進するために追加の バスは必要ありません チーム • サービス チームは、サービス イベント バスと、イベントを 送受信するためのすべてのリ ソースを管理します。 ポイント • 分散ルールを管理する際の追 加のオーバーヘッド S-E3 E3 rule Blue service team Service stack Orange service team Service stack Purple service team Service stack Orange service event bus
or its affiliates. クロスアカウントループ/ Bus ホッピング 53 Blue service context P-E1 S-E1 Purple service context AWS account E1 rule DevOps event bus Blue service event bus AWS account AWS account Blue service event bus E1 rule E1 rule Blue service team Purple service team Amazon EventBridge は推移的ルーティングしてしまう懸念はない
or its affiliates. クロスアカウントループ/ Bus ホッピング 54 Blue service context P-E1 S-E1 Purple service context AWS account E1 rule AWS account AWS account E1 rule E1 rule AWS Lambda Blue service team Purple service team DevOps event bus Blue service event bus Blue service event bus Amazon EventBridge は推移的ルーティングしてしまう懸念はない Bus はプロキシ (AWS Lambda など) によって再発行することにより、推移ホップさせることも可能
or its affiliates. Event bus resource policy - PutRule Give Purple Team account permissions to create rules on “DevOps” event bus. Limit to rules that match against the “E2” event from “com.purple.service”
or its affiliates. Give Purple Team account permissions to publish events to “DevOps” event bus. Only allow the Purple Team to publish “E2” events from “com.purple-service.context” Event bus resource policy - PutEvents
or its affiliates. Give any account permissions to publish events to “DevOps” event bus. Limit publishing to accounts in the “o- a1b2c3d4e5” organization, and that are also tagged as “Production” accounts. Event bus resource policy – organizations & tags