Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS Outposts を AWS CDK で管理する話
Search
[email protected]
March 28, 2022
Programming
0
520
AWS Outposts を AWS CDK で管理する話
AWS Outposts で動くリソースを CDK と terraform の両方で管理した内容について発表しました
[email protected]
March 28, 2022
Tweet
Share
More Decks by
[email protected]
See All by
[email protected]
NetBox をオンプレミスから AWS へ移してみた
moba
0
1.1k
AWS CDKでもMacを 管理したい
moba
0
560
AWS Outposts 上のリソースを CDK する
moba
0
1.2k
Other Decks in Programming
See All in Programming
Patterns of Patterns
denyspoltorak
0
390
はじめてのカスタムエージェント【GitHub Copilot Agent Mode編】
satoshi256kbyte
0
130
[AI Engineering Summit Tokyo 2025] LLMは計画業務のゲームチェンジャーか? 最適化業務における活⽤の可能性と限界
terryu16
1
110
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
540
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
220
GISエンジニアから見たLINKSデータ
nokonoko1203
0
190
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
780
Navigating Dependency Injection with Metro
l2hyunwoo
1
200
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
4.6k
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.1k
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
180
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
130
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
6.7k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
130
Evolving SEO for Evolving Search Engines
ryanjones
0
89
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
100
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
410
How to train your dragon (web standard)
notwaldorf
97
6.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
400
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
100
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
170
Balancing Empowerment & Direction
lara
5
830
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Transcript
© NTT Communications Corporation All Rights Reserved. AWS Outposts を
AWS CDK で管理する話 NTT Communications 株式会社
© NTT Communications Corporation All Rights Reserved. 2 目次 •
自己紹介 • 扱うサービスについて • そのサービスで IaC する方法 ◦ CDK ◦ Terraform • まとめ
© NTT Communications Corporation All Rights Reserved. 3 自己紹介 •
名前: 福田優真 • 所属: NTT Com イノベーションセンター ◦ 主にクラウドまわりをやってます ▪ マルチクラウド ▪ ハイブリッドクラウド
© NTT Communications Corporation All Rights Reserved. 4 宣伝 •
ニュースリリース出てます ◦ 国内初、「AWS Outposts」に 自社データ分析ツールを組み 込んだソリューションを開発 • 発表で取り扱う内容についての ブログ書きました
© NTT Communications Corporation All Rights Reserved. 5 本題
© NTT Communications Corporation All Rights Reserved. 6 要約 今回は
AWS Outposts を IaC する話
© NTT Communications Corporation All Rights Reserved. 7 AWS Outposts
© NTT Communications Corporation All Rights Reserved. 8 AWS Outposts
AWS の出すハイブリッドクラウド製品
© NTT Communications Corporation All Rights Reserved. 9 ハイブリッドクラウド •
オンプレミスにクラウドサービスを導入するための ソリューション • Azure/GCP/AWS 各社が展開中 ◦ Azure Stack Hub/HCI ◦ GCP Anthos/Distributed Cloud ◦ AWS Outposts • データを Public な場所に流さなくても クラウドサービスを利用できるようになる
© NTT Communications Corporation All Rights Reserved. 10 従来のクラウドサービス
© NTT Communications Corporation All Rights Reserved. 11 ハイブリッドクラウドサービス
© NTT Communications Corporation All Rights Reserved. 12 AWS Outposts
詳解 • AWS のサブセットが提供される ◦ EC2, EKS, ALB, S3, … • Public な AWS と変わらない体験を提供 ◦ Public な AWS のリソースともシームレスに連携 • 42U ラックまたは 1U/2U サーバータイプを販売 ◦ 今回は 42U ラックで試した結果について解説
© NTT Communications Corporation All Rights Reserved. 13 AWS Outposts
詳解 管理もマネジメントコンソールからできる
© NTT Communications Corporation All Rights Reserved. 14 AWS Outposts
詳解 Outpost 上の subnet 等もマネジメントコンソールから管理可能
© NTT Communications Corporation All Rights Reserved. 15 AWS Outposts
のデプロイイメージ Outposts は AZ に紐付く
© NTT Communications Corporation All Rights Reserved. 16 AWS Outposts
のイメージ 42U タイプ (ref: https://aws.amazon.com/jp/blogs/news/outposts-osaka/)
© NTT Communications Corporation All Rights Reserved. 17 AWS Outposts
のユースケース • 低レイテンシーなコンピューティング ◦ Public AWS よりも近くでやりとりするため、 レイテンシーの要件が厳しいところでも導入可能 • ローカルなデータ処理 ◦ データが外出しできないような場所でも 外にデータが出ないため導入可能 • データレジデンシー ◦ データを特定の地域に留めおかなければならない 場所でもその地域にデプロイするだけ • オンプレミス環境のモダナイズ ◦ クラウド移行の前段として
© NTT Communications Corporation All Rights Reserved. 18 IaC
© NTT Communications Corporation All Rights Reserved. 19 IaC •
Infrastructure as Code • インフラをコードによって定義/管理する
© NTT Communications Corporation All Rights Reserved. 20 IaC のメリット
• インフラ構築をコード化することによって手作業を 減らせる • ノウハウがコードに表れるため、暗黙知を減らせる • 単なるコードなので、インフラをテストしやすくなる • 自動化できる • 抽象化しておくことで、環境差異を残して共通化できる ◦ 環境毎にデプロイする際の工数圧縮
© NTT Communications Corporation All Rights Reserved. 21 AWS で
IaC • 現状は次の2つが主流 ◦ CloudFormation/AWS CDK ◦ Terraform
© NTT Communications Corporation All Rights Reserved. 22 AWS CDK
© NTT Communications Corporation All Rights Reserved. 23 AWS CDK
• AWS Cloud Development Kit • Apache License 2.0 • 汎用言語でインフラを定義し、 CloudFormation を 通してインフラを管理するフレームワーク ◦ CloudFormation: JSON/YAML で AWS リソース群を 管理する AWS サービス ◦ TypeScript/Java/C# 等が利用できる • 汎用言語の抽象化力によってコードが短く抑えられる
© NTT Communications Corporation All Rights Reserved. 24 AWS CDK
の例 (TypeScript)
© NTT Communications Corporation All Rights Reserved. 25 AWS CDK
の例 (TypeScript) Subnet の 設定を定義
© NTT Communications Corporation All Rights Reserved. 26 AWS CDK
の例 (TypeScript) 設定した内容を持つ subnet を所有する VPC を定義
© NTT Communications Corporation All Rights Reserved. 27 CloudFormation の例
170 行程度
© NTT Communications Corporation All Rights Reserved. 28 CloudFormation の例
VPC を定義
© NTT Communications Corporation All Rights Reserved. 29 CloudFormation の例
ここで各 subnet や NAT GW, Internet GW を 定義
© NTT Communications Corporation All Rights Reserved. 30 CloudFormation の例
定義している subnet のうちの1つを抽出
© NTT Communications Corporation All Rights Reserved. 31 カスタムリソース •
CloudFormation で提供されていないリソースを 管理するためのフレームワーク ◦ Outposts も一部は CloudFormation で 管理できない(つまり CDK でも管理できない)ものがある • リソースの作成/更新/削除時に Lambda がフックされる
© NTT Communications Corporation All Rights Reserved. 32 Lambda フックの実装例
作成/更新/削除をフックする実装例
© NTT Communications Corporation All Rights Reserved. 33 Terraform
© NTT Communications Corporation All Rights Reserved. 34 Terraform •
HashiCorp が開発する OSS • AWS CDK と同じように IaC を実現する • Mozilla Public License 2.0 • マルチクラウドをサポート • HashiCorp Configuration Language を使って インフラを定義 • AWS API とリソースが比較的1対1対応しているため、 コード量が長くなりがち ◦ HCL も DSL のため、抽象化力はそこまで高くはない
© NTT Communications Corporation All Rights Reserved. 35 Terraform の例
90行程度
© NTT Communications Corporation All Rights Reserved. 36 Terraform の例
VPC を定義
© NTT Communications Corporation All Rights Reserved. 37 Terraform の例
ここで各 subnet や NAT GW, Internet GW を 定義
© NTT Communications Corporation All Rights Reserved. 38 Terraform の例
定義している subnet のうちの1つを抽出
© NTT Communications Corporation All Rights Reserved. 39 Outposts IaC
© NTT Communications Corporation All Rights Reserved. 40 Outposts IaC
• Outposts を IaC する • CDK と Terraform で IaC した結果を紹介 ◦ どこまでできるのかや注意点を紹介
© NTT Communications Corporation All Rights Reserved. 41 Outposts IaC
with AWS CDK
© NTT Communications Corporation All Rights Reserved. 42 Outposts IaC(CDK)
• subnet ◦ Outposts 上へデプロイするまではサポート済 ◦ CoIP を自動でつける設定は カスタムリソースで要定義 ▪ CoIP: オンプレから接続する際に利用する IP アドレス。 AWS リソースにつける IP アドレスを こちらから提供できる • customer owned IP address • EBS Volume ◦ サポート済
© NTT Communications Corporation All Rights Reserved. 43 Outposts IaC(CDK)
• EC2 インスタンス ◦ subnet 上に載るので、 subnet を Outposts 上へ デプロイしておけば OK (root volume な EBS も勝手に Outposts 上に載る) • ALB ◦ 作成/更新/削除はサポートされてないので、自前で カスタムリソースを使って管理 • S3 on Outposts ◦ サポート済 ◦ ただし、プレビュー段階
© NTT Communications Corporation All Rights Reserved. 44 Outposts IaC
with Terraform
© NTT Communications Corporation All Rights Reserved. 45 Outposts IaC(Terraform)
• subnet ◦ サポート済 ◦ CoIP をつけるのもサポート済 • EBS Volume ◦ サポート済
© NTT Communications Corporation All Rights Reserved. 46 Outposts IaC(Terraform)
• EC2 インスタンス ◦ CDK と同じで subnet へ展開するだけで自動で載る • ALB ◦ サポート済 • S3 on Outposts ◦ サポート済
© NTT Communications Corporation All Rights Reserved. 47 言語 状態の管理方法
コード量 CDK TypeScript/Java/ JavaScript/C#/ Go(preview) CloudFormation 小 Terraform HCL tfstate ファイル (S3/Terraform Cloud/ ローカル等) 大 Terraform と CDK 比較
© NTT Communications Corporation All Rights Reserved. 48 Terraform と
CDK の Outposts サポート比較 EC2 subnet EBS Volume EC2 インスタンス ALB S3 on Outposts CDK △ ◦ ◦ × ◦(※) Terraform ◦ ◦ ◦ ◦ ◦ • ◦は完全にサポート、△は一部サポートされてない機能あり、×は 完全にサポートされてない • (※)プレビュー版
© NTT Communications Corporation All Rights Reserved. 49 まとめ
© NTT Communications Corporation All Rights Reserved. 50 まとめ •
Outposts とは AWS の出すハイブリッドクラウド製品 • Outposts は IaC できるが、Terraform の方は サポート済みなものが多い一方 CDK ではまだ カスタムリソースを使って頑張る必要あり • Terraform と CDK による管理は一長一短 ◦ CDK: コード量小, 新サービスへの対応に難あり, リソースを CloudFormation で一括管理 ◦ Terraform: コード量大, 新サービスへの対応が素早い, tfstate の管理が課題
© NTT Communications Corporation All Rights Reserved. 51 登壇予定 •
AWS CDK Conference Japan に登壇します ◦ CDK のより詳細な部分はそちらにて発表予定です ◦ 2022/4/9 登壇予定
© NTT Communications Corporation All Rights Reserved. 52