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 CDKとZodを活用したバリデーションパターン集 / validation patte...
Search
k.goto
May 18, 2023
Programming
7
3.4k
AWS CDKとZodを活用したバリデーションパターン集 / validation patterns with cdk and zod
2023/05/20開催「AWS CDK Conference Japan 2023」での発表資料です。
k.goto
May 18, 2023
Tweet
Share
More Decks by k.goto
See All by k.goto
AWS CDKにおける「再利用性」を考える / aws-cdk-reusability
gotok365
6
2.1k
OSS活動のススメ / oss-activities
gotok365
4
700
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
5
1.3k
S3バケットを高速で削除・空にするツール「cls3」 / s3-deletion-tool-cls3
gotok365
4
690
AWS CDKで コンテナイメージスキャンを行う 〜ECRとその他の方法〜 / cdk-container-image-scan
gotok365
2
1.3k
スタートアップでこそCDKが活きた〜生産性を向上できた5つの理由〜 / startup-cdk-productivity
gotok365
12
3.8k
AWS CDKで"使う"GoFデザインパターン 〜実際どうなの?〜 / GoF design patterns used with AWS CDK
gotok365
4
1.5k
AWS CDKで学ぶGoFデザインパターン〜IaCにもコード設計〜 / aws dev day cdk gof design patterns
gotok365
12
5.6k
CloudWatch複合アラームでELBの5XXをいい感じに検知しようとしたらうまくいかなかった話 / cloudwatch alarm elb 5xx
gotok365
0
3.2k
Other Decks in Programming
See All in Programming
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
290
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
330
Realtime API 入門
riofujimon
0
150
as(型アサーション)を書く前にできること
marokanatani
10
2.6k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Featured
See All Featured
Designing the Hi-DPI Web
ddemaree
280
34k
Happy Clients
brianwarren
98
6.7k
Building Your Own Lightsaber
phodgson
103
6.1k
Faster Mobile Websites
deanohume
305
30k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Designing for humans not robots
tammielis
250
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Transcript
LHPUP าͷςοΫ "84$%,ͱ;PEΛ׆༻ͨ͠ όϦσʔγϣϯύλʔϯू "84$%,$POGFSFODF+BQBO
ࣗݾհ LHPUP w ςοΫϦʔυɾϥʔϝϯ͖ w "84$PNNVOJUZ#VJMEFS %FW5PPMT w าͷςοΫ
ٕज़ϒϩά w ࣗ࡞"84ؔ࿈πʔϧͷ044։ൃ w 5XJUUFS!@TUFQ@UFDI ‣ LHPUP าͷςοΫ
લఏ w $%,5ZQF4DSJQUͰ࣮͍ͯ͠·͢ w όʔδϣϯ ‣ /PEFKT ‣ 5ZQF4DSJQU ‣
"84$%,
;PEͱʁ
;PEͱʁ w 5ZQF4DSJQUͷόϦσʔγϣϯπʔϧ ‣ ϦΫΤετͳͲͷΦϒδΣΫτใΛɺఆٛͨ͠UZQFͷΦϒδΣΫτʹύʔε͢Δ λΠϛϯάͰɺఆٛͨ͠ϧʔϧʹج͍ͮͯόϦσʔγϣϯΛߦ͑Δπʔϧ ‣ 5ZQF ܕ ఆٛͱಉ͡ϑΝΠϧͰόϦσʔγϣϯϧʔϧ͕ॻ͚Δ
;PEͱʁ ɾܕνΣοΫOVNCFS TUSJOH BSSBZʜ ɾΦϓγϣφϧνΣοΫPQUJPOBM ɾۭจࣈνΣοΫNJO ɾ&NBJMܗࣜνΣοΫFNBJM
ɾFUDʜ
$%,ͰόϦσʔγϣϯʁ
$%,ͰόϦσʔγϣϯʁ IUUQTTQFBLFSEFDLDPNHPUPLDELWBMJEBUJPO
BEE7BMJEBUJPO IUUQTEPDTBXTBNB[PODPNDELBQJWEPDT DPOTUSVDUT/PEFIUNMBEEXCSWBMJEBUJPOWBMJEBUJPO ͨ͠όϦσʔγϣϯ͕ DELTZOUI࣌ʹΓ·͢
JOUFSGBDF*7BMJEBUJPO IUUQTEPDTBXTBNB[PODPNDELBQJWEPDTDPOTUSVDUT*7BMJEBUJPOIUNM
ݺͼग़ؔ͠ ͜ΕΛ࡞ͯ͠ όϦσʔγϣϯϧʔϧΛ࣮ .Z7BMJEBUPSͷΠϯελϯεΛੜ UIJTOPEFBEE7BMJEBUJPOʹ͢
ॻ͍ͯΈͨ 7BMJEBUPS w ྫʣ8"'ͷϦʔδϣϯͱείʔϓͷΈ߹ΘͤͷόϦσʔγϣϯ ˞BEE7BMJEBUJPJO͠ͳͯ͘DELEFQMPZ࣌ʹΤϥʔʹͳΔྫͰ͕͢ɺ͋͘·ͰྫͰ͢
ॻ͍ͯΈͨ 4UBDL w ελοΫΫϥεͰόϦσʔγϣϯ 7BMJEBUPS Λ͢ ͨͬͨߦʂ *GUSZ UISPXOFX&SSPS ͱ͔͍Βͳ͍ʂ
࣮ߦͯ͠Έͨ DELTZOUI .Z7BMJEBUPSWBMJEBUF Ͱ SFHJPO͕zVTFBTUzͰͳ͍ͱΤϥʔʹ͢ΔΑ͏όϦσʔγϣϯͯ͋͠Δ &SSPS7BMJEBUJPOGBJMFEXJUIUIFGPMMPXJOHFSSPST <$EL"EE7BMJEBUJPO4UBDL>3FHJPONVTUCFVTFBTUXIFO$-06%'30/5
ෳΤϥʔͷݕ w Γ͕TUSJOH<>ͳͷͰɺෳͷΤϥʔΛݕɾग़ྗͰ͖Δ &SSPS7BMJEBUJPOGBJMFEXJUIUIFGPMMPXJOHFSSPST <$EL"EE7BMJEBUJPO4UBDL>5FTU&SSPS <$EL"EE7BMJEBUJPO4UBDL>5FTU&SSPS ʢ༻ྫʣ ελοΫʹͨ͠֎෦ύϥϝʔλ Ͱҧͨ͠ύϥϝʔλΛશ෦ग़ྗ
"84$%,ͱ;PEΛ׆༻ͨ͠ όϦσʔγϣϯύλʔϯूʁ
$%,ͷ7BMJEBUJPOʹ ;PEΛ׆༻ͯ͠Έ·ͨ͠
ίʔυߏ MJC ᵓᴷᴷBQQSVOOFSTQFDUZQFUT ᵓᴷᴷDEL[PEWBMJEBUJPOQBUUFSOTTUBDLUT ᵓᴷᴷDPO fi HUT ᵓᴷᴷTUBDLJOQVUUT ᵋᴷᴷTUBDLWBMJEBUPSUT ࠷ޙʹͭ͢
ελοΫΫϥε 7BMJEBUPSΫϥε ελοΫʹ͢όϦσʔτରύϥϝʔλ ;PEͰεΩʔϚఆٛ
ελοΫΫϥε 7BMJEBUPSͷΠϯελϯεΛੜͯ͠ BEE7BMJEBUJPOʹ͢
7BMJEBUPSΫϥε ;PEͰόϦσʔτ TUBDL*OQVU4DIFNBม͕ޙͰ ఆٛ͢Δ;PEεΩʔϚม
;PEεΩʔϚ ܕ UZQF εΩʔϚ͔Βύϥϝʔλ༻ DPO fi Hͷܕ͕ు͚Δʂ όϦσʔγϣϯϧʔϧ
DPOGJH ύϥϝʔλ ;PEεΩʔϚ͔Β ు͍ͨܕΛ͍ճ͠
͔͜͜Β
࣮ࡍͷόϦσʔγϣϯύλʔϯ ʹೖΓ·͢
;PEεΩʔϚͱDPOGJHΛ ม͍͖͑ͯ·͢ ʢελοΫΫϥεͱ7BMJEBUPSΫϥεݻఆʣ
όϦσʔγϣϯύλʔϯ w ᶃجຊతͳόϦσʔγϣϯ w ᶄศརͳόϦσʔγϣϯ w ᶅਖ਼نදݱͳόϦσʔγϣϯ w ᶆΧελϜͳόϦσʔγϣϯ DVTUPN
w ᶇΧελϜͳόϦσʔγϣϯ SF fi OF
ᶃجຊతͳόϦσʔγϣϯ
ᶃجຊతͳόϦσʔγϣϯ ܕ TUSJOH OVNCFS FUDʜ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶃجຊతͳόϦσʔγϣϯ ࠷େ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶃجຊతͳόϦσʔγϣϯ lEFWzͰ࢝·ͬͯ l4UBDLzͰऴΘΔ lHPUPlΛؚΉ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶃجຊతͳόϦσʔγϣϯ Ҏ্ʢؚΉʣ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶃجຊతͳόϦσʔγϣϯ ΑΓେ͖͍ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶃجຊతͳόϦσʔγϣϯ ͷഒ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶃجຊతͳόϦσʔγϣϯ DPO fi HUT
ᶃجຊతͳόϦσʔγϣϯ Θ͟ͱΤϥʔʹ͢Δ
ᶃجຊతͳόϦσʔγϣϯ &SSPS7BMJEBUJPOGBJMFEXJUIUIFGPMMPXJOHFSSPST <TUBDLOBNF>\JTTVFT< \DPEFJOWBMJE@TUSJOH WBMJEBUJPO\TUBSUT8JUIEFW^ NFTTBHF*OWBMJEJOQVUNVTUTUBSUXJUIaEFWa QBUI<TUBDL/BNF>^ \DPEFJOWBMJE@TUSJOH WBMJEBUJPO\FOET8JUI4UBDL^
NFTTBHF*OWBMJEJOQVUNVTUFOEXJUIa4UBDLa QBUI<TUBDL/BNF>^ \DPEFJOWBMJE@TUSJOH WBMJEBUJPO\JODMVEFTHPU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਼نදݱͳόϦσʔγϣϯ ਖ਼نදݱDSPO ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶅਖ਼نදݱͳόϦσʔγϣϯ ਖ਼نදݱ"3/ 4/45PQJD ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶅਖ਼نදݱͳόϦσʔγϣϯ ਖ਼نදݱ"3/ ౦ژϦʔδϣϯͷ4/45PQJD ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶅਖ਼نදݱͳόϦσʔγϣϯ ਖ਼نදݱ"3/ 4όέοτˡӳࣈখจࣈͱ͔ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶅਖ਼نදݱͳόϦσʔγϣϯ DPO fi HUT
ᶅਖ਼نදݱͳόϦσʔγϣϯ Θ͟ͱΤϥʔʹ͢Δ
ᶅਖ਼نදݱͳόϦσʔγϣϯ &SSPS7BMJEBUJPOGBJMFEXJUIUIFGPMMPXJOHFSSPST <EFWBQQHPUP$EL;PE7BMJEBUJPO1BUUFSOT4UBDL>\JTTVFT< \WBMJEBUJPOSFHFY DPEFJOWBMJE@TUSJOH NFTTBHF*OWBMJE QBUI<TDIFEVMF&YQSFTTJPO>^ \WBMJEBUJPOSFHFY DPEFJOWBMJE@TUSJOH
NFTTBHF*OWBMJE QBUI<TOT5PQJD"SO>^ \WBMJEBUJPOSFHFY DPEFJOWBMJE@TUSJOH NFTTBHF*OWBMJE QBUI<TOT5PQJD5PLZP"SO>^ \WBMJEBUJPOSFHFY DPEFJOWBMJE@TUSJOH NFTTBHF*OWBMJE QBUI<CVDLFU"SO>^ > OBNF;PE&SSPS^ DELTZOUI
ᶆΧελϜͳόϦσʔγϣϯ DVTUPN
ᶆΧελϜͳόϦσʔγϣϯ DVTUPN ࣗલͷܕఆٛ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶆΧελϜͳόϦσʔγϣϯ DVTUPN DPO fi HUT
ᶆΧελϜͳόϦσʔγϣϯ DVTUPN ΤσΟλͰܕΤϥʔݕ εϖʔε࿙Ε
ᶆΧελϜͳόϦσʔγϣϯ DVTUPN ΤσΟλͰΧʔιϧͯΔͱܕใग़ྗ
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF ࠨɿೖྗՄೳͷεΩʔϚఆٛɿVOJPO ӈɿΧελϜͳόϦσʔγϣϯϩδοΫ εϖοΫΈ߹Θͤ ఆٛSF fi OF ;PEεΩʔϚ ܕ
BQQSVOOFSTQFDUZQFUT
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF ΧελϜϩδοΫΛఆٛ SF fi OF ͨ͠εΩʔϚΛࢦఆ ;PEεΩʔϚ ܕ TUBDLJOQVUUT
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF DPO fi HUT
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF ΤσΟλͰΧʔιϧͯΔͱೖྗՄೳ͕ग़ྗ SF fi OFͰͳ͘VOJPOͷػೳ
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF ΤσΟλͰೖྗͷิ͕Մೳ SF fi OFͰͳ͘VOJPOͷػೳ
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF Θ͟ͱҧ͢ΔΈ߹ΘͤΛఆٛ
ᶇΧελϜͳόϦσʔγϣϯ SFGJOF &SSPS7BMJEBUJPOGBJMFEXJUIUIFGPMMPXJOHFSSPST <EFWBQQHPUP$EL;PE7BMJEBUJPO1BUUFSOT4UBDL>\JTTVFT< \DPEFDVTUPN NFTTBHF*OWBMJE$16BOE.FNPSZDPNCJOBUJPO QBUI<BQQ3VOOFS4QFD>^ > OBNF;PE&SSPS^ DELTZOUI
SF fi OFʹΑΔΧελϜͳόϦσʔγϣϯʂ
όϦσʔγϣϯύλʔϯ w ᶃجຊతͳόϦσʔγϣϯ w ᶄศརͳόϦσʔγϣϯ w ᶅਖ਼نදݱͳόϦσʔγϣϯ w ᶆΧελϜͳόϦσʔγϣϯ DVTUPN
w ᶇΧελϜͳόϦσʔγϣϯ SF fi OF
"84$%,ͱ;PEͰ όϦσʔγϣϯ͍͖ͯ͠·͠ΐ͏
ࢀߟɿ(JU)VC ࠓͷίʔυ w DEL[PEWBMJEBUJPOQBUUFSOT ‣ IUUQTHJUIVCDPNHPUPLDEL[PEWBMJEBUJPOQBUUFSOT
ࢀߟɿϒϩάهࣄ าͷςοΫ w "84$%,ͰόϦσʔγϣϯΛߦ͏ BEE7BMJEBUJPO ‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZDELBEEWBMJEBUJPO w 5ZQF4DSJQUͷ$%,ελοΫΛ;PEͰόϦσʔγϣϯ͢Δ
‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZUTDEL[PEWBMJEBUJPO w $%,ͷ֎෦ύϥϝʔλʹܕ͚ͩͰͳ੍͔͚͘Δ ‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZDELQBSBNFUFSUZQFWBMJEBUJPO
એɿࣗ࡞"84ؔ࿈πʔϧ044 w EFMTUBDL"84$MPVE'PSNBUJPOελοΫڧ੍আπʔϧ ‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZEFMTUBDL w DMT4όέοτߴআɾۭʹ͢Δπʔϧ όʔδϣχϯάରԠ ‣
IUUQTHPUPLIBUFOBCMPHDPNFOUSZDMT w MBNWFS-BNCEBϥϯλΠϜόʔδϣϯݕࡧπʔϧ Ϧʔδϣϯԣஅ ‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZMBNWFS
એɿొஃ w ݄ +"846(43&ࢧ෦ ‣ ʰ$MPVE8BUDIෳ߹ΞϥʔϜͰ&-#ͷ99Λॏෳͳ͠ݕ͠Α͏ͱͨ͠Β͏·͘ ͍͔ͳ͔ͬͨʱ w
d"84%FW%BZ5PLZP ࿈ଓ ‣ ʰ"84$%,ͰֶͿ(P'σβΠϯύλʔϯʙ*B$ʹίʔυઃܭʙʱ
5IBOL:PV LHPUP าͷςοΫ