Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AI が開発・運用しやすいクラウド 〜サーバーレスの視点から考える設計原則〜 / server...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for geeawa geeawa
July 30, 2026
3

AI が開発・運用しやすいクラウド 〜サーバーレスの視点から考える設計原則〜 / serverless-design-principles-for-ai-agent-era

Avatar for geeawa

geeawa

July 30, 2026

More Decks by geeawa

Transcript

  1. ©© 2026, 2026, Amazon Amazon Web Web Services, Services, Inc.

    Inc. oror itsits affiliates. affiliates. AllAll rights rights reserved. reserved.
  2. #AWS-49 AI が開発/運⽤しやすいクラウド サーバーレスの視点から考える設計原則 Daisuke Awaji Snr. Solutions Architect Amazon

    Web Services Japan G.K. © 2026, Amazon Web © 2026, Services, Amazon Inc. or Web its Services, affiliates. Inc. All rights or itsreserved. affiliates. All rights reserved.
  3. Daisuke Awaji Amazon Web Services Japan Solutions Architect @gee0awa Serverless,

    Generative AI, Frontend ❤ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5
  4. ソフトウェア開発・運⽤を AI に委譲できるか 開発者 CI/CD GitHub AWS Cloud AWS Cloud(A省

    Xシステム) 本番環境 テスト環境 GitHub Issue / PR (機能追加リクエスト) 要件定義 バックログ管理 開発エージェント エンドユーザー ヒアリング ログ・メトリクス・アラート ・・・ 運⽤エージェント 実装・テスト セキュリティ レビュー GitHub Issue / Pull Request 起票 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 異常検知 原因特定 是正措置 傾向分析
  5. ソフトウェア開発・運⽤を AI に委譲できるか AWS Cloud AWS Cloud(A省 Xシステム) AI エージェントにとって開発・運⽤しやすくするには

    クラウドの構成やソフトウェアをどう設計すべきか︖ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  6. Multi-agent Orchestration Chat on AgentCore Bedrock AgentCore で稼働する AI エージェントの

    OSS サンプル – 通称 MOCA プロンプトやツールをカスタマイズし、コーディングエージェントや運⽤エージェントも作れる パソコンでもスマホでも (モバイルフレンドリーなチャットUIのサンプルとして) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. AI エージェントを作る (システムプロンプト・ツールを組み合わせて) https://github.com/aws-samples/sample-multi-agent-orchestration-chat-on-agentcore
  7. Multi-agent Orchestration Chat on AgentCore Bedrock AgentCore で稼働する AI エージェントの

    OSS サンプル – 通称 MOCA プロンプトやツールをカスタマイズし、コーディングエージェントや運⽤エージェントも作れる パソコンでもスマホでも (モバイルフレンドリーなチャットUIのサンプルとして) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. AI エージェントを作る (システムプロンプト・ツールを組み合わせて) https://github.com/aws-samples/sample-multi-agent-orchestration-chat-on-agentcore
  8. コンテキストロット(腐敗) T すべての LLM は⼊⼒⻑・プロンプト⻑に応じて性能が劣化する 18 モデル全てで劣化を確認 Claude Sonnet 4,

    GPT-4.1, Gemini 2.5 Flash, Qwen3-32B を含む ウィンドウに余裕がある場合でも 早い段階から劣化が始まる 問題は容量ではなく、ノイズの蓄積 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 出典 : Chroma Research (2025) — 18 frontier models evaluation
  9. 何トークンから精度の壁を感じますか︖ AWS Japan の SA ロールを対象にアンケートを実施 16 14 12 10

    8 6 4 2 0 ~100K 100K~200K 200~300K © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 300K~400K Opus 4.7 Opus 4.6 400K~500K 500K~600K 劣化を感じない ※ Opus 4.7, 4.6 の最⼤コンテキストウィンドウ: 1M Token ※ このアンケートは体感ベースで、ベンチマーク値ではありません。
  10. 何トークンから精度の壁を感じますか︖ AWS Japan の SA ロールを対象にアンケートを実施 16 400K トークン 14

    程度でも劣化を感じる 12 10 8 6 4 2 0 ~100K 100K~200K 200~300K © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 300K~400K Opus 4.7 Opus 4.6 400K~500K 500K~600K 劣化を感じない ※ Opus 4.7, 4.6 の最⼤コンテキストウィンドウ: 1M Token ※ このアンケートは体感ベースで、ベンチマーク値ではありません。
  11. コンテキストウィンドウ System Prompt AGENTS.md Builtin Tools MCP Tools User message

    Read () Search () Read () ソースコード セッションの初期化 ◯◯機能を 実装する計画を⽴てて Test () … © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. model view controller infrastructure Assistant message User message Write () Lint () src/ 実装計画を⽴てました docs/ skills/ 実装を開始して︕︕ README.md AGENTS.md
  12. コンテキストウィンドウ System Prompt AGENTS.md Builtin Tools MCP Tools User message

    Assistant message Smart Zone 精度良くコーディングできる領域 400 K token(経験則、⽬安) Dumb Zone 精度が劣化する領域 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  13. コンテキストウィンドウ System Prompt AGENTS.md 不要なノイズとならない コンテキスト管理を⼼がける Builtin Tools Smart Zone

    MCP Tools 精度良くコーディングできる領域 User message Assistant message 400 K token(経験則、⽬安) Dumb Zone 精度が劣化する領域 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  14. ノイズとして取り込まれる要素の例 コンテキストウィンドウに含まれる要素はソースコードだけではない • コードベースの調査において読み込んだファイル • Lint, Build, Test, Deploy の実⾏ログ

    • 実装したソフトウェアの起動・実⾏・操作ログ • MCPサーバーから提供されるツールの結果(ウェブ検索など) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  15. セッションを要約して切り替える コンテキストウィンドウ 新しいセッション System Prompt AGENTS.md Builtin Tools MCP Tools

    System Prompt AGENTS.md Builtin Tools MCP Tools User message Assistant message 調査した結果や実装計画 圧縮したドキュメント © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. このやり⽅では 上⼿くいかなかったから こう実装して User message 調査した結果や実装計画 圧縮したドキュメント Assistant message
  16. セッションのコンパクション(圧縮) コンテキストウィンドウの限界に近づいた会話を要約し、新しいウィンドウで再開する 実装計画を⽴て、要件を整理した計画書を引き継ぎ、新しいセッションを始める Compacted Documents web_search(…) Build, Lint, Test… grep,

    find… read_file(…) か edit_file(…) カオスな会話履歴 探索のノイズ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. ノイズの フィルタリング 圧縮された ドキュメント・実装計画書
  17. 主要なシステムのコード量 1 LOC(⾏数) = 10 Token 程度ではあるが、実際には1万⾏程度でもコンテキストに収まりずらい ⼩規模 中規模 ⼤規模

    〜1万⾏ 1万〜10万⾏ 10万⾏〜 部⾨内の⼩さなウェブシステムや 単機能の Web API © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. ⼀般的な部⾨業務システム 基幹系の1サブシステム 典型的な業務システム本体 (受発注、在庫、販売管理など) 出典︓IPA「ソフトウェア開発分析データ集」に基づく概算
  18. 主要なシステムのコード量 1 LOC(⾏数) = 10 Token 程度ではあるが、実際には1万⾏程度でもコンテキストに収まりずらい 1万⾏のコードベースですら 完全に意図通りに AI

    はコーディングできない ことを前提においた戦略が必要 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  19. 全てのコンテキストを凝集する コーディングエージェントが効果的に計画・実装するには 全てのコンテキストを1つのリポジトリに凝集することが理想的 • ソースコード • IaC (Infrastructure as Code)

    のソースコード • 設定ファイル • 設計ドキュメント • エージェントのステアリングファイル © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. など
  20. Monorepo による解決策の例 インフラ定義、各種バックエンド、共有ライブラリ、テスト、CI/CD までを1つのリポジトリで管理します。 規模やフェーズに応じて判断が必要です。開発初期においては特にモノレポが⾒通しが良い場合があります。 Polyrepo Monorepo Service A repo

    Service A repo Service B repo Shared Library サービスごとに リポジトリを分割して管理する © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Service B repo Shared Library 関連するソースコードを1つの リポジトリに閉じ込める、まとめて管理する ※ AI エージェントから⾒て『近接して読める』ことが重要です。 Polyrepo でも、明⽰的なクロスリポインデックスで実現できます。
  21. Monorepo におけるディレクトリ構成の例 典型的なウェブアプリの場合(TypeScript を想定) README.md リポジトリの全体像 AGENTS.md エージェント向けのステアリングファイル skills/ エージェント向けの

    Skills (ステアリングファイルとスクリプト) docs/ 設計、特にソフトウェア構造上の意図を残す packages/ libs/ frontend/ backend/ Infra/ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 👍
  22. Monorepo におけるディレクトリ構成の例 典型的なウェブアプリの場合(TypeScript を想定) README.md リポジトリの全体像 AGENTS.md エージェント向けのステアリングファイル skills/ エージェント向けの

    Skills (ステアリングファイルとスクリプト) docs/ 設計、特にソフトウェア構造上の意図を残す packages/ libs/ 共通的なライブラリ frontend/ フロントエンド backend/ バックエンド(さらに複数のサービスに分割しても良い) Infra/ Infrastructure as Code のソースコードと設定ファイル © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 👍
  23. 実装 (動くコード) © 2026, Amazon Web Services, Inc. or its

    affiliates. All rights reserved. コード コメント ドキュメント 仕様書
  24. 実装とのズレ ハルシネーションの数 実装 (動くコード) © 2026, Amazon Web Services, Inc.

    or its affiliates. All rights reserved. コード コメント ドキュメント 仕様書
  25. ドキュメントは腐る、実装と乖離が進む 実装とのズレ ハルシネーションの数 ドキュメントだけに頼らない ソフトウェアの構造において⼯夫が必要 実装 (動くコード) © 2026, Amazon

    Web Services, Inc. or its affiliates. All rights reserved. コード コメント ドキュメント 仕様書 ※ドキュメント管理を完全に否定するものではありません。補完的な仕組みが必要です。
  26. AI が開発しやすいソフトウェアの構造を考える packages/backend 複雑に絡み合った 依存関係 © 2026, Amazon Web Services,

    Inc. or its affiliates. All rights reserved. 過度に Mock 化された テストコードが⽣成される
  27. インターフェースはシンプルに、 機能は深く(複雑な処理を内部に隠蔽する) 設計することで、全体の複雑性を減らす John Ousterhout A Philosophy of Software Design,

    2nd Edition – ソフトウェア設計の哲学 - © 2026, Amazon Web © 2026, Services, Amazon Inc. or Web its Services, affiliates. Inc. All rights or itsreserved. affiliates. All rights reserved.
  28. Deep Module の良い例 – Unix File I/O 適切に抽象化されたインターフェースは利⽤者の認知負荷が低く、複雑性の低いモジュール フラグ READ/WRITE

    を指定 ファイルパス どのファイルシステムかは気にしなくて良い © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. ※ mode オプションは省略しています。
  29. アーキテクチャの不変条件を強制する 依存できる インターフェース / 型定義だけでは強制できない 構造的なルールに対して制約を設ける 制約はドキュメントではなく、 リンターや構造テストによって機械的に適⽤する 例) Node.js

    eslint-plugin-boundaries Java ArchUnit など Config Handler Service Repository ❌ データベースや外部の API には Repository から接続する © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  30. 型表現の強化(TypeScript の場合) オブジェクト指向プログラミングにおける Value Object でも良い。 「ただの string ではなく、検証済みの UserId

    だ」と型レベルでコーディングエージェントに伝える © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  31. インターフェースの境界は パッケージやクラス、関数だけでしょうか︖ © 2026, Amazon Web © 2026, Services, Amazon

    Inc. or Web its Services, affiliates. Inc. All rights or itsreserved. affiliates. All rights reserved.
  32. Web API としてのインターフェース Web API = Web Application Programming “Interface”

    Client © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Web API Backend
  33. Web API における Deep Module の例 – S3 適切に抽象化されたインターフェースは、認知負荷の低い複雑性の低いモジュール S3

    API s3.put_object( Bucket=“yourbucket”, Key=“key”, Body=data ) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 認証 + TLS 終端 ルーティング + ロードバランシング データ分割、整合性検証 暗号化(SSE) 複製、耐久性保証 メタデータの更新 イベント発⽕ など
  34. Git 管理するドキュメントには何を書くべきか︖ ソフトウェアの構造を⼯夫して、AI の可読性を向上させる。 特に、読んでわからない⽂脈や意思決定の背景をドキュメントに残す。 WHAT 現在の振る舞い HOW どう動くか WHEN,

    WHO いつ誰が WHY, WHY NOT なぜそうなっているか 情報の種類 Source of Truth 型・API・スキーマ・テーブル定義 インターフェース、型、 OpenAPI Spec、テストコード アルゴリズム・実装の詳細 コード 変更の事実 Git のログ 意思決定の⽂脈、棄却された選択肢 コードコメント、ドキュメント © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. (特にアーキテクチャ決定レコードなど)
  35. インターフェースは「認知できて、制御できる」境界 各インターフェースで隠蔽してきたもの サーバーレスは AI の認知的な資源 “コンテキスト” を 命令と⼿続き 本質的な設計判断に使わせる 状態と振る舞い

    関数 クラス モジュール 内部実装と依存 Web API プロセス・⾔語・インフラストラクチャ © 2026, Amazon Web Services, Inc. or its affiliates. affiliates. All rights reserved.
  36. 各パッケージにおいて考慮するポイント ここまでのまとめ – “インターフェースは最⼤のコンパクション” • “薄い”インターフェースと、”深い”実装 適切なモジュール境界を⾒極めて分割する。 ドキュメントには WHY, WHY

    NOT を記す。 • モジュール単位に機能凝集されたテストコード 不必要なモックを避け、外部依存度の低いロジックをテストする。 • 決定論的な仕掛けで AI にフィードバックする アーキテクチャの不変条件、依存の向き、強化された型情報を検証する。 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  37. サーバーレスの開発者体験を考える Amazon API Gateway © 2026, Amazon Web Services, Inc.

    or its affiliates. All rights reserved. AWS Lambda Amazon DynamoDB
  38. サーバーレスの開発者体験を考える 単⼀の Lambda Function には どれくらいのコード量を載せるべきか event Amazon API Gateway

    © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda Amazon DynamoDB handler 関数をどのようにテストするか︖
  39. サーバーレスの開発者体験を考える 単⼀の Lambda Function には どれくらいのコード量を載せるべきか event Amazon API Gateway

    AWS Lambda Amazon DynamoDB 外部依存するコードは どうユニットテストするか︖ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. handler 関数をどのようにテストするか︖
  40. Lambda 特有のコード例 Lambda 特有のコード例 クエリパラメータから userId を受け取り、データを取得して返す エントリポイントが handler event

    の構造が独⾃ 外部に依存するコードを ベタ書きしがち © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  41. Lambda 固有の記法を減らし、 ローカルで⾼速に開発・テストを⾏いたい © 2026, Amazon Web © 2026, Services,

    Amazon Inc. or Web its Services, affiliates. Inc. All rights or itsreserved. affiliates. All rights reserved.
  42. Lambda Web Adapter Lambda で Web アプリを実⾏するための OSS ツール、 Rust

    製の Lambda Extension 2026/03/28 に v1.0.0 がリリース • Lambda ランタイム API の汎⽤アダプター event http • 関数本体コードの依存関係はない • あらゆる Web フレームワークをサポート • あらゆるプログラミング⾔語をサポート Lambda Web Adapter • 既存のツールを使⽤して • ローカルで開発 https://github.com/awslabs/aws-lambda-web-adapter © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. • ローカルでテスト
  43. Node.js アプリでの使⽤例 Lambda Web Adapter をインストールするには Dockerfile に1⾏追加するだけ コンテナイメージは Lambda

    以外の環境でもそのまま利⽤できる Install lambda web adapter を追加するだけ︕ ※ Docker 形式に限らず、 Zip 形式のアップロードでも Lambda Web Adapter を使⽤できます。 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. https://github.com/aws/aws-lambda-web-adapter
  44. フィードバックループを⾼速化する LWA コーディングエージェントは Lambda を意識する必要がなくなり、ビジネスロジックの実装に集中できます。 (Lambda 特有の event, context など)

    • エミュレータ不要のローカル起動 ホットリロードもフレームワークの仕組みで⾃由に構築できる • テスト⽣成・実⾏ HTTP リクエストを介するテストフレームワークが採⽤できる Node.js なら supertest, ⼈が実⾏するなら Postman など • イテレーションの⾃律化 ローカル起動、リクエスト送信、結果確認のループをエージェントが単独で回せる フロントエンドもローカルで起動すれば UI の操作を含めてエージェントに委譲できる ※ ⼩さなコードや軽量な処理、関数単位にデプロイしたい場合、ウェブフレームワークに対する依存を嫌う場合は LWA は推奨しません。 AWS SAM Local なども併⽤して軽量な構成で実装しても同様の開発しやすい構造が⼿に⼊ります。全てはトレードオフ、私は AWS SAM が⼤好きです。 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  45. フィードバックループを⾼速化する LWA コーディングエージェントは Lambda を意識する必要がなくなり、ビジネスロジックの実装に集中できます。 (Lambda 特有の event, context など)

    • エミュレータ不要のローカル起動 ホットリロードもフレームワークの仕組みで⾃由に構築できる • テスト⽣成・実⾏ HTTP リクエストを介するテストフレームワークが採⽤できる Node.js なら supertest, ⼈が実⾏するなら Postman など • イテレーションの⾃律化 ローカル起動、リクエスト送信、結果確認のループをエージェントが単独で回せる フロントエンドもローカルで起動すれば UI の操作を含めてエージェントに委譲できる ※ ⼩さなコードや軽量な処理、関数単位にデプロイしたい場合、ウェブフレームワークに対する依存を嫌う場合は LWA は推奨しません。 AWS SAM Local なども併⽤して軽量な構成で実装しても同様の開発しやすい構造が⼿に⼊ります。全てはトレードオフ、私は AWS SAM が⼤好きです。 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  46. Lambda 関数には どの程度のコード量を凝集すべきか © 2026, Amazon Web © 2026, Services,

    Amazon Inc. or Web its Services, affiliates. Inc. All rights or itsreserved. affiliates. All rights reserved.
  47. Lambda 関数に何を含めるべきか /* Client /getuser /getusers /getproduct /getproducts /createuser /createproduct

    /updateuser /updatepoduct /deleteuser /deleteproduct DynamoDB API Gateway Routing logic in function “Lambda-lith” © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  48. Lambda 関数に何を含めるべきか /* Client /getusers /getproduct /getuser /getusers /getproduct /getproducts

    /createuser /createproduct /updateuser /updatepoduct /deleteuser /deleteproduct /getproducts /createuser /createproduct DynamoDB API Gateway /getuser Client API Gateway /updateuser DynamoDB /updateproduct Routing logic in function /deleteuser /deleteproduct “Lambda-lith” © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. “Micro Lambda”
  49. Lambda 関数に何を含めるべきか /getuser /getusers /createuser /updateuser /deleteuser グループ化の例 • •

    • • • • • 境界付けられたコンテキスト 開発組織の構造 IAMパーミッションのスコープ 共通的なコードの依存関係 配下のリソースとの依存関係 初期化時間とコールドスタート メモリ割り当て Client API Gateway /getproduct /getproducts /createproduct /updateproduct /deleteproduct DynamoDB (User) DynamoDB (Product) “Pragmatic Lambda” © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. ※境界づけられたコンテキストで分割した例
  50. Monorepo の package 単位でデプロイする README.md / AGENTS.md packages/ user-service/ /getuser

    /getusers /createuser /updateuser /deleteuser src/ index.ts etc.. product-service/ src/ index.ts etc.. /getproduct /getproducts /createproduct /updateproduct /deleteproduct DynamoDB (User) types/ libs/ ・・・ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. DynamoDB (Product)
  51. Monorepo の package 単位でデプロイする README.md / AGENTS.md packages/ user-service/ マイクロサービスとして

    独⽴したデプロイできる Deploy /getuser /getusers /createuser /updateuser /deleteuser src/ index.ts etc.. import product-service/ src/ index.ts etc.. /getproduct /getproducts /createproduct /updateproduct /deleteproduct DynamoDB (User) types/ libs/ ・・・ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. DynamoDB (Product)
  52. Monorepo の package 単位でデプロイする README.md / AGENTS.md packages/ user-service/ マイクロサービスとして

    独⽴したデプロイできる Deploy /getuser /getusers /createuser /updateuser /deleteuser src/ index.ts etc.. product-service/ src/ import Deploy index.ts etc.. types/ libs/ ・・・ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. モノレポの利点を活かす インターフェースや共通処理を 参照して実装可能 /getproduct /getproducts /createproduct /updateproduct /deleteproduct DynamoDB (User) DynamoDB (Product)
  53. HTTP 以外のトリガーにも対応 Lambda Web Adapter は、SQS、SNS、S3、DynamoDB、Kinesis、Kafka、EventBridge など、 HTTP 以外のすべてのイベントトリガーをサポートしています。 event

    環境変数 AWS_LWA_PASS_THROUGH_PATH=/events AWS Lambda Amazon SQS event Amazon S3 AWS Lambda event Amazon DynamoDB AWS Lambda © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. HTTP POSTリクエストを使⽤して、設定可能なパス(デフォルト /events)に ⽣のイベントペイロードを Webアプリケーション に転送します。
  54. DynamoDB などの外部依存するコードは どうテストするか︖ © 2026, Amazon Web © 2026, Services,

    Amazon Inc. or Web its Services, affiliates. Inc. All rights or itsreserved. affiliates. All rights reserved.
  55. DynamoDB Local Docker や JVM で起動する DynamoDB のローカルエミュレータ ロジックの検証は DynamoDB

    Local で⾼速にテストする。 IAM 認可など、統合テストはクラウド環境の DynamoDB も併⽤する。 const client = new DynamoDBClient({ endpoint: "http://localhost:8000", … }); クラウドの DynamoDB にアクセスせずに ローカル / CI環境 で⾼速にテスト可能に 例)http://localhost:8000 で起動 アプリケーション (ローカル環境) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon DynamoDB Local (ローカル環境) https://hub.docker.com/r/amazon/dynamodb-local
  56. サーバーレスの開発者体験を考える 単⼀の Lambda Function には どれくらいのコード量を載せるべきか “Pragmatic Lambda” コンテキスト境界やリソース権限など Amazon

    API Gateway LWA で Web フレームワークと 同様のテスト戦略を適⽤する AWS Lambda Amazon DynamoDB DynamoDB Local で モックテストの乱⽴を防ぐ 外部依存するコードは どうユニットテストするか︖ © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. handler 関数をどのようにテストするか︖
  57. クラウドを運⽤する AI エージェント 従来の運⽤⾃動化(Runbook や 監視ツール)を超えて、 ⾃律的に観測・判断・実⾏・学習し、運⽤業務を担う 観測 判断 実⾏

    学習 クラウドリソースの テレメトリの収集 仮説⽣成と検証 根本原因の特定 インフラ設定の変更 コードの修正 過去のインシデント 対処履歴 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  58. 機械的な運⽤と、⾃律的な運⽤ 考えなくても即座に反応すべき事はクラウドネイティブな仕組みに任せ、 運⽤エージェントは「⼈間の判断が必要な領域を、⼈間より先に準備する」 担当 クラウドの 機械的運⽤ マネージドサービス ⾃律的運⽤ 運⽤エージェント ©

    2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 動作 例 決定論的 即時反応 オートスケーリング、 フェイルオーバー、 レート制限など 推論的 ⼈間の介在を求める ログ、メトリクスなど の各種テレメトリを観 測、判断し、設定変更 の Pull Request を起票 する
  59. 運⽤エージェントが必要とするコンテキスト • ランタイムテレメトリ AWS Cloud AWS Cloud(A省 Xシステム) ログ・メトリクス・トレース・アラート •

    アーキテクチャ情報 サービス境界・依存関係・IaC(CDK) • 設計意図 SLO・アラートの閾値・リトライ戦略 • 運⽤の記憶 過去のインシデント履歴・ランブック ログ・メトリクス・アラート 運⽤エージェント 異常検知 原因特定 傾向分析 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  60. 現実世界のサーバーレスアーキテクチャ Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon S3

    AWS Lambda Amazon SQS AWS Lambda 運⽤エージェント © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  61. 現実世界のサーバーレスアーキテクチャ 分散されたログが CloudWatch Logs/Metrics Amazon API Gateway AWS Lambda 全てのテレメトリを

    調査するとコンテキスト ウィンドウが⾜りない 💦 CloudWatch Logs/Metrics CloudWatch Logs/Metrics Amazon DynamoDB Lambda の⾔語が違うと ログの構造もバラバラに AWS Lambda 運⽤エージェント © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon SQS CloudWatch Logs/Metrics トレースできない Amazon S3 サービスの境界は どこ︖ AWS Lambda CloudWatch Logs/Metrics CloudWatch Logs/Metrics
  62. 運⽤エージェントが必要とするコンテキスト • ランタイムテレメトリ AWS Cloud AWS Cloud(A省 Xシステム) ログ・メトリクス・トレース・アラート •

    アーキテクチャ情報 サービス境界・依存関係・IaC(CDK) • 設計意図 SLO・アラートの閾値・リトライ戦略 • 運⽤の記憶 過去のインシデント履歴・ランブック ログ・メトリクス・アラート 運⽤エージェント 異常検知 原因特定 傾向分析 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  63. 運⽤エージェントが必要とするコンテキスト 運⽤しやすい構造や 仕組みを整える必要がある • ランタイムテレメトリ AWS Cloud AWS Cloud(A省 Xシステム)

    ログ・メトリクス・トレース・アラート • アーキテクチャ情報 サービス境界・依存関係・IaC(CDK) • 設計意図 SLO・アラートの閾値・リトライ戦略 • 運⽤の記憶 過去のインシデント履歴・ランブック ログ・メトリクス・アラート 運⽤エージェント 異常検知 原因特定 傾向分析 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  64. エージェントから⾒た運⽤しやすい構造 依存関係のある 全てのログ、メトリクスが 探索可能であること © 2026, Amazon Web Services, Inc.

    or its affiliates. All rights reserved. サービス間の アーキテクチャ境界が 明確であること コンテキストロット しない領域(トークン数) で作業ができること
  65. サーバーレスにおける可観測性の勘所 Logs / Metrics / Traces を トレースID でつなぐ Logs

    を構造化して相関 ID でつなぐ サービス境界ごとに CloudWatch Log グループを分離する JSON 形式に構造化し、トレースID、ユーザーIDを含める Metrics をビジネス指標に CloudWatch 標準メトリクスに加えて、 EMF(Embedded Metric Format)でビジネス的な KPI も出⼒する Traces でボトルネックを可視化 分散されたコンポーネントをトレースし、コールドスタート、スロットリング、 ダウンストリームのレイテンシのボトルネックを特定する (CloudWatch / AWS X-Ray の機能を集約した CloudWatch Application Signals などを活⽤) © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  66. Lambda Powertools によるメトリクス収集 • JSON 形式の 構造化されたログ • AWS X-Ray

    統合による 分散トレース • コンテキスト情報を持つ カスタムメトリクス © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  67. Lambda Powertools によるメトリクス収集 • JSON 形式の 構造化されたログ • AWS X-Ray

    統合による 分散トレース サービス境界を明⽰する • コンテキスト情報を持つ カスタムメトリクス © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  68. ソフトウェア開発・運⽤を AI に委譲できるか 開発者 CI/CD AWS Cloud AWS Cloud(A省 Xシステム)

    GitHub 本番環境 テスト環境 GitHub Issue / PR (機能追加リクエスト) 要件定義 バックログ管理 開発エージェント エンドユーザー ヒアリング ログ・メトリクス・アラート ・・・ 運⽤エージェント 実装・テスト セキュリティ レビュー GitHub Issue / Pull Request 起票 © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. 異常検知 原因特定 是正措置 傾向分析
  69. AI が開発/運⽤しやすいクラウドの設計原則 Key Takeaway - コンテキストの圧縮を、ドキュメントだけでなく、アーキテクチャで実現する • コンテキストロット ノイズの蓄積により精度は落ちる前提を受け⼊れる •

    Pragmatic Lambda / Architecture Package や Lambda を実⽤的で AI が管理可能な粒度で分割する • インターフェース・コンパクション サービス間の境界をインターフェースだけを読めばわかる状態を設計する • エージェント・オブザーバビリティ 運⽤エージェントの⽬線でログ・メトリクスのサービス境界を設計する © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  70. AI が開発/運⽤しやすいクラウドの設計原則 Key Takeaway - コンテキストの圧縮を、ドキュメントだけでなく、アーキテクチャで実現する • コンテキストロット ノイズの蓄積により精度は落ちる前提を受け⼊れる •

    Pragmatic Lambda / Architecture Package や Lambda を実⽤的で AI が管理可能な粒度で分割する • インターフェース・コンパクション サービス間の境界をインターフェースだけを読めばわかる状態を設計する • エージェント・オブザーバビリティ 運⽤エージェントの⽬線でログ・メトリクスのサービス境界を設計する © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  71. AI が開発/運⽤しやすいクラウドの設計原則 Key Takeaway - コンテキストの圧縮を、ドキュメントだけでなく、アーキテクチャで実現する • コンテキストロット ノイズの蓄積により精度は落ちる前提を受け⼊れる •

    Pragmatic Lambda / Architecture Package や Lambda を実⽤的で AI が管理可能な粒度で分割する • インターフェース・コンパクション サービス間の境界をインターフェースだけを読めばわかる状態を設計する • エージェント・オブザーバビリティ 運⽤エージェントの⽬線でログ・メトリクスのサービス境界を設計する © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  72. Thank you Please complete the session survey © 2026, Amazon

    Web © 2026, Services, Amazon Inc. or Web its Services, affiliates. Inc. All rights or itsreserved. affiliates. All rights reserved.