Slide 1

Slide 1 text

+"846($%,ࢧ෦ ۚ৓ल࠸ 44.ύϥϝʔλʔετΞͰ ΫϩεελοΫࢀরͷ᠘Λճආ͢Δ $9ࣄۀຊ෦%FMJWFSZ෦

Slide 2

Slide 2 text

ࣗݾ঺հ w Ϋϥεϝιουגࣜձࣾ w αʔόʔαΠυΤϯδχΞ w "1/"--"84$FSUJGJDBUJPOT&OHJOFFS w ޷͖ͳ"84ͷαʔϏε w "84$%,ɺ$MPVE'PSNBUJPO w $PEFγϦʔζ ۚ৓ल࠸ 4IVZB,JOKP @joe-king-sh

Slide 3

Slide 3 text

ελοΫؒͷύϥϝʔλʔࢀর ԿΛ࢖ͬͯ·͔͢ʁ

Slide 4

Slide 4 text

ελοΫؒͷύϥϝʔλʔࢀরํ๏ ΫϩεελοΫࢀর &YQPSU*NQPSU 1SPQT౉͠ͷΫϩεελοΫࢀরʹΑΔࣗಈղܾ Ϧιʔε໊΍"3/Λ௚ଧͪͰࢦఆ 44.ύϥϝʔλʔετΞ

Slide 5

Slide 5 text

ελοΫؒͷύϥϝʔλʔࢀরํ๏ ΫϩεελοΫࢀর &YQPSU*NQPSU 1SPQT౉͠ͷΫϩεελοΫࢀরʹΑΔࣗಈղܾ Ϧιʔε໊΍"3/Λ௚ଧͪͰࢦఆ 44.ύϥϝʔλʔετΞ ؍ଌൣғͰ͸͜Ε͕ଟ͍

Slide 6

Slide 6 text

Կ΋ߟ͑ͣʹ1SPQT౉͠Λ࢖͍ͬͯΔ৔߹ ؾ෇͔͵͏ͪʹ ΫϩεελοΫࢀরͷ᠘ʹ ϋϚ͍ͬͯΔՄೳੑ͕͋Γ·͢

Slide 7

Slide 7 text

ࠓ೔͓࿩͢͠Δ͜ͱ

Slide 8

Slide 8 text

͜ͷ෼Ͱ͓࿩͢͠Δ͜ͱ 1SPQT౉͠ͷΫϩεελοΫࢀরͰൃੜ͢Δ໰୊ 44.ύϥϝʔλʔετΞΛ༻͍ͨճආํ๏ ελοΫ෼ׂͷߟ͑ํ

Slide 9

Slide 9 text

·ͣΫϩεελοΫࢀরͷ͓͞Β͍

Slide 10

Slide 10 text

ΫϩεελοΫࢀরͱ͸ $MPVE'PSNBUJPOͷඪ४ػೳ ࢀরݩελοΫ ඃࢀরελοΫ ࢀর

Slide 11

Slide 11 text

ඃࢀরελοΫଆͷϦιʔε͸࡟আɾมߋ͕Ͱ͖·ͤΜ ΫϩεελοΫࢀরͷ੍ݶ Lambda ελοΫ -BNCEB -BNCEB "1* (BUF8BZ API Gateway ελοΫ DynamoDB ελοΫ ΫϩεελοΫࢀর ΫϩεελοΫࢀর ࡟আɾมߋෆՄ ࡟আɾมߋෆՄ ҎԼͷ%ZOBNP%#ςʔϒϧ໊ͷมߋɺ-BNCEBؔ਺໊ͷมߋ΍࡟আΛ͠Α͏ͱ͢Δͱɺ ଞͷελοΫ͔Βࢀর͞Ε͍ͯΔΤϥʔͰσϓϩΠ͕ࣦഊ͠·͢ɻ %ZOBNP%#

Slide 12

Slide 12 text

ํ๏ɿࢀরݩελοΫΛ࡟আ͢Δ ΫϩεελοΫࢀরΤϥʔͷղফํ๏ wຊ൪ՔಇޙͳΒμ΢ϯλΠϜඞਢ wεςʔτϑϧͳϦιʔε͕ଘࡏ͢ΔͱऔΕͳ͍ํ๏ Lambda ελοΫ -BNCEB -BNCEB "1* (BUF8BZ API Gateway ελοΫ DynamoDB ελοΫ %ZOBNP%#

Slide 13

Slide 13 text

