Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AWS CDKとZodを活用したバリデーションパターン集 / validation patte...

k.goto
May 18, 2023

AWS CDKとZodを活用したバリデーションパターン集 / validation patterns with cdk and zod

2023/05/20開催「AWS CDK Conference Japan 2023」での発表資料です。

k.goto

May 18, 2023
Tweet

More Decks by k.goto

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ LHPUP w ςοΫϦʔυɾϥʔϝϯ޷͖ w "84$PNNVOJUZ#VJMEFS %FW5PPMT  w าͷςοΫ

    ٕज़ϒϩά  w ࣗ࡞"84ؔ࿈πʔϧͷ044։ൃ w 5XJUUFS!@TUFQ@UFDI ‣ LHPUP าͷςοΫ
  2. ᶃجຊతͳόϦσʔγϣϯ &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<TUBDL/BNF>^  \DPEFUPP@TNBMM NJOJNVN UZQFOVNCFS JODMVTJWFUSVF FYBDUGBMTF NFTTBHF/VNCFSNVTUCFHSFBUFSUIBOPSFRVBM UP QBUI<EFTJSFE$PVOU>^  \DPEFUPP@TNBMM NJOJNVN UZQFOVNCFS JODMVTJWFGBMTF FYBDUGBMTF NFTTBHF/VNCFSNVTUCFHSFBUFSUIBO QBUI <DQV>^ > OBNF;PE&SSPS^ DELTZOUI
  3. ᶄศརͳόϦσʔγϣϯ &SSPS7BMJEBUJPOGBJMFEXJUIUIFGPMMPXJOHF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ʔλʹܕ͚ͩͰͳ੍͘໿΋͔͚Δ ‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZDELQBSBNFUFSUZQFWBMJEBUJPO
  6. એ఻ɿࣗ࡞"84ؔ࿈πʔϧ044 w EFMTUBDL"84$MPVE'PSNBUJPOελοΫڧ੍࡟আπʔϧ ‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZEFMTUBDL w DMT4όέοτߴ଎࡟আɾۭʹ͢Δπʔϧ όʔδϣχϯάରԠ  ‣

    IUUQTHPUPLIBUFOBCMPHDPNFOUSZDMT w MBNWFS-BNCEBϥϯλΠϜόʔδϣϯݕࡧπʔϧ Ϧʔδϣϯԣஅ  ‣ IUUQTHPUPLIBUFOBCMPHDPNFOUSZMBNWFS
  7. એ఻ɿొஃ w  ݄ +"846(43&ࢧ෦ ‣ ʰ$MPVE8BUDIෳ߹ΞϥʔϜͰ&-#ͷ99Λॏෳͳ͠ݕ஌͠Α͏ͱͨ͠Β͏·͘ ͍͔ͳ͔ͬͨ࿩ʱ w 

    ໦ d"84%FW%BZ5PLZP ೥࿈ଓ  ‣ ʰ"84$%,ͰֶͿ(P'σβΠϯύλʔϯʙ*B$ʹ΋ίʔυઃܭʙʱ