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
7
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 Qを使ってIaCを触ろう!
maruto
0
420
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
ヤプリ新卒SREの オンボーディング
masaki12
0
130
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1.1k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
380
Click-free releases & the making of a CLI app
oheyadam
2
120
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Welcome JSConf.jp 2024
yosuke_furukawa
PRO
0
130
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
260
CSC509 Lecture 12
javiergs
PRO
0
160
Vapor Revolution
kazupon
2
270
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
YesSQL, Process and Tooling at Scale
rocio
169
14k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
A better future with KSS
kneath
238
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
GraphQLとの向き合い方2022年版
quramy
43
13k
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 าͷςοΫ