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.5k
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.4k
OSS活動のススメ / oss-activities
gotok365
4
900
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
5
1.5k
S3バケットを高速で削除・空にするツール「cls3」 / s3-deletion-tool-cls3
gotok365
4
740
AWS CDKで コンテナイメージスキャンを行う 〜ECRとその他の方法〜 / cdk-container-image-scan
gotok365
2
1.3k
スタートアップでこそCDKが活きた〜生産性を向上できた5つの理由〜 / startup-cdk-productivity
gotok365
13
3.9k
AWS CDKで"使う"GoFデザインパターン 〜実際どうなの?〜 / GoF design patterns used with AWS CDK
gotok365
4
1.6k
AWS CDKで学ぶGoFデザインパターン〜IaCにもコード設計〜 / aws dev day cdk gof design patterns
gotok365
13
6.1k
CloudWatch複合アラームでELBの5XXをいい感じに検知しようとしたらうまくいかなかった話 / cloudwatch alarm elb 5xx
gotok365
0
3.3k
Other Decks in Programming
See All in Programming
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
720
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.1k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
870
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
350
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
320
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
410
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
140
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
390
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
220
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
270
Flatt Security XSS Challenge 解答・解説
flatt_security
0
590
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
120
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Designing Experiences People Love
moore
139
23k
Building an army of robots
kneath
302
44k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Practical Orchestrator
shlominoach
186
10k
Typedesign – Prime Four
hannesfritz
40
2.5k
Speed Design
sergeychernyshev
25
720
GitHub's CSS Performance
jonrohan
1030
460k
Bash Introduction
62gerente
609
210k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
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\JODMVEFTHPUP^ NFTTBHF*OWBMJEJOQVUNVTUJODMVEFaHPUPa QBUI<TUBD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 ܕ 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 าͷςοΫ