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

ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論

Infrastructure as Code という言葉は、アプリとインフラを別のものと捉え、コードへ翻訳する認識を残しています。AWS CDK では、インフラはソフトウェアの第一級の構成部品であり、通常のモジュールと同じようにソフトウェア設計に溶け込みます。AI 駆動開発が職能やチーム、開発プロセスを再構築する今、重要なのはソフトウェア全体を評価し、自分事として所有することです。本セッションでは AWS CDK の哲学を起点として、現代のインフラ認識論を再定義します。

AWS CDK Conference Japan 2026 の登壇資料です。

Avatar for Kenji Kono

Kenji Kono

July 18, 2026

More Decks by Kenji Kono

Other Decks in Programming

Transcript

  1. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ソフトウェア設計に溶けるインフラ AWS CDK のインフラ認識論 Kenji Kono シニア ソリューション アーキテクト アマゾン ウェブ サービス ジャパン合同会社 2026/7/18
  2. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 東海から⻄の製造業のお客様を技術的にご⽀援 AI 駆動開発や Infrastructure as Code (IaC) など 開発者ツールのエキスパート @konokenj こ う の け ん じ ⾼野 賢司 シニア ソリューション アーキテクト @名古屋 アマゾン ウェブ サービス ジャパン合同会社 今⽇のテーマ • 私が Infrastructure as Code をどう認識しているか • 認識の違いがどのような効果をもたらすか
  3. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 3 AWS CDK について 最後に考えたのは いつですか︖
  4. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 4 AWS CDK についてずっと考えてきました AWS Summit Japan 2022 AWS Black Belt (2023) AWS Summit Japan 2025 AWS Summit Japan 2024 AWS Summit Japan 2026 AWS Dev Day 2023 ※ ほかにも AWS Developer Live Show, JAWS-UG などたくさんあります
  5. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 5 AWS CDK についてずっと考えてきました AWS Summit Japan 2022 AWS Black Belt (2023) AWS Summit Japan 2025 AWS Summit Japan 2025 AWS Summit Japan 2026 AWS Dev Day 2023 IaC の概念を 具体を通して伝える CDK のベスト プラクティスを探す CDK を仕組みから 理解する CDK を中⼼に AI のコンテキストを作る CDK をチーム・組織の つながりの設計に使う AI 駆動開発の叡智は 型として伝え、学ぶもの
  6. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 6 Kiro と Amazon の⽂化から学ぶ AI 駆動開発の型 AWS Summit Japan 2026 AI の技術やツールよりも、⼈間の認識や学び、 ⽅法論としての型に焦点を当てたセッションです • オンデマンド配信 https://aws.amazon.com/jp/events/summits/japan/ • 資料 https://pages.awscloud.com/rs/112-TZM-766/images/R05_0625_DVT324_v2.pdf
  7. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 7 AWS CDK についてずっと考えてきましたが、 私の関⼼は CDK そのもの から CDK で作るソフトウェアの設計 に移りました この認識の変化は何を意味するのでしょうか︖
  8. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AI コーディングエージェントは ⼗分な品質で開発タスクの⼀部を完遂できる エンジニアはコードに注意を払いながらも 意図の伝達や設計に関⼼をシフトしつつある コードを書く主体は AI になった 3 4 AI エージェントによる ⾃律的なコード探索、編集、テスト AI エージェントによる ⻑時間の⾃動運転、⼈間の意図の補完 実⽤化済み
  9. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Dr. Werner Vogels - CTO, Amazon AWS re:Invent 2025 You build it, you own it.
  10. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. どのように作るか。 ソフトウェアには無数の選択とトレードオフがある You build it, どのように所有するか。 ソフトウェアはすぐに⼤きく、不透明になる you own it. インフラをソフトウェア設計のパレットに置き、 インフラを他⼈事にしないために CDK がある
  11. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AWS CDK のインフラ認識論 11
  12. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 12 みなさんは Infrastructure as Code を どのような形で 捉えていますか︖
  13. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 13 アプリ インフラ Infrastructure as Code インテグリティ的認識 (Thomas Kasulis) 独⽴した要素を外的な関係(線)でつなぐ捉え⽅
  14. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 14 アプリ インフラ アプリとインフラは独⽴して⾒えるが、 ⽚⽅だけではソフトウェアとして価値を提供できない
  15. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 15 アプリ インフラ Infrastructure as Code アプリ(コード)とインフラのいずれかが⽋けると Infrastructure as Code の存在意義はなくなる
  16. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. アプリ インフラ 16 Infrastructure as Code インティマシー的認識 (Thomas Kasulis) 要素が重なり合う内的な関係で、不可分なものとする捉え⽅
  17. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 17 インテグリティ的認識 インティマシー的認識 ⼈間は同時に どちらか⼀⽅の認識モード しか使えない
  18. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 18 アプリ インフラ ソフトウェア アプリとインフラ ではなく ひとつの ソフトウェア として 捉えるのが CDK の認識
  19. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 19 CDK Construct = ソフトウェアモジュール const bucket = new s3.Bucket(this, 'MyBucket'); const user = new iam.User(this, 'MyUser'); bucket.grantRead(user); AWS CDK (TypeScript) CDK においてコンストラクトは • クラウドリソースを表現するクラスであり • import / new でき、名前をつけ、渡せる値であり • モジュール化、カプセル化できる ソフトウェアの第⼀級市⺠ CDK ではインフラはソフトウェアである
  20. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 20 なぜ Amazon は AWS CDK を作ったか︖ Amazon.com の検索システムを再構築し トレンド商品をリアルタイムに特定したい。 AWS CloudFormation で構築していたが・・・ • 複数のチームが独⽴して開発・デプロイ可能に するためにモジュール化したい • 繰り返し複雑なものを作成することを 避けるために抽象化したい • JSON や YAML のような設定⾔語よりも ⾃分たちのアイデアを表現できる⾔語を使いたい https://www.youtube.com/watch?v=AYYTrDaEwLs これらの課題を解決するために作成された オブジェクト指向ライブラリが AWS CDK の起源。 AWS の社内で CDK はデファクトスタンダードになった
  21. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 21 ソフトウェアの要求と認識モードの関係 ⼦ども向け絵本⾃動⽣成チャットボット ComfyUI サーバー作成 / API 実⾏も可能 aws-samples/serverless-full-stack-webapp-starter-kit で構築 1 / 5 • 趣味のアプリなので 固定のインフラコストをゼロにしたい • GPU で画像⽣成したい • 全体のコード量とデプロイ時間を最⼩化したい 要求
  22. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 22 ソフトウェアの要求と認識モードの関係 VPC 内に ⼊れない 2 / 5 ECS on EC2 (GPU インスタンス) の 画像⽣成サーバーに VPC 外の Lambda から到達できない 課題
  23. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 23 ソフトウェアの要求と認識モードの関係 SQS 経由で VPC に⼊る 3 / 5 SQS + VPC Lambda で⾮同期化 解決策 • 画像⽣成は 30-60 秒かかるため ソフトウェア視点で⾮同期化が適切だった • ALB の固定料⾦、タイムアウトを回避 • Lambda イメージのビルド時間の増加を cdklabs/deploy-time-build で回避 ※ EventBridge Connection + VPC Lattice も タイムアウト 60 秒 / レスポンスサイズ制約で 使えなかった
  24. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 24 ソフトウェアの要求と認識モードの関係 IPv6 で 到達できない 4 / 5 課題 VPC に NAT Gateway がないため VPC Lambda が AppSync Events に 完了通知を送信できない
  25. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 25 ソフトウェアの要求と認識モードの関係 帰りも SQS 経由 5 / 5 解決策 帰りも SQS + Lambda で⾮同期化 • VPC Lambda (画像⽣成) から通知の責務を 分離でき、通知に失敗 = 再⽣成を回避 • VPC Lambda でも IPv6 Egress Only IGW で S3, DSQL 等には通信できるため 同様の worker が増える可能性は低いと判断 • NAT Gateway / VPC Endpoint / IPv4 アドレスの固定料⾦を回避
  26. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 26 ソフトウェアの要求と認識モードの関係 アプリ インフラ ソフト ウェア Lambda や SQS はインフラ側。 ネットワークの問題は インフラで解決してほしい。 キューを挟めば解決できるが、 アプリのデータや責務の分解は 考えたくない。 Lambda や SQS は⾃分で管理。 コストとコードの複雑性の 両⽅で適切な構造は何か︖ キューを挟めば解決できるが、 キューに⼊れるデータや Lambda の責務はどうしよう︖ VPC 外→中 / 中→外 の通信を固定コストを抑えて実現したいが… ⼀⼈でもチームでも、領域に分けずに総合的に考えたほうが よい選択肢が⾒つかる
  27. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 道具としての IaC の認識 27
  28. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AWS Cloud Development Kit (CDK) 使い慣れたプログラミング⾔語で クラウドリソースを定義できる オープンソースのフレームワーク
  29. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 29 ハイデガーの道具分析 アプリ インフラ ソフトウェア 眼前的 ⼿許的(透明) うまく機能する道具は意識から消え ⼈は対象を直接捉える 解読すべき対象物として ⽬の前に⽴ちはだかる
  30. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 30 道具の透明性は⾃分ごと化の条件 眼前的 ⼿許的(透明) Resources: MyBucket: Type: AWS::S3::Bucket MyUser: Type: AWS::IAM::User MyUserPolicy: Type: AWS::IAM::Policy Properties: PolicyDocument: Statement: - Action: - s3:GetObject* - s3:GetBucket* - s3:List* Effect: Allow Resource: - Fn::GetAtt: [ MyBucket, Arn ] - Fn::Sub: "${MyBucket.Arn}/*" Version: "2012-10-17" PolicyName: MyUserPolicy Users: - Ref: MyUser AWS CloudFormation (YAML) const bucket = new s3.Bucket(this, 'MyBucket'); const user = new iam.User(this, 'MyUser'); bucket.grantRead(user); AWS CDK (TypeScript) 使い慣れたプログラミング⾔語で クラウドリソースを定義できる 固有の⾔語、アプリと異なる作法で クラウドリソースを定義できる
  31. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 31 レビューは意図的な眼前化 Amazon S3 へのバックアップアプリの CloudFormation テンプレートの例: • 3x Amazon S3 バケット • 1x AWS IAM ユーザー + ポリシー • 1x AWS IAM ロール • 1x AWS Chatbot チャネル設定 • 1x Amazon SNS トピック 約 450 ⾏ (コメント含む) 平⾯的な DSL ではリソースごとの役割や関連を 把握しづらいため、 眼前に現れた道具を解読するのに労⼒が必要
  32. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 32 参考: IaC を組織で「⾃分ごと」にする⽅法 https://speakerdeck.com/geekplus_tech/i nhurawo-excel-guan-li-siteitazu-zhi-ga-3- keyue-de-iac-hua-sarerumade
  33. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. まとめ 33
  34. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AWS CDK で インフラを抽象化して ソフトウェア設計のパレットに置く You build it, Infrastructure as Code = 認識の橋を越えて アプリとインフラ ではなく ソフトウェア として認識する ― Everything as Code への昇華 AWS CDK という透明な道具で インフラを直接捉え、所有する you own it.
  35. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Thank you! © 2026, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Kenji Kono @konokenj