Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stageを活用したマルチステージ運用の最短経路
Search
yuto mori
July 12, 2025
2
130
Stageを活用したマルチステージ運用の最短経路
AWS CDK Conference Japan 2025 presented by JAWS-UG
yuto mori
July 12, 2025
Tweet
Share
More Decks by yuto mori
See All by yuto mori
初学者向け CDK勉強会 外部公開用
hosomatu
0
200
完全IT未経験の消防士が Fusicのエンジニアになるまでに取り組んだこと
hosomatu
1
310
圧倒的サポート力! Amazon Q× CDK 開発のすすめ
hosomatu
3
700
脱ぽちぽちを目指して CDKでインフラ構築をしてみた
hosomatu
0
1.9k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
We Have a Design System, Now What?
morganepeng
54
7.9k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
The Invisible Side of Design
smashingmag
302
51k
Designing for Performance
lara
610
69k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
Become a Pro
speakerdeck
PRO
31
5.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Transcript
©Fusic Co., Ltd. 0 CONFIDENTIAL Stageを活用したマルチステージ運用の最短経路 2025.07.12 名前 森優斗 @kotukotuganbad
AWS CDK Conference Japan 2025 presented by JAWS-UG
©Fusic Co., Ltd. 1 CONTENTS 目次 1. CDKにおけるStageとは 2. Stageで何を実現したのか
3. 実装例の紹介 4. まとめ
©Fusic Co., Ltd. 2 森 優斗 Mori Yuto ❖ I
am - 消防10年 Fusic 2年 - RareTECH メンター(ITスクール) - 初音ミクとギターが好きです ❖ Skills - AWS (Web) / Ruby on Rails ❖ Comment - 懇親会でいっぱい話したいです 自己紹介 はじめに 株式会社Fusic @福岡 データソリューション部門 エンジニア @kotukotuganbad
©Fusic Co., Ltd. 3 導入 0
©Fusic Co., Ltd. 4 CDKにおけるステージとは CDKにおけるステージとは CDKパイプラインを使う際のスタックを囲うだけの存在 として扱っていませんか?
©Fusic Co., Ltd. 5 CDKにおけるステージとは CDKにおけるステージとは
©Fusic Co., Ltd. 6 CDKにおけるステージとは CDKにおけるステージとは 非常にもったいない! 聴講後にすぐにポテンシャルを解放してあげましょう
©Fusic Co., Ltd. 7 CDKにおけるStageとは 1
©Fusic Co., Ltd. 8 CDKにおけるステージとは CDKにおけるステージとは CDK.Stageとは 複数のStackをまとめてグループ化するものです
©Fusic Co., Ltd. 9 CDKにおけるステージとは CDKにおけるステージとは Stage Stack Amazon ECS
Construct ALB AWS Fargate Construct Amazon CloudFront 複数のStackをまとめてグループ化 Stack Amazon GuardDuty AWS Security Hub
©Fusic Co., Ltd. 10 Stageで何を実現したのか 2
©Fusic Co., Ltd. 11 開発環境へのデプロイフロー Stageで何を実現したのか Stack Construct AWS Cloud
ステージング環境 Construct cdk deploy “DevStage/*” –-profile dev AWS Cloud 本番環境 AWS Cloud 開発環境 parameter.ts DevStage 開発環境のenv情報 開発環境用のパラメータ Stack Construct Construct DevStage
©Fusic Co., Ltd. 12 異なるパラメータのステージング環境へのデプロイフロー Stageで何を実現したのか Stack Construct AWS Cloud
ステージング環境 Construct cdk deploy “StgStage/*” –-profile stg AWS Cloud 本番環境 AWS Cloud 開発環境 parameter.ts StgStage 開発環境のenv情報 ステージング環境用のパラメータ Stack Construct Construct DevStage Stack Construct Construct StgStage
©Fusic Co., Ltd. 13 ガードレールとしての機能 Stageで何を実現したのか Stack Construct AWS Cloud
ステージング環境 Construct cdk deploy “StgStage/*” –-profile prd AWS Cloud 本番環境 AWS Cloud 開発環境 parameter.ts StgStage 開発環境のenv情報 ステージング環境用のパラメータ Stack Construct Construct DevStage Stack Construct Construct StgStage Stack Construct Construct StgStage
©Fusic Co., Ltd. 14 実装例の紹介 5
©Fusic Co., Ltd. 15 ディレクトリ構成 実装例の紹介 . ├── bin │
└── infra.ts # CDKアプリのエントリーポイント ├── lib │ ├── aspects │ │ └── removal-policy-aspect.ts │ ├── constructs │ │ └── vpc.ts # Construct定義(全環境で共通) │ │ └── ecs.ts │ ├── stack │ │ └── infra-stack.ts # Stack定義(全環境で共通) │ └── stage │ ├── dev-stage.ts # Stage定義 │ ├── prd-stage.ts # Stage定義 │ └── stg-stage.ts # Stage定義 ├── cdk.json ├── parameter.ts # 各種パラメータ管理
©Fusic Co., Ltd. 16 parameter.ts 実装例の紹介 . ├── bin │
└── infra.ts ├── lib │ ├── aspects │ │ └── removal-policy-aspect.ts │ ├── constructs │ │ └── vpc.ts │ │ └── ecs.ts │ ├── stack │ │ └── infra-stack.ts │ └── stage │ ├── dev-stage.ts │ ├── prd-stage.ts │ └── stg-stage.ts ├── cdk.json ├── parameter.ts それぞれのStageに 渡すためのenv情報 パラメータの型 devに渡すパラメータ
©Fusic Co., Ltd. 17 aspects 実装例の紹介 . ├── bin │
└── infra.ts ├── lib │ ├── aspects │ │ └── removal-policy-aspect.ts │ ├── constructs │ │ └── vpc.ts │ │ └── ecs.ts │ ├── stack │ │ └── infra-stack.ts │ └── stage │ ├── dev-stage.ts │ ├── prd-stage.ts │ └── stg-stage.ts ├── cdk.json ├── parameter.ts
©Fusic Co., Ltd. 18 エントリーポイント 実装例の紹介 . ├── bin │
└── infra.ts ├── lib │ ├── aspects │ │ └── removal-policy-aspect.ts │ ├── constructs │ │ └── vpc.ts │ │ └── ecs.ts │ ├── stack │ │ └── infra-stack.ts │ └── stage │ ├── dev-stage.ts │ ├── prd-stage.ts │ └── stg-stage.ts ├── cdk.json ├── parameter.ts parameter.tsで定義した 内容を渡している
©Fusic Co., Ltd. 19 Stage 実装例の紹介 . ├── bin │
└── infra.ts ├── lib │ ├── aspects │ │ └── removal-policy-aspect.ts │ ├── constructs │ │ └── vpc.ts │ │ └── ecs.ts │ ├── stack │ │ └── infra-stack.ts │ └── stage │ ├── dev-stage.ts │ ├── prd-stage.ts │ └── stg-stage.ts ├── cdk.json ├── parameter.ts Stage配下の全ての Stackに渡される
©Fusic Co., Ltd. 20 Stack 実装例の紹介 . ├── bin │
└── infra.ts ├── lib │ ├── aspects │ │ └── removal-policy-aspect.ts │ ├── constructs │ │ └── vpc.ts │ │ └── ecs.ts │ ├── stack │ │ └── infra-stack.ts │ └── stage │ ├── dev-stage.ts │ ├── prd-stage.ts │ └── stg-stage.ts ├── cdk.json ├── parameter.ts タグやRemovalPolicyを 環境ごとに一元管理 環境ごとのパラメータ
©Fusic Co., Ltd. 21 まとめ StageはStackを包括することができる概念 Point 01 Stageによってparameterやaspectsを効率的に渡すことができる Point
02 StageによってStackのenvによるガードレールを効率的に使用できる Point 03
©Fusic Co., Ltd. 22 まとめ Stageを活用してCDKの強さを引き出そう!
©Fusic Co., Ltd. 23 Thank You We are Hiring! https://recruit.fusic.co.jp/
ご清聴いただきありがとうございました