Slide 1

Slide 1 text

(Pݚमୈظ %": :VUBLB,BUP 
 3% %&4".*4 %&4".*4ࣾ಺ݚम

Slide 2

Slide 2 text

ݚमܭը ճ ೔࣍ ༧ఆ λΠτϧ ୈճ Ր (Pͷجຊ ୈճ Ր ؀ڥߏஙͱ(JU (JU)VCͷجຊ ୈճ Ր جຊߏจ ୈճ Ր ߏ଄ମɺεϥΠεɺϚοϓ ୈճ Ր ඪ४ϥΠϒϥϦ͸΍Ί͙Γ ୈճ Ր ϞδϡʔϧγεςϜͱ֎෦ϥΠϒϥϦ ୈճ Ր )FSPLV(Pೖ໳ ୈճ Ր "84-BNCEB(Pೖ໳ ୈճ Ր ฒߦॲཧϓϩάϥϛϯά ୈճ Ր ୯ମςετٕ๏ ୈճ Ր σʔλϕʔεΞΫηε ୈճ Ր 'ZOFʹΑΔ(6*ΞϓϦέʔγϣϯ։ൃ ୈճ Ր ࣾ಺(PϓϩδΣΫτͷίʔυղઆ

Slide 3

Slide 3 text

˞ લճͷ՝୊ͷ 
 ղઆλΠϜ

Slide 4

Slide 4 text

ຊ೔ͷΰʔϧ w 🚩ΰʔϧ w (PͰ"84-BNCEBΛ։ൃ͢Δํ๏Λशಘ͢Δ w ؆қ3&45"1*ͷߏஙํ๏Λཧղ͢Δ w ❌ΰʔϧͰ͸ͳ͍ w "84ͷଞͷ༷ʑͳαʔϏεͱͷ࿈ܞΛ໨ࢦ͢

Slide 5

Slide 5 text

"84-BNCEB

Slide 6

Slide 6 text

"84-BNCEBͱ͸ w ೥ʹΠϕϯτۦಈͷؔ਺ ϓϩάϥϜ ࣮ߦج൫ͱͯ͠ొ৔ w /PEFKT 1ZUIPO +BWB (P 3VCZ /&5 $ 1PXFS4IFMM ʹରԠɺ ΧελϜϥϯλΠϜͰͦΕҎ֎ͷ࣮ߦ؀ڥ΋ߏஙՄೳ w ϓϥοτϑΥʔϜͱͷ੹೚෼ք఺͕࠷΋ߴ͍ 
 ։ൃɾӡ༻ऀଆ͕੹೚Λ࣋ͨͳ͍ͱ͍͚ͳ͍ൣғ͕࠷খ ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ *BB4 $BB4 ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ 1BB4 ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ 'BB4 ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ 4BB4

Slide 7

Slide 7 text

"84-BNCEBͱ͸ w ೥ʹΠϕϯτۦಈͷؔ਺ ϓϩάϥϜ ࣮ߦج൫ͱͯ͠ొ৔ w /PEFKT 1ZUIPO +BWB (P 3VCZ /&5 $ 1PXFS4IFMM ʹରԠɺ ΧελϜϥϯλΠϜͰͦΕҎ֎ͷ࣮ߦ؀ڥ΋ߏஙՄೳ w ϓϥοτϑΥʔϜͱͷ੹೚෼ք఺͕࠷΋ߴ͍ 
 ։ൃɾӡ༻ऀଆ͕੹೚Λ࣋ͨͳ͍ͱ͍͚ͳ͍ൣғ͕࠷খ ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ *BB4 $BB4 ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ 1BB4 ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ 'BB4 ϋʔυ΢ΣΞ ϋΠύʔόΠβʔ 04 ϥϯλΠϜϛυϧ΢ΣΞ ϑϨʔϜϫʔΫ ΞϓϦέʔγϣϯ 4BB4

Slide 8

Slide 8 text

-BNCEBʹ͓͚Δ(P w "84͕ఏڙ͢ΔϥΠϒϥϦΛ༻͍ͯ։ൃ͢Δ w ༷ʑͳϋϯυϥؔ਺ͷܗࣜΛબ୒Մೳ w Y-JOVY޲͚ʹΫϩείϯύΠϧ࣮ͨ͠ߦόΠφϦΛϏϧυ͠ɺͦ ΕΛΠϝʔδԽͯ͠഑උ͢Δඞཁ͕͋Δ package mai n import "github.com/aws/aws-lambda-go/lambda " func handler() (string, error) { return "͜Μʹͪ͸ʂ", ni l } func main() { lambda.Start(handler ) }

Slide 9

Slide 9 text

ϋϯυϥؔ਺γάχνϟ • func ( ) • func () erro r • func (TIn), erro r • func () (TOut, error ) • func (context.Context) erro r • func (context.Context, TIn) erro r • func (context.Context) (TOut, error ) • func (context.Context, TIn) (TOut, error) TIn , TOut は 標準 ラ イ ブ ラ リ で J S O N 
 エ ン コ ー ド ・デ コ ー ド 可能 な 任意 の 型 を 選択可能 ͖ͬ͞ͷίʔυྫ͸͜Ε ΤϥʔΛฦ͢ͱσϑΥϧτͰճ·ͰϦτϥΠͯ͘͠ΕΔ

Slide 10

Slide 10 text

-BNCEBͷ࢓૊Έ ιʔείʔυ 
 εΫϦϓτ 'JSFDSBDLFS.JDSP7. $POUSPM1MBOF "1*(BUFXBZ [JQ ࣮ߦόΠφϦ 
 ίϯύΠϧࡁ 03 λ 'VODUJPO $8& 4/4 424 4 
 *P5$PSF 
 %ZOBNP%# ʜ FUD σϓϩΠ σϓϩΠ τϦΨʔ %BUB1MBOF ׂΓ౰ͯ 
 ࣮ߦ -BZFST

Slide 11

Slide 11 text

ؔ਺ͷݺ͹Εํ w ৽͍͠.JDSP7.ʹؔ਺ׂ͕Γ౰ͯΒΕΔͱɺmain()΍init() ͋Ε͹ ͕ݺ͹Ε͔ͯΒϋϯυϥؔ਺͕ݺ͹ΕΔ ίʔϧυελʔτ w Ұఆ࣌ؒ಺ͷ܁Γฦ͠ͷݺͼग़͠Ͱ͸Πϯελϯε͕࠶ར༻͞ΕΔ w ͭͷΠϯελϯε্ͷϋϯυϥؔ਺͕ಉ࣌ʹฒߦͯ͠ݺ͹ΕΔ͜ͱ͸ͳ͍ package mai n import "github.com/aws/aws-lambda-go/lambda " func handler() (string, error) { return "͜Μʹͪ͸ʂ", ni l } func main() { lambda.Start(handler ) } Πϕϯτൃੜͷ౓ʹݺ͹ΕΔ ίʔϧυελʔτ࣌ͷΈݺ͹ΕΔ

Slide 12

Slide 12 text

ྉۚମܥ ৄࡉ͸IUUQTBXTBNB[PODPNKQMBNCEBQSJDJOH ϦΫΤετ՝ۚ ࣮ߦ࣌ؒ՝ۚ ถࠃɾ౦ژϦʔδϣϯ 
 ճ େࡕϦʔδϣϯ 
 ճ ถࠃɾ౦ژϦʔδϣϯ 
 (#ඵ େࡕϦʔδϣϯ 
 (#ඵ ׂΓ౰ͯ.#࣮ߦඵͷؔ਺Λສճ࣮ߦͨ͠Βʜ ถࠃɾ౦ژϦʔδϣϯେࡕϦʔδϣϯ "84ΞΧ΢ϯτ಺ͷແྉ࿮ຖ݄ ϦΫΤετɺ (#ඵ

Slide 13

Slide 13 text

(Pͱͷ૬ੑ w ࣮ߦ࣌ؒͱׂΓ౰ͯϝϞϦྔ͕ίετʹμΠϨΫτʹޮ͘ w ϝϞϦ࢖༻ޮ཰͕ߴ࣮͘ߦ͕ߴ଎ͳ(P͸௿ίετͰӡ༻͠΍͍͢ w ϩʔΧϧͱ-BNCEBͷ؀ڥࠩҟʹ೰·͞ΕΔ͜ͱ͕΄ͱΜͲͳ͍ w όΠφϦ͕Ͱ͖ͨ࣌఺ͰϥϯλΠϜ΋ϥΠϒϥϦ΋શͯ૊Έࠐ·Ε Δ(P͸$16ͱ04͑͞߹͍ͬͯΕ͹جຊతʹͲ͜Ͱ΋ಈ͘ w ͳ͓"84ίϯιʔϧͷΤσΟλͰ͸௚઀ؔ਺Λ࣮૷Ͱ͖ͳ͍ w ରԠ͍ͯ͠Δͷ͸εΫϦϓτݴޠ 1ZUIPO /PEFKTͳͲ ͷΈͳ ͷͰఘΊΑ͏ ͦ΋ͦ΋ؔ਺ίʔυ͸(JU)VCͰͪΌΜͱ؅ཧ͢΂͖ʂ

Slide 14

Slide 14 text

։ൃπʔϧ w -BNCEBͷ։ൃɺςετɺσϓϩΠʹ͸ "84ίϯιʔ ϧΛૢ࡞͢ΔͷͰ͸ͳ͘ πʔϧΛ࢖ͬͯߦ͏ͷ͕ޮ཰తɺ ༷ʑͳબ୒ࢶ͕͋Δ πʔϧ ։ൃݩ ֓ཁ 4FSWFSMFTT"QQMJDBUJPO.PEFM "84 "84ެࣜͷ-BNCEB։ൃπʔϧ 4FSWFSMFTT'SBNFXPSL 4FSWFSMFTT *OD ࠷΋ਓؾͷαʔόʔϨε։ൃπʔϧ $MPVE%FWFMPQNFOU,JU "84 ༷ʑͳݴޠͰهड़Մೳͳ*B$πʔϧ ϚϧνΫϥ΢υ*B$πʔϧ ֤ࣾ 5FSSBGPSN 1VMVNJͳͲ $IBMJDF "84 1ZUIPO-BNCEBઐ༻

Slide 15

Slide 15 text

։ൃπʔϧ w -BNCEBͷ։ൃɺςετɺσϓϩΠʹ͸ "84ίϯιʔ ϧΛૢ࡞͢ΔͷͰ͸ͳ͘ πʔϧΛ࢖ͬͯߦ͏ͷ͕ޮ཰తɺ ༷ʑͳબ୒ࢶ͕͋Δ πʔϧ ։ൃݩ ֓ཁ 4FSWFSMFTT"QQMJDBUJPO.PEFM "84 "84ެࣜͷ-BNCEB։ൃπʔϧ 4FSWFSMFTT'SBNFXPSL 4FSWFSMFTT *OD ࠷΋ਓؾͷαʔόʔϨε։ൃπʔϧ $MPVE%FWFMPQNFOU,JU "84 ༷ʑͳݴޠͰهड़Մೳͳ*B$πʔϧ ϚϧνΫϥ΢υ*B$πʔϧ ֤ࣾ 5FSSBGPSN 1VMVNJͳͲ $IBMJDF "84 1ZUIPO-BNCEBઐ༻ 今回 は こ れ で

Slide 16

Slide 16 text

ϋϯζΦϯ 
 1"35

Slide 17

Slide 17 text

ϋϯζΦϯ1"35ͷྲྀΕ "84$-*ͱ"844".$-*Λಋೖ͢Δ 74$PEFͰίʔυ ؔ਺ Λ࣮૷͢Δ 4".ςϯϓϨʔτΛ࡞੒͢Δ σϓϩΠ͢Δ ಈ࡞Λ֬ೝ͢Δ

Slide 18

Slide 18 text

45&1"84$-*ͷઃఆ ҎԼͷ63-Λ։͖"84$-* W Λμ΢ϯϩʔυ͠·͢ 
 IUUQTBXTBNB[PODPNKQDMJ Πϯετʔϥʔ NTJϑΝΠϧ Λىಈͯ͠Πϯετʔϧ͠·͢ શ෦σϑΥϧτͷ··ਐΊΔ

Slide 19

Slide 19 text

45&14".$-*ͷಋೖ ҎԼͷ63-Λ։͖"844".$-*Λμ΢ϯϩʔυ͠·͢ 
 IUUQTBXTBNB[PODPNKQTFSWFSMFTTTBN Πϯετʔϥʔ NTJϑΝΠϧ Λىಈͯ͠Πϯετʔϧ͠·͢ ˞%PDLFSͷಋೖ͸ΦϓγϣϯͰ͢ ϋϯζΦϯͰ͸লུ͠·͢ શ෦σϑΥϧτͷ··ਐΊΔ

Slide 20

Slide 20 text

45&1ؔ਺ͷ࣮૷ 74$PEFΛىಈ͠ݚमϦϙδτϦΛ։͖·͢ Ϣʔβʔ໊ϑΥϧμҎԼʹʮEBZMBNCEBʯϑΥϧμΛ࡞੒͠ɺ ͦͷதʹҎԼͷ಺༰ͰʮIBOEMFSHPʯΛ࡞੒͠·͢ package mai n import "github.com/aws/aws-lambda-go/lambda " func handler() (string, error) { return "͜Μʹͪ͸ʂ", ni l } func main() { lambda.Start(handler ) } ೖྗΛऴ͑ͨΒIBOEMFSHPΛӈΫϦοΫͯ͠౷߹λʔϛφϧΛ։͖ɺ 
 ʮgo mod tidyʯʻ&OUFSʼΛೖྗ͠·͢

Slide 21

Slide 21 text

45&14".ςϯϓϨʔτ IBOEMFSHPͱಉ͡σΟϨΫΠτϦʹҎԼͷ಺༰ͰʮUFNQMBUFZNMʯ Λ࡞੒͍ͯͩ͘͠͞ Ϣʔβʔ໊ͷͱ͜Ζ͸ม͍͑ͯͩ͘͞ AWSTemplateFormatVersion: '2010-09-09 ' Transform: AWS::Serverless-2016-10-3 1 Resources : GoTraining<Ϣʔβʔ໊>1 : Type: AWS::Serverless::Functio n Properties : FunctionName: go-training-<Ϣʔβʔ໊>- 1 CodeUri: . Handler: handle r Runtime: go1. x MemorySize: 128 # M B Timeout: 5 # Se c Events : Timer : Type: Schedul e Properties : Schedule: rate(1 minute)

Slide 22

Slide 22 text

45&1ΞΫηεΩʔͷઃఆ "84ϚωδϝϯτίϯιʔϧʹϩάΠϯ͠ɺΞΫηεΩʔΛൃߦ͠·͢ ը໘ӈ্ͷ<Ϣʔβʔ໊!ΞΧ΢ϯτ໊˝>ͷϝχϡʔ͔Β<ϚΠηΩϡϦ ςΟࢿ֨৘ใ>Λબ୒ <ΞΫηεΩʔͷ࡞੒>ϘλϯΛΫϦοΫɺʮΞΫηεΩʔ*%ʯͱʮγʔΫϨοτΞ ΫηεΩʔʯͷ಺༰Λه࿥ w 5*14MBDLͷࣗ෼Ѽͷ%.ʹॻ͖ࠐΜͰ͓͘ͳͲ͓ͯ͘͠ͱศར ౷߹λʔϛφϧͰʮaws configureʯʻ&OUFSʼΛ࣮ߦ͠ɺҎԼͷ಺༰Λೖྗ͠·͢ "84"DDFTTLFZ*% ઌఔൃߦ͞ΕͨΞΫηεΩʔ*% "844FDSFU"DDFTT,FZ ઌఔൃߦ͞ΕͨγʔΫϨοτΞΫηεΩʔ %FGBVMUSFHJPOOBNF BQOPSUIFBTU %FGBVMUPVUQVUGPSNBU Կ΋ೖྗͤͣ&OUFS ۀ຿Ͱ࣮ࢪࡁͷํ͸εΩοϓՄ

Slide 23

Slide 23 text

45&1σϓϩΠ @echo of f set GOOS=linu x set GOARCH=amd6 4 go build -o handler handler.g o if %errorlevel% neq 0 exit / b sam deploy --stack-name go-training-<Ϣʔβʔ໊>-1 ^ --s3-bucket go-training-1 --capabilities CAPABILITY_IAM IBOEMFSHPͱಉ͡σΟϨΫτϦʹʮHJUJHOPSFʯΛ࡞੒͠ɺதʹ ʮIBOEMFSʯͱॻ͍ͯอଘ͠·͢ IBOEMFSHPͱಉ͡σΟϨΫΠτϦʹҎԼͷ಺༰ͰʮEFQMPZCBUʯΛ࡞ ੒͠·͢ Ϣʔβʔ໊ͷͱ͜Ζ͸ม͍͑ͯͩ͘͞ ౷߹λʔϛφϧͰʮ.\deploy.batʯʻ&OUFSʼΛ࣮ߦ͠·͢

Slide 24

Slide 24 text

45&1֬ೝ "84ϚωδϝϯτίϯιʔϧͰ-BNCEBΛ։͖ɺࣗ෼ͷؔ਺ 
 HPUSBJOJOHϢʔβʔ໊ Λ୳͠·͢ w ؔ਺ҰཡΛҰ൪ӈͷ<࠷ऴߋ৽>Ͱฒͼସ͑Δͱݟ͚ͭ΍͍͢Ͱ͢ <ςετ>λϒΛ։͖ɺ<ςετ>ϘλϯΛԡͯ݁͠ՌΛ֬ೝ͠·͢ ಺༰͸ద౰ <ϞχλϦϯά>λϒΛ։͖ɺ<$MPVE8BUDIͷϩάΛදࣔ>Ϙλϯ͔ΒϩάΛ֬ೝ ͠·͢

Slide 25

Slide 25 text

"NB[PO"1*(BUFXBZ

Slide 26

Slide 26 text

"1*(BUFXBZͱ͸ IUUQTBXTBNB[PODPNBQJHBUFXBZΑΓ 3&45΍8FC4PDLFUͷ"1*ϦΫΤετΛड͚෇͚ɺ-BNCEB౳ ͱܨ͙͜ͱͰϨεϙϯεΛฦ͢͜ͱ͕Ͱ͖ΔαʔϏε

Slide 27

Slide 27 text

-BNCEBͱͷ౷߹

Slide 28

Slide 28 text

-BNCEBͱͷ౷߹ ϦιʔεҰཡ ΫϥΠΞϯτ -BNCEB ϦΫΤετͷߏ੒ Ϩεϙϯεͷߏ੒

Slide 29

Slide 29 text

ϋϯζΦϯ1"35

Slide 30

Slide 30 text

ϋϯζΦϯ1"35ͷྲྀΕ 74$PEFͰίʔυ ؔ਺ Λ࣮૷͢Δ 4".ςϯϓϨʔτΛ࡞੒͢Δ σϓϩΠ͢Δ ಈ࡞Λ֬ೝ͢Δ

Slide 31

Slide 31 text

45&1ؔ਺ͷ࣮૷ Ϣʔβʔ໊ϑΥϧμҎԼʹʮEBZMBNCEBʯϑΥϧμΛ࡞ ੒͠ɺͦͷதʹҎԼͷ಺༰ͰʮIBOEMFSHPʯΛ࡞੒͠·͢ package mai n // import ͸লུ func handler(r events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { return events.APIGatewayProxyResponse { StatusCode: http.StatusOK , Body: "͜Μʹͪ͸ʂ\nϦΫΤετͨ͠Ϧιʔε: " + r.Resource , }, ni l } func main() { lambda.Start(handler ) }

Slide 32

Slide 32 text

45&14".ςϯϓϨʔτ IBOEMFSHPͱಉ͡σΟϨΫΠτϦʹҎԼͷ಺༰ͰʮUFNQMBUFZNMʯ Λ࡞੒͠·͢ Ϣʔβʔ໊ͷͱ͜Ζ͸ม͍͑ͯͩ͘͞ AWSTemplateFormatVersion: '2010-09-09 ' Transform: AWS::Serverless-2016-10-3 1 Resources : GoTraining<Ϣʔβʔ໊>2 : Type: AWS::Serverless::Functio n Properties : FunctionName: go-training-<Ϣʔβʔ໊>- 2 CodeUri: . Handler: handle r Runtime: go1. x MemorySize: 12 8 Timeout: 5 Events : Root : Type: Ap i Properties : Path: / Method: GET 1 が2 に な って いる 点 に 注意 1 が2 に な って いる 点 に 注意

Slide 33

Slide 33 text

45&1σϓϩΠ @echo of f set GOOS=linu x set GOARCH=amd6 4 go build -o handler handler.g o if %errorlevel% neq 0 exit / b sam deploy --stack-name go-training-<Ϣʔβʔ໊>-2 ^ --s3-bucket go-training-1 --capabilities CAPABILITY_IAM IBOEMFSHPͱಉ͡σΟϨΫτϦʹʮHJUJHOPSFʯΛ࡞੒͠ɺதʹ ʮIBOEMFSʯͱॻ͍ͯอଘ͠·͢ IBOEMFSHPͱಉ͡σΟϨΫΠτϦʹҎԼͷ಺༰ͰʮEFQMPZCBUʯΛ࡞ ੒͠·͢ Ϣʔβʔ໊ͷͱ͜Ζ͸ม͍͑ͯͩ͘͞ EBZMBNCEBͷσΟϨΫτϦͷ౷߹λʔϛφϧΛ։͖ ʮ.\deploy.batʯʻ&OUFSʼΛ࣮ߦ͠·͢ 1 が2 に な って いる 点 に 注意

Slide 34

Slide 34 text

45&1֬ೝ "84ϚωδϝϯτίϯιʔϧͰ"1*(BUFXBZΛ։͖ɺࣗ෼ͷ"1* 
 HPUSBJOJOHϢʔβʔ໊ Λ୳͠·͢ w ؔ਺ҰཡΛҰ൪ӈͷ<࡞੒ͨ͠>Ͱฒͼସ͑Δͱݟ͚ͭ΍͍͢Ͱ͢ ༁͕ม <μογϡϘʔυ>ϝχϡʔΛ։͖ɺը໘্෦ͷ੨͍ཝͷϦϯΫΛΫϦοΫ ͢Δͱ"1*͕ݺͼग़͞Ε·͢

Slide 35

Slide 35 text

5*14

Slide 36

Slide 36 text

4".XJUI%PDLFS w %PDLFSΛೖΕ͓ͯ͘ͱɺ࣍ͷͭͷ͜ͱ͕Ͱ͖ΔΑ͏ʹͳΔ • sam local invok e w ϩʔΧϧͰ-BNCEB؀ڥΛ࠶ݱ࣮ͨ͠ߦ͕Մೳʹ w ֤छτϦΨʔͷΠϕϯτΛ+40/Ͱڙڅ͠ςετ΋Մೳ • sam build --use-container w -JOVYωΠςΟϒͳґଘؔ܎͕͋Δ৔߹΍ɺϏϧυ؀ڥ Λ%PDLFSʹִ཭͍ͨ͠৔߹ʹศར

Slide 37

Slide 37 text

֎෦͔Βͷ؀ڥม਺ͷ஫ೖ w 1BSBNFUFS0WFSSJEFT w ςϯϓϨʔτͷ1BSBNFUFSTϒϩοΫͰఆٛ͠ʮ&/7@7"33FG 1BSBNʯͷΑ͏ʹࢀর͢Δͱɺlocal invoke΍deploy࣌ʹ ʮ--parameter-overrides ‘Param=foo'ʯͰ஋ΛڙڅͰ͖Δ w +40/ϑΝΠϧ w local invoke࣌ʹ؀ڥม਺Λྻڍͨ͠+40/ϑΝΠϧ ྫ {“GoTrainingMikan1":{"ENV_VAR":"foo"}} Λʮ--env- varsʯͰ౉͢͜ͱͰఆٛࡁͷ؀ڥม਺Λ্ॻ͖Ͱ͖Δ

Slide 38

Slide 38 text

$MFBOVQ w ຊݚमͰ࡞੒ͨ͠"84Ϧιʔε͸$MPVE'PSNBUJPOελοΫʹͳ͍ͬͯΔͷͰɺ"84Ϛ ωδϝϯτίϯιʔϧͰ$MPVE'PSNBUJPOΛ։͖ελοΫΛ࡟আ͢Ε͹-BNCEB΍"1* (BUFXBZͳͲ͸ҰׅͰ࡟আՄೳ w "84$-* 
 aws cloudformation delete-stack --stack-nameɹgo-training-Ϣʔβʔ ໊-਺ࣈ w ͨͩ͠-BNCEBͷ࣮ߦϩά͸$MPVE8BUDI-PHT্ʹ࢒ΔͷͰɺ͜Ε΋ফ͍ͨ͠৔߹͸ಉ ͘͡खಈͰ࡟আ͕ඞཁ w "84$-* 
 aws logs delete-log-group --log-group-name /aws/lambda/go- training-Ϣʔβʔ໊-਺ࣈ

Slide 39

Slide 39 text

࿅श

Slide 40

Slide 40 text

࿅श՝୊ w ࿅श՝୊<ϑΥϧμ໊EBZMBNCEB> w ৽͍͠"1*ϦιʔεΛ௥Ճ͍ͯͩ͘͠͞ ໊લɾ಺༰͸ࣗ༝ w ࿅श՝୊<ϑΥϧμ໊EBZMBNCEB> w ԼਤΛࢀߟʹ"1*ʹ"1*ΩʔೝূΛ௥Ճɾςετ͍ͯͩ͘͠͞ > curl https://...
 {"message":"Forbidden"}
 > curl -H “x-api-key: ...” https://.. . ͜Μʹͪ͸ʂ ϦΫΤετͨ͠Ϧιʔε: / .. . Method: GE T RestApiId : Ref: GoTrainingMikanAp i GoTraining<Ϣʔβʔ໊>Api : Type: AWS::Serverless::Ap i Properties : StageName: Pro d Auth : ApiKeyRequired: tru e UsagePlan : CreateUsagePlan: PER_API

Slide 41

Slide 41 text

ίʔυΛॻ͖ऴ͑ͨΒ w ʮϢʔβʔ໊QSBDUJDFʯϒϥϯνͰ࡞ۀ͍ͯ͠Δ͜ͱΛ֬ೝ͍ͯͩ͘͠͞ w 74$PEFͷҰ൪ࠨԼʹදࣔ͞Ε͍ͯ·͢ w มߋΛεςʔδ͠ɺίϛοτ͍ͯͩ͘͠͞ w 74$PEFͷࠨϝχϡʔͷʮιʔε؅ཧʯ͔Βૢ࡞ w ίʔυΛ(JU)VCʹϓογϡ͍ͯͩ͘͠͞ w 74$PEFͷҰ൪ࠨԼͷϒϥϯν໊ͷ͙͢ӈʹ͋ΔΞΠίϯ͔Βૢ࡞ ্ਤ w ϓϧϦΫΤετΛ࡞੒͍ͯͩ͘͠͞ w ʮιʔε؅ཧʯͷ্෦ʹΞΠίϯ͕͋Γ·͢

Slide 42

Slide 42 text

࣍ճ༧ࠂ w ࣍ճ͸ʮฒߦॲཧϓϩάϥϛϯάʯͰ͢ w ෼͔Βͳ͔ͬͨͱ͜Ζ΍࣭໰ͳͲ͸ɺࣾ಺ 4MBDLHPQIFSTνϟϯωϧʹ౤ߘ͍ͩ͘͞ w ຊ೔ͷ಺༰ΛΑΓਂ͘ཧղ͍ͨ͠ํ͸ɺ4".ͷ ։ൃऀΨΠυͳͲΛಡΜͰΈ͍ͯͩ͘͞ 
 IUUQTEPDTBXTBNB[PODPNTFSWFSMFTTBQQMJDBUJPONPEFM