Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RemovalPoliciesのことを知ろう!
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
watany
April 01, 2025
Technology
520
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RemovalPoliciesのことを知ろう!
JAWS-UG CDK支部 #20でお話しした内容でした
https://jawsug-cdk.connpass.com/event/348953/
watany
April 01, 2025
More Decks by watany
See All by watany
OSS as a Hono User
watany
2
180
仕様駆動開発の消費期限
watany
20
10k
AIエージェントがあれば技術書なんてすぐ書けるでしょ→無理でした
watany
7
1.8k
穢れた技術選定について
watany
22
9k
Alphaモジュール使っていいのかい!?いけないのかい!?どっちなんだいっ!?
watany
1
470
The Tyranny of Not Measuring
watany
5
560
新しいVibe Codingと”自走”について
watany
7
630
Equip GitHub Copilot CLI
watany
3
1.6k
SkillsをS3 Filesに置く時のあれこれ
watany
4
2.6k
Other Decks in Technology
See All in Technology
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
470
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
450
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
490
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
190
20261017福岡devIO 「AIは"良いダッシュボード"を作れるか?
jtakeda
0
140
継続的なAIコスト最適化
bgpat
1
340
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
280
hackers_champloo_2026_tidb
makocchi
0
160
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.4k
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
230
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.4k
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
430
Featured
See All Featured
A better future with KSS
kneath
240
18k
It's Worth the Effort
3n
188
29k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Chasing Engaging Ingredients in Design
codingconduct
0
360
How to train your dragon (web standard)
notwaldorf
96
6.9k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Music & Morning Musume
bryan
48
7.4k
Skip the Path - Find Your Career Trail
mkilby
1
260
Transcript
JAWS-UG CDK支部 #20 RemovalPoliciesのことを知ろう! 2025-04-01
About Me 渡邉 洋平(watany) • 所属:NTTテクノクロス株式会社 ◦ 「AWS 500 APN
Certification Distinction」に認定 • Personal ◦ JAWS-UG東京 運営 ◦ AWS Ambassadors(2024) ◦ Japan AWS All Certifications Engineers(2022~) https://jawsug.connpass.com/event/316
RemovalPoliciesのことを知ろう!
おさらい- RemovalPolicy • CDK’s Removal Policy ≒ CloudFormation’s DeletionPolicy •
リソースの消し方を設定する ◦ RemovalPolicy.DESTROY:削除 ◦ RemovalPolicy.RETAIN:保持 ◦ RemovalPolicy.SNAPSHOT:スナップショット取得 ◦ RemovalPolicy.RETAIN_ON_UPDATE_OR_DELETE:作成失敗で削除。以降は保持 https://docs.aws.amazon.com/cdk/v2/guide/resources.html#resources_removal
何が困るか- RemovalPolicy 大量のリソースへ 設定したい 検証用にRETAINを 止めたい RDS全部に SNAPSHOT設定したい
RemovalPolicies https://github.com/aws/aws-cdk/releases/tag/v2.183.0 2025/03/12 🚀
なぜ私が説明するか 私と3人で 作ったPR https://github.com/aws/aws-cdk/pull/32283
何ができるか- RemovalPolicies 基本形 Stack配下の 全Constructへ 設定
何ができるか- RemovalPolicies 基本形 特定のリソース タイプ全部へ設定
何ができるか- RemovalPolicies 基本形 特定のリソース タイプ以外へ設定
何ができるか- RemovalPolicies 応用編 MissingRemobalPolicies ⇒RemovalPolicyの明示的な 設定のない Constructへ設定 RemovalPolicies ⇒問答無用で設 定
何ができるか- RemovalPolicies 応用編 - Priority Priority=優先度 対応ができる
これらの課題はクリアされる 大量のリソースへ 設定したい 検証用にRETAINを 止めたい RDS全部に SNAPSHOT設定したい
RemovalPoliciesの実装秘話
RemovalPoliciesの実装秘話 1. 元ネタの技術記事
機能の元ネタ https://dev.classmethod.jp/articles/aws-cdk-set-removal-policy-all-resources-in-stack/
機能の元ネタ のんピさんありがとう Blogを無効化してしまってごめん https://dev.classmethod.jp/author/non____97/
RemovalPoliciesの実装秘話 2.実装工程
None
• VS Code Extension コーディングエージェント(OSS) ◦ ”必要になれば人間に聞く” Human-in-the-Loop ◦ ”人間に聞かない機能”
Auto Approve • 多彩なツールの実行 ◦ ファイルの作成・編集、コマンド実行 ◦ ヘッドレスブラウザを用いたデバッグ ◦ MCP経由でのPlugin機能 • 多彩なLLM APIの採用 ◦ Amazon Bedrock+Claudeも使用可能 Cline
”流行ってるから適当に言ってんだろ ” https://x.com/_watany/status/1861279373984440580 これが証拠 (2024/11/26)
経緯 Qiitaアドベントカレンダー 2024向けにClineを調べていた
RemovalPoliciesの実装秘話 3.MissingRemovalPolicies
元はこんな実装だった overwrite デフォがMissing~ overwriteを明示で 上書き
元はこんな実装だった それPriority付けたらヤバくないっすか 問題が わかりますか?
元はこんな実装だった それPriority付けたらヤバくないっすか 優先度が高いので retainが適応される 優先度が低いので destroyが後で 適応される
あなたはどっち? 俺の優先度が 高いんだから retainに なれよ! 優先度順 なんだから順番に retain→destroy だろ! https://www.irasutoya.com/2017/12/blog-post_666.html
色々あり、分割しました
ということで RemovalPolicies、超便利なので使ってください https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk/RemovalPolicies.html
宣伝 初主催のイベントを 4/23(木) オンラインでやるから聞きに来てね https://jawsug.connpass.com/event/348840/ https://x.com/_watany/status/1899298621830361566