ํ๏ɿผͷϦιʔε 0VUQVUT ʹࢀরઌΛ੾Γସ͑ͯ ͔Βมߋ͢Δ ΫϩεελοΫࢀরΤϥʔͷղফํ๏ wσϓϩΠ͕ෳ਺ճඞཁͰ໘౗ Lambda ελοΫ -BNCEB -BNCEB "1* (BUF8BZ %ZOBNP%# API Gateway ελοΫ DynamoDB ελοΫ %ZOBNP%# ᶄࢀরઌΛ੾Γସ͑ͯґଘΛͳ͘͢ ᶅ࡟আ or มߋ͢Δ ᶃ৽ͨʹϦιʔεΛ࡞Δ(OutputsͰExportΛ࡞Δ)

Slide 14

Slide 14 text

ΫϩεελοΫࢀর࢖༻࣌ͷ஫ҙ఺ ελοΫؒͷґଘؔ܎ͷ޲͖ ඃࢀরελοΫͷߋ৽ස౓ ϥΠϑαΠΫϧ

Slide 15

Slide 15 text

CDKͰΫϩεελοΫࢀর͢Δํ๏͸ʁ

Slide 16

Slide 16 text

ํ๏1: CfnOutputίϯετϥΫτΛ࢖༻͢Δ

Slide 17

Slide 17 text

ํ๏$GO0VUQVUίϯετϥΫτΛ࢖༻͢Δ ඃࢀরελοΫ Ҿ༻ݩ: AWS CDKͰΫϩεελοΫࢀরΛͯ͠Έͨ $MPVE'PSNBUJPOͷ0VUQVUTʹ &YQPSU͕ੜ੒͞ΕΔ

Slide 18

Slide 18 text

ํ๏$GO0VUQVUίϯετϥΫτΛ࢖༻͢Δ ࢀরݩελοΫ $MPVE'PSNBUJPOςϯϓϨʔτʹ 'O*NQPSU7BMVF͕ੜ੒͞ΕΔ Ҿ༻ݩ: AWS CDKͰΫϩεελοΫࢀরΛͯ͠Έͨ

Slide 19

Slide 19 text

ํ๏2: Props౉͠ͷΫϩεελοΫࢀরͰ ࣗಈղܾ͢Δ

Slide 20

Slide 20 text

ํ๏1SPQT౉͠Ͱࣗಈղܾ͢Δ ඃࢀরελοΫ

Slide 21

Slide 21 text

ํ๏1SPQT౉͠Ͱࣗಈղܾ͢Δ ࢀরݩελοΫ 1SPQT͔Β౉͖ͬͯͨΩϡʔ͕ɺ 4/4τϐοΫΛαϒεΫϥΠϒ͠·͢

Slide 22

Slide 22 text

ํ๏1SPQT౉͠ͷࣗಈղܾ ඃࢀরελοΫˠࢀরݩελοΫͷϦιʔεड͚౉͠ 4UBDLͷ1SPQTͰɺ 424ͷΩϡʔΛड͚౉͠·͢

Slide 23

Slide 23 text

CDKΛ࢖͏ͳΒProps౉͠Ͱࣗಈղܾ͕ ศརͳͷͰ͸ɾɾʁ🧐

Slide 24

Slide 24 text

1SPQT౉͕͠ศརͦ͏ʹࢥ͑Δ఺ ໌ࣔతʹ$GO0VUQVUΛॻ͔ͳͯ͘ྑ͍ $%,ͷϨΠϠʔ ϓϩάϥϛϯάݴޠ ͰϦιʔεͷ ґଘؔ܎͕௥͑Δ ͬͪ͜ͷํ͕ศརͦ͏🥳

Slide 25

Slide 25 text

1SPQT౉͕͠ศརͦ͏ʹࢥ͑Δ఺ ໌ࣔతʹ$GO0VUQVUΛॻ͔ͳͯ͘ྑ͍ $%,ͷϨΠϠʔ ϓϩάϥϛϯάݴޠ ͰϦιʔεͷ ґଘؔ܎͕௥͑Δ ὃ͞Εͯ͸͍͚·ͤΜ😇

Slide 26

Slide 26 text

ὃ͞Εͯ͸͍͚·ͤΜ ͜͜ʹProps౉͠ͷ ΫϩεελοΫࢀরͷ᠘͕͋Γ·͢😇

Slide 27

Slide 27 text

ʲ࠶ܝʳํ๏1SPQT౉͠ͷࣗಈղܾ ඃࢀরελοΫˠࢀরݩελοΫͷϦιʔεड͚౉͠ 4UBDLͷ1SPQTͰɺ 424ͷΩϡʔΛड͚౉͠·͢

Slide 28

Slide 28 text

$%,ϨΠϠʔͰͷελοΫͷґଘؔ܎ 5PQJD4UBDL͕1SPQTͰ౉͞Ε͖ͯͨ2VFVFΛࢀর͍ͯ͠Δ

Slide 29

Slide 29 text

$MPVE'PSNBUJPOϨΠϠʔͰͷελοΫͷґଘؔ܎ 5PQJD4UBDL͕τϐοΫ໊Λ&YQPSUͯ͠ɺ 2VFVF4UBDL͕ɺͦΕΛ*NQPSU7BMVFͰࢀর͍ͯ͠Δ Ϧιʔε͸2VFVFελοΫଆʹ࡞੒͞Ε͍ͯΔ

Slide 30

Slide 30 text

ͳͥ͜Μͳ͜ͱ͕ى͖Δͷ͔🤔

Slide 31

Slide 31 text

4/45PQJDͷ࣮૷ͰɺTDPQF͕͢Γସ͑ΒΕ͍ͯΔ αϒεΫϥΠόʔଆ 2VFVF4UBDL ͷ TDPQFʹ͢Γସ͑ αϒεΫϥΠόʔଆ 2VFVF4UBDL ͷTDPQFʹɺ 4VCTDSJQUJPOΛ࡞੒͍ͯ͠Δ PR: fi x(sns): create subscriptions in consumer scope #3065

Slide 32

Slide 32 text

ͳͥTDPQFΛ͢Γସ͑Δͷ͔ *TTVFʹΑΔͱ Issue: sns: topic.addSubscription should create the subscription on the consumer's stack to avoid cycles #3064 ཧ༝ɿελοΫؒͷ॥؀ࢀরΛආ͚ΔͨΊ w4/4͔ΒϝοηʔδΛड͚औΔίϯγϡʔϚελοΫ͸5PQJDΛࢀর͢ Δέʔε͕ଟ͍ w˞௨ৗ-BNCEBΛ*OWPLFͨ͠Γ2VFVF͕ϝοηʔδΛड৴͢Δͷʹ 5PQJDͷ"3/Λ༻͍ͯϙϦγʔΛߋ৽͢ΔͨΊ wͲ͏ͤίϯγϡʔϚ͔Β5PQJDΛࢀর͢ΔͳΒɺ4VCTDSJQUJPO΋ɺίϯ γϡʔϚଆʹ͓͍ͨํ͕ɺࢀরͷ޲͖͕Ұํ޲ʹͳΓ॥؀ࢀরΛ๷͛Δ

Slide 33

Slide 33 text

1SPQT౉͠ͷΫϩεελοΫࢀরͷ஫ҙ఺ CloudFormationͷ ΫϩεελοΫࢀরࣗମ ͦ΋ͦ΋ѻ͍͕೉͍͠😣

Slide 34

Slide 34 text

1SPQT౉͠ͷΫϩεελοΫࢀরͷ஫ҙ఺ ͞ΒʹCDKͰந৅Խ͞ΕΔͷͰɺ CloudFormationͷϨΠϠʔͰͷ ґଘؔ܎ͷ޲͖ʹ஫ҙ͕ඞཁ⚠

Slide 35

Slide 35 text

Ͱ͸Ͳ͏͢Δ΂͖͔ʁ

Slide 36

Slide 36 text

Lambda ελοΫ -BNCEB -BNCEB "1* (BUF8BZ %ZOBNP%# API Gateway ελοΫ DynamoDB ελοΫ ύϥϝʔ λʔετΞ ύϥϝʔ λʔετΞ ొ࿥ ࢀর ొ࿥ ࢀর Φεεϝͷํ๏44.ύϥϝʔλʔετΞΛ࢖༻ ελοΫ͕ؒૄ݁߹ʹͳΔ

Slide 37

Slide 37 text

Φεεϝͷํ๏44.ύϥϝʔλʔετΞΛ࢖༻ ඃࢀরελοΫ 5PQJD"SOΛ44.ύϥϝʔλʔετΞ΁ΤΫεϙʔτ

Slide 38

Slide 38 text

ࢀরݩελοΫ Φεεϝͷํ๏44.ύϥϝʔλʔετΞΛ࢖༻ 2VFVFελοΫଆʹ4VCTDSJQUJPOΛ࡞ΔͷͰɺ $%,ͱ$MPVE'PSNBUJPOϨΠϠʔͰɺґଘؔ܎ͷ޲͖͕Ұக

Slide 39

Slide 39 text

ελοΫؒͷґଘؔ܎ͷ໌ࣔ Φεεϝͷํ๏44.ύϥϝʔλʔετΞΛ࢖༻ w$%,ͷࣗݾղܾʹ೚ͤͳ͍෼ɺελοΫؒͷґଘؔ܎ͷ໌ࣔ͢Δඞཁ͋Γ wઌʹ5PQJDελοΫΛσϓϩΠͯ͠ύϥϝʔλʔετΞʹొ࿥ wͦͷޙ2VFVFελοΫͷσϓϩΠΛ૸ΒͤΔ

Slide 40

Slide 40 text

44.ύϥϝʔλʔετΞͷར఺ Lambda ελοΫ -BNCEB -BNCEB "1* (BUF8BZ %ZOBNP%# API Gateway ελοΫ DynamoDB ελοΫ ύϥϝʔ λʔετΞ ύϥϝʔ λʔετΞ ొ࿥ ࢀর ొ࿥ ࢀর wΫϩεελοΫࢀরͷڧ੍͍໿ʹറΒΕͳ͍ wύϥϝʔλʔετΞͷ஋͸खಈมߋՄೳ ༥௨͕ޮ͘

Slide 41

Slide 41 text

44.ύϥϝʔλʔετΞͷར఺ SSMύϥϝʔλʔετΞΛ༻͍Δͱɺ ΫϩεελοΫࢀরΑΓ΋ॊೈʹ ґଘؔ܎Λѻ͑·͢☝

Slide 42

Slide 42 text

ԿΑΓ΋େ੾ͳ͜ͱ͸ɾɾ

Slide 43

Slide 43 text

ͦͷελοΫؒࢀর͸ ຊ౰ʹඞཁͰ͔͢ʁ🤨

Slide 44

Slide 44 text

wςϯϓϨʔτελοΫ wՄಡੑͷͨΊʹϦιʔεͷϥΠϑαΠΫϧͰద੾ͳα ΠζʹςϯϓϨʔτΛ෼ׂ͢Δඞཁ͕͋ͬͨ $MPVE'PSNBUJPOͷ࣌୅ Lambda ελοΫ -BNCEB -BNCEB "1* (BUF8BZ %ZOBNP%# DynamoDB ελοΫ API Gateway ελοΫ

Slide 45

Slide 45 text

$%,Ͱ͸$POTUSVDUͰ෼ׂ͕Մೳ -BNCEB -BNCEB "1* (BUF8BZ %ZOBNP%# Application A Stack Lambda Construct API Gateway Construct DynamoDB Construct wՄಡੑͷͨΊʹ4UBDLΛ෼͚Δඞཁ͸ͳ͍ wಉ͡ελοΫؒͷϦιʔεࢀর͸ۃΊͯγϯϓϧ

Slide 46

Slide 46 text

$%,ͷϕετϓϥΫςΟε Ҿ༻ݩ: AWS CDKͰΫϥ΢υΞϓϦέʔγϣϯΛ։ൃ͢ΔͨΊͷϕετϓϥΫςΟε

Slide 47

Slide 47 text

·ͱΊ wΫϩεελοΫࢀর͸ඃࢀরଆΛߋ৽͢Δӡ༻͕ਏ͍ w1SPQT౉͠ͷࢀর͸ґଘͷ޲͖ͷ੍ޚ͕೉͍͠ wελοΫͷ෼ׂ਺Λ࠷௿ݶʹͯ͠ελοΫؒͷύϥ ϝʔλʔࢀরΛগͳ͘͢Δ͜ͱ͕࠷΋ॏཁ wͲ͏ͯ͠΋෼͚Δඞཁ͕͋Δ৔߹͸ɺ44.ύϥϝʔ λʔετΞΛ࢖͏ͱɺΫϩεελοΫࢀরΑΓ΋ॊೈ ʹɺґଘؔ܎ͷ੔ཧ͕Մೳ

Slide 48

Slide 48 text

ࢀߟ৘ใ https://dev.classmethod.jp/articles/best-way-to-reference-parameters-in-cdk/

Slide 49

Slide 49 text

ࢀߟ৘ใ https://dev.classmethod.jp/articles/aws-cdk-props-cross-stack-reference-problem-and-handle/

Slide 50

Slide 50 text