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

AWSCDKを使ってProfllyを開発した際にぶつかった問題と解決へのアプローチ

4e523d3c4d6047382d22f61ebe53c554?s=47 ore88ore
October 11, 2021

 AWSCDKを使ってProfllyを開発した際にぶつかった問題と解決へのアプローチ

4e523d3c4d6047382d22f61ebe53c554?s=128

ore88ore

October 11, 2021
Tweet

Transcript

  1.  ৽نࣄۀ౷ׅ෦ࡔҪ༟հ !PSFPSF "84$%,Λ࢖ͬͯ1SPqMZΛ։ൃͨ͠ࡍʹ Ϳ͔ͭͬͨ໰୊ͱղܾ΁ͷΞϓϩʔν

  2. ηογϣϯ಺༰  ϓϩϑΟʔϧϏϡʔΞʔαʔϏε1SPqMZͷ։ൃΛॳΊ ͯ໿̎೥͕ܦͪ·ͨ͠ɻόοΫΤϯυͷ։ൃʹ͍ͭͯ ͸ɺ"84$%, ҎԼ$%, Λ࢖ͬͯ։ൃ͖ͯ͠·ͨ͠ ͕ɺͦͷࡍʹૺ۰ͨ͠໰୊΍՝୊Λղܾ͢ΔͨΊʹࢼߦ ࡨޡͨ͠Γɺ޻෉ͨ͠఺ͳͲΛ঺հ͠·͢ɻ

  3. ηογϣϯ಺༰  ‣ ηογϣϯͷର৅ऀ ‣ $%,Λ࢖ͬͨ։ൃͷதͰɺۤઓͦ͠͏ͳϙΠϯτΛ஌Γͨ ͍ɺղܾҊΛ஌Γ͍ͨ ‣ ࿩͞ͳ͍͜ͱ ‣

    $%,ͷجຊతͳ࢖͍ํ΍ಋೖํ๏ ‣ "84$%,8PSLTIPQ IUUQTDELXPSLTIPQDPN
  4. ஫ҙࣄ߲  ࠓճ঺հ͍ͤͯͨͩ͘͞ ղܾҊ΍ղܾํ๏͕ϕετͱ͍͏Θ͚Ͱ͸ͳ ͘ɺΧΠθϯͷ༨஍͕͋Δ΋ͷͰ͢ɻ

  5. ࣗݾ঺հ  ৽نࣄۀ౷ׅ෦ ιϑτ΢ΣΞ։ൃΤϯδχΞ 4BB4ϓϩμΫτͷاըɾ։ൃɾӡ༻ ࡔҪɹ༟հ!PSFPSF

  6. ΞδΣϯμ  ‣ 1SPqMZͱ$%,ͷ࣮૷ʹ͍ͭͯ ‣ ௚໘ͨ͠໰୊ͱղܾ΁ͷΞϓϩʔν ‣ ·ͱΊ

  7. ΞδΣϯμ  ‣ 1SPqMZͱ$%,ͷ࣮૷ʹ͍ͭͯ ‣ ௚໘ͨ͠໰୊ͱղܾ΁ͷΞϓϩʔν ‣ ·ͱΊ

  8. 1SPqMZͱ͸ʁ 

  9. 1SPqMZ͕͜Μͳ೰ΈΛղܾ͠·͢ʂ 

  10. 1SPqMZͷΞʔΩςΫνϟҰ෦ൈਮ  AWS Cloud Ϣʔβʔ Amazon OpenSearch Service Amazon Simple

    Notification Service Amazon Simple Queue Service Amazon Simple Email Service Email Amazon DynamoDB AWS Cloud Development Kit Amazon CloudWatch Alarm AWS Chatbot AWS Amplify Amazon API Gateway Amazon CloudFront Amazon Route 53 Amazon Simple Storage Service AWS Lambda AWS Lambda AWS Lambda Amazon Simple Storage Service AWS Lambda Amazon Simple Notification Service Amazon Athena Amazon Comprehend AWS WAF Amazon Pinpoint CS
  11. 1SPqMZͷΞʔΩςΫνϟҰ෦ൈਮ  AWS Cloud Ϣʔβʔ Amazon OpenSearch Service Amazon Simple

    Notification Service Amazon Simple Queue Service Amazon Simple Email Service Email Amazon DynamoDB AWS Cloud Development Kit Amazon CloudWatch Alarm AWS Chatbot AWS Amplify Amazon API Gateway Amazon CloudFront Amazon Route 53 Amazon Simple Storage Service AWS Lambda AWS Lambda AWS Lambda Amazon Simple Storage Service AWS Lambda Amazon Simple Notification Service Amazon Athena Amazon Comprehend AWS WAF Amazon Pinpoint CS
  12. 1SPqMZͷΞʔΩςΫνϟҰ෦ൈਮ  AWS Cloud Ϣʔβʔ Amazon OpenSearch Service Amazon Simple

    Notification Service Amazon Simple Queue Service Amazon Simple Email Service Email Amazon DynamoDB AWS Cloud Development Kit Amazon CloudWatch Alarm AWS Chatbot AWS Amplify Amazon API Gateway Amazon CloudFront Amazon Route 53 Amazon Simple Storage Service AWS Lambda AWS Lambda AWS Lambda Amazon Simple Storage Service AWS Lambda Amazon Simple Notification Service Amazon Athena Amazon Comprehend AWS WAF Amazon Pinpoint CS
  13. 1SPqMZͷΞʔΩςΫνϟҰ෦ൈਮ  AWS Cloud Ϣʔβʔ Amazon OpenSearch Service Amazon Simple

    Notification Service Amazon Simple Queue Service Amazon Simple Email Service Email Amazon DynamoDB AWS Cloud Development Kit Amazon CloudWatch Alarm AWS Chatbot AWS Amplify Amazon API Gateway Amazon CloudFront Amazon Route 53 Amazon Simple Storage Service AWS Lambda AWS Lambda AWS Lambda Amazon Simple Storage Service AWS Lambda Amazon Simple Notification Service Amazon Athena Amazon Comprehend AWS WAF Amazon Pinpoint CS
  14. $%,ͷ࣮૷ൣғ 

  15. ΞδΣϯμ  ‣ 1SPqMZͱ$%,ͷ࣮૷ʹ͍ͭͯ ‣ ௚໘ͨ͠໰୊ͱղܾ΁ͷΞϓϩʔν ‣ ·ͱΊ

  16.  CloudFormation ͷ Ϧιʔε਺ͷ্ݶ஋Λ௒͑ͨ😱

  17. ໰୊఺  ˞8IBU*TUIF"84$%, IUUQTEPDTBXTBNB[PODPNDELMBUFTUHVJEFIPNFIUNM ΑΓҾ༻

  18.  CloudFormation ͷ੍ݶΛ ߟྀ͢Δඞཁ͕͋Δ💡

  19. ໰୊఺ 

  20. ղܾࡦ  w ελοΫΛ෼ׂ w ελοΫΛ෼ׂ͢Δ͜ͱͰɺ̍ελοΫลΓͷϦιʔε਺ Λগͳ͘͢Δ͜ͱ͕Ͱ͖ͨ w ελοΫͷ෼ׂʹ͍ͭͯ͸ɺϦιʔεͷϥΠϑαΠΫϧΛߟ ྀ࣮ͯ͠ࢪ

  21.  ଴๬ͷΞοϓσʔτ🎉

  22. ࢀߟ  "84$MPVE'PSNBUJPO͸ɺͭͷαʔϏεΫΥʔλ ͷ্ݶͷҾ্͖͛Λαϙʔτ͢ΔΑ͏ʹ IUUQTBXTBNB[PODPNKQBCPVUBXTXIBUTOFX BXTDMPVEGPSNBUJPOOPXTVQQPSUT JODSFBTFEMJNJUTPOpWFTFSWJDFRVPUBT Ϧιʔεͷ࠷େ਺͕ˠʹʂ

  23.  Lambda ؔ਺ͷϦιʔεϕʔεͷϙϦγʔ ্͕ݶ஋Λ௒͑ͨ😱

  24. ໰୊఺  -BNCEB͕ग़ྗͨ͠ϩά ϩάάϧʔϓ ʹTVCTDSJQUJPOpMUFSΛઃఆ

  25. ໰୊఺  ΞϓϦέʔγϣϯͷن໛͕େ͖͘ͳΔʹͭΕͯɺTVCTDSJQUJPOpMUFSͷର৅͕૿ ͑Δ

  26. ໰୊఺  ΞϓϦέʔγϣϯͷن໛͕େ͖͘ͳΔʹͭΕͯɺTVCTDSJQUJPOpMUFSͷର৅͕૿ ͑Δ

  27. ໰୊఺  ΞϓϦέʔγϣϯͷن໛͕େ͖͘ͳΔʹͭΕͯɺTVCTDSJQUJPOpMUFSͷର৅͕૿ ͑Δ

  28. ໰୊఺  -BNCEBͷϩάάϧʔϓʹରͯ͠ɺ -$POTUSVDUΛ࢖ͬͯTVCTDSJQUJPOpMUFSΛઃఆ TVCTDSJQUJPOpMUFSؔ਺

  29. ʜ \ 4JE999-BNCEB4VCTDSJQUJPO'JMUFS$BO*OWPLF-BNCEB  &⒎FDU"MMPX  1SJODJQBM\ 4FSWJDFMPHTBNB[POBXTDPN ^ 

    "DUJPOMBNCEB*OWPLF'VODUJPO  3FTPVSDFBSOBXTMBNCEBBQOPSUIFBTU999GVODUJPOIPHFTVCTDSJQUJPOpMUFS  $POEJUJPO\ "SO-JLF\ "844PVSDF"SOBSOBXTMPHTBQOPSUIFBTU999MPHHSPVQBXTMBNCEBGFBUVSF  ^ ^ ^  \ 4JE:::-BNCEB4VCTDSJQUJPO'JMUFS$BO*OWPLF-BNCEB&$4("$4)4;/6&  &⒎FDU"MMPX  1SJODJQBM\ 4FSWJDFMPHTBNB[POBXTDPN ^  "DUJPOMBNCEB*OWPLF'VODUJPO  3FTPVSDFBSOBXTMBNCEBBQOPSUIFBTU999GVODUJPOIPHFTVCTDSJQUJPOpMUFS  $POEJUJPO\ "SO-JLF\ "844PVSDF"SOBSOBXTMPHTBQOPSUIFBTU999MPHHSPVQBXTMBNCEBGFBUVSF  ^ ^ ^  ʜ ໰୊఺  TVCTDSJQUJPOpMUFSΛ௥Ճͨ͠ϩ άάϧʔϓ෼ɺϙϦγʔ͕૿͍͑ͯ ͘ɾɾɾ
  30. ໰୊఺  The final policy size (NNNNN) is bigger than

    the limit (20480) 😢
  31. ໰୊఺ͷղܾʹ͋ͨͬͯ  -BNCEBؔ਺ͷϦιʔεϕʔεͷϙϦγʔΛ,#Ҏ Լʹ͢Δඞཁ͕͋Δ w ੜ੒͞ΕΔϙϦγʔΛগͳ͘͢ΔͨΊʹɺαϒεΫϥΠϒ ର৅ͷϩάάϧʔϓΛݮΒ͢ඞཁ͕͋Δ w 💡TVCTDSJQUJPOpMUFSؔ਺Λ෼͚ͯΈΑ͏ʂ

  32. ղܾࡦ  TVCTDSJQUJPOpMUFSؔ਺ΛελοΫຖʹ࡞੒ͯ͠෼ׂ

  33. ղܾࡦ  TVCTDSJQUJPOpMUFSؔ਺ΛελοΫຖʹ࡞੒ͯ͠෼ׂ

  34. ղܾͨͭ͠΋ΓͰ͕ͨ͠ɾɾɾ  ࣌ؒͷܦաͱͱ΋ʹελοΫ಺ͷαϒεΫϥΠϒର৅ͷ ϩά͕૿͑ͯ͘Δͱɾɾɾ ಉ༷ͷ໰୊ʹ͋ͨΔ😅

  35. ໰୊఺ͷղܾʹ͋ͨͬͯ  -BNCEBؔ਺ͷϦιʔεϕʔεͷϙϦγʔΛ,# ҎԼʹ͢Δඞཁ͕͋Δ w ܁Γฦ͠ϙϦγʔεςʔτϝϯτΛ࡟আ͢Δ w ϫΠϧυΧʔυΛ࢖༻͢ΔϙϦγʔεςʔτϝϯτΛ௥Ճ ͢Δ ˞ࢀߟ

    -BNCEBͷʮ5IFpOBMQPMJDZTJ[FJTCJHHFSUIBOUIFMJNJUʯΤϥʔΛղܾ͢Δํ๏Λڭ͍͑ͯͩ͘͞ɻ IUUQTBXTBNB[PODPNKQQSFNJVNTVQQPSULOPXMFEHFDFOUFSMBNCEBSFTPVSDFCBTFEQPMJDZTJ[FFSSPS
  36. Ҏલͷߏ੒ʹ໭͢ ղܾࡦ̎ 

  37. ղܾࡦ̎  ݻఆͷϙϦγʔΛઃఆ͠ɺ܁Γฦ͠ϙϦγʔεςʔτϝϯτ͕ੜ੒͞Εͳ͍Α͏ʹ ͢Δ 4PVSDF"SO΍ 4PVSDF"DDPVOU ͳͲΛࢦఆ

  38. ղܾࡦ̎  4PVSDF"SOʹϫΠϧυΧʔυΛࢦఆ͢Δ·ͨ͸ 4PVSDF"DDPVOUͳͲΛࢦఆͯ͠ϙϦγʔΛઃఆ ݻఆͷϙϦγʔΛઃఆ͢Δ

  39. ղܾࡦ̎  -BNCEBͷϩάάϧʔϓʹରͯ͠ɺ -$POTUSVDUΛ࢖ͬͯTVCTDSJQUJPOpMUFSΛઃఆ ܁Γฦ͠ϙϦγʔεςʔτϝϯτ͕ੜ੒͞Εͳ͍Α͏ʹ͢Δ

  40. ʜ 4UBUFNFOU< \ 4JE999  &⒎FDU"MMPX  1SJODJQBM\ 4FSWJDFMPHTBNB[POBXTDPN ^

     "DUJPOMBNCEB*OWPLF'VODUJPO  3FTPVSDFlBSOBXTMBNCEBBQOPSUIFBTU999GVODUJPOIPHFTVCTDSJQUJPOpMUFS  $POEJUJPO\ 4USJOH&RVBMT\ "844PVSDF"DDPVOUl::::: ^ ^ ^ > ʜ ղܾࡦ̎  ੜ੒͞ΕͨϦιʔεϕʔεͷϙϦγʔ ܁Γฦ͠ͷϙϦγʔεςʔτϝϯτ͕ ੜ੒͞Εͳ͘ͳΓ·ͨ͠🎉 ݻఆͷϙϦγʔͷΈੜ੒
  41.  όʔδϣϯΞοϓ΁ͷ௥ै͕େม💦

  42. ໰୊఺  w $%,ͷΞοϓσʔτ͕සൟʹߦΘΕ͓ͯΓɺόʔ δϣϯΞοϓ͕ૣ͍ ॳظ։ൃ౰࣌͸Ͱ͕͋ͬͨݱࡏ͸ ˞ࣥච࣌఺ͷ࠷৽όʔδϣϯ͸ w όʔδϣϯΞοϓ࣌ͷมߋ఺ͷ֬ೝɺಈ࡞֬ೝ͕ͭΒ ͍

    #SFBLJOHDIBOHFͳͲͰಈ͔ͳ͘ͳΔͷͰ͸ʁ ਖ਼͘͠ಈ͔ͳ͘ͳΔͷͰ͸ʁ
  43. όʔδϣϯΞοϓ΁ͷϞνϕʔγϣϯ  w ͳΔ΂͘όʔδϣϯΞοϓʹ௥ैͯ͠৽͍͠ػೳ΍ό άϑΟοΫεͷԸܙΛड͚͍ͨ ֤Ϧιʔεͷ৽ػೳ΍$%,ͷ৽ػೳͳͲΛऔΓࠐΈ͍ͨ w ͳΔ΂͘ίετΛ͔͚ͣʹ҆શʹόʔδϣϯΞοϓ͠ ͍ͨ ௚઀ϓϩμΫτͷՁ஋ʹ݁ͼ͖ͭʹ͍͘ͷͰɺ͋·Γίετ

    Λ͔͚ͣʹ࣮ࢪ͍ͨ͠
  44. ղܾࡦ  εφοϓγϣοτςετ ੜ੒͞Εͨ$MPVE'PSNBUJPOςϯϓϨʔτ͕ɺҎલʹอଘ͞ Εͨج४ͱͳΔςϯϓϨʔτͱൺֱͯࠩ͠෼͕ͳ͍͜ͱΛݕূ ͢Δ͜ͱ͕Ͱ͖Δ όʔδϣϯΞοϓʹΑΔςϯϓϨʔτͷมߋՕॴΛ༰қʹ೺Ѳ ͢Δ͜ͱ͕Ͱ͖Δ💡 ˞ࢀߟ 5FTUJOHDPOTUSVDUT"84$MPVE%FWFMPQNFOU,JU

    $%,  IUUQTBXTBNB[PODPNKQQSFNJVNTVQQPSULOPXMFEHFDFOUFSMBNCEBSFTPVSDFCBTFEQPMJDZTJ[FFSSPS
  45. ΋͏গ͠ৄ͘͠  ॳճςετ࣌͸εφοϓγϣοτ͕ແ͍ͷͰɺεφοϓγϣοτΛอଘ͢Δ εφοϓγϣοτʹج४ͱͳΔςϯϓϨʔτ

  46. ΋͏গ͠ৄ͘͠  ॳճςετ࣌͸εφοϓγϣοτ͕ແ͍ͷͰɺεφοϓγϣοτΛอଘ͢Δ εφοϓγϣοτʹج४ͱͳΔςϯϓϨʔτ

  47. ΋͏গ͠ৄ͘͠  όʔδϣϯΞοϓޙͷςετ

  48. ΋͏গ͠ৄ͘͠  όʔδϣϯΞοϓޙͷςετ

  49. ΋͏গ͠ৄ͘͠  όʔδϣϯΞοϓޙͷςετ

  50. ΋͏গ͠ৄ͘͠  όʔδϣϯΞοϓޙͷςετ

  51. ΋͏গ͠ৄ͘͠  όʔδϣϯΞοϓޙͷςετ

  52. εφοϓγϣοτςετͷ5JQT  -BNCEBؔ਺ͷίʔυΛมߋ͢ΔͱςϯϓϨʔτͷΞ ηοτ͕มΘͬͯ͠·͍ɺεφοϓγϣοτͱͷࠩ෼͕ ൃੜ͢Δ ΞϓϦέʔγϣϯίʔυͷมߋʹΑΓɺࠩ෼͕ൃੜ͢Δͱຊ࣭ తͰ͸ͳ͍ࠩ෼͕ൃੜͯ͠͠·͏ ˠ͜ͷࠩ෼Λແࢹ͍ͨ͠

  53. εφοϓγϣοτςετͷ5JQT  +FTUͷ4OBQTIPU4FSJBMJ[FSΛ࢖ͬͯࠩ෼Λແࢹ͢Δ Ξηοτ໊Λݻఆจࣈྻʹஔ͖׵͑Δ ࡞੒ͨ͠4FSJBMJ[FSΛ௥Ճͯ͠ 4OBQTIPU5FTUΛ࣮ߦ͢Δ ˞ࢀߟ &YQFDUu+FTU IUUQTKFTUKTJPEPDTFYQFDUFYQFDUBEETOBQTIPUTFSJBMJ[FSTFSJBMJ[FS

  54. εφοϓγϣοτςετͷ5JQT  +FTUͷ4OBQTIPU4FSJBMJ[FSΛઃఆͯࠩ͠෼Λ֬ೝ ʜ 0CKFDU\ 1BSBNFUFST0CKFDU\ "TTFU1BSBNFUFSTFCDEBDDBCCFBGEECBCBDDCFBCGC"SUJGBDU)BTI"0CKFDU\ %FTDSJQUJPO"SUJGBDUIBTIGPSBTTFUaFCDEBDDBCCFBGEECBCBDDCFBCGCa  <)"4)3&.07&%>0CKFDU\

    %FTDSJQUJPO<)"4)3&.07&%>  5ZQF4USJOH  ^  ʜ
  55. ؔ࿈͢ΔϒϩάΛ঺հ  IUUQTEFWDMBTTNFUIPEKQBSUJDMFTBXTDELVOJU UFTUJHOPSFBTTFUTVTJOHKFTUTOBQTIPUTFSJBMJ[FS IUUQTEFWDMBTTNFUIPEKQBSUJDMFTBXT DELVOJUUFTUJHOPSFBTTFUT

  56. ΞδΣϯμ  ‣ 1SPqMZͱ$%,ͷ࣮૷ʹ͍ͭͯ ‣ ௚໘ͨ͠໰୊ͱղܾ΁ͷΞϓϩʔν ‣ ·ͱΊ

  57. ·ͱΊ  w $%,͸σϓϩΠ࣌ʹ$MPVE'PSNBUJPOΛར༻ͯ͠ ͍ΔͷͰɺ$MPVE'PSNBUJPOͷ੍ݶ΍੍໿Λߟྀ͢ Δඞཁ͕͋Δ w ಈతʹੜ੒͞ΕΔΑ͏ͳϦιʔε͸ɺΞϓϦέʔγϣ ϯͷن໛͕େ͖͘ͳͬͨ৔߹ʹ໰୊ͳ͍͜ͱΛ֬ೝ͢ Δ

    w εφοϓγϣοτςετΛ׆༻ͯ͠ɺ$%,ͷόʔδϣ ϯΞοϓͱ্ख͘෇͖߹͏
  58. None