Slide 1

Slide 1 text

%PDLFSΛ࢖ͬͯ 4ϩʔΧϧ։ൃ؀ڥΛߏஙͨ͠ גࣜձࣾϞϦαϫ খࣨو࢙

Slide 2

Slide 2 text

໊લɿখࣨو࢙ ࣗݾ঺հ ࢓ࣄɿςοΫϦʔυ ɹɹɹ"84ΠϯϑϥΤϯδχΞ ޷͖ͳαʔϏεɿ$MPVE'PSNBUJPO ॴଐɿגࣜձࣾϞϦαϫ ɹɹɹγεςϜ։ൃ෦ ɹɹɹΠϊϕʔγϣϯ։ൃ՝ɹ

Slide 3

Slide 3 text

w -PDBM4UBDLͱ͸ w %PDLFSͰࢼ͢ w 4΁ΞΫηε w ·ͱΊ ΞδΣϯμ

Slide 4

Slide 4 text

"84ͷϩʔΧϧ։ൃ͍ͨ͠

Slide 5

Slide 5 text

-PDBM4UBDLͱ͍͏ͷ͕ ͋ΔΒ͍͠

Slide 6

Slide 6 text

-PDBM4UBDLͱ͸ "84ϞοΫϑϨʔϜϫʔΫ w ϩʔΧϧʹ"84ͷϞοΫ؀ڥΛ࡞Δ͜ͱ͕Ͱ͖Δ w "84αʔϏεͷΤϛϡϨʔλʔ w QJQͱ%PDLFSΠϝʔδͰఏڙ͞Ε͍ͯΔ w QZUIPO 1ZUIPOVQUPTVQQPSUFE w QJQ 1ZUIPOQBDLBHFNBOBHFS w %PDLFS w ެࣜαΠτɿIUUQTMPDBMTUBDLDMPVE w 044ɿIUUQTHJUIVCDPNMPDBMTUBDLMPDBMTUBDL

Slide 7

Slide 7 text

-PDBM4UBDLରԠαʔϏε $PNNVOJUZ&EJUJPOʢແྉʣ w "$. w "1*(BUFXBZ w $MPVE'PSNBUJPO w $MPVE8BUDI w $MPVE8BUDI-PHT w %ZOBNP%# w %ZOBNP%#4USFBNT w &$ w &MBTUJDTFBSDI4FSWJDF w &WFOU#SJEHF $MPVE8BUDI&WFOUT w 'JSFIPTF w *". w ,JOFTJT w ,.4 w -BNCEB w 3FETIJGU w 3PVUF w 4 w 4FDSFUT.BOBHFS w 4&4 w 4/4 w 424 w 44. w 4UFQ'VODUJPOT w 454

Slide 8

Slide 8 text

-PDBM4UBDLରԠαʔϏε 1SP&EJUJPOʢ༗ྉʣ w "NQMJGZ w "1*(BUFXBZ7 8FC4PDLFUTTVQQPSU w "1*(BUFXBZ7 w "QQ$POpH w "QQMJDBUJPO"VUP4DBMJOH w "QQ4ZOD w "UIFOB w #BDLVQ w #BUDI w $MPVE'SPOU w $MPVE5SBJM w $PEF$PNNJU w $PHOJUP*EFOUJUZ w $PHOJUP*EFOUJUZ1SPWJEFS *E1 w %PDVNFOU%# w &$ BEWBODFEGFBUVSFT MBVODIJOH7.T w &$3 w &$4 w &,4 w &MBTUJ$BDIF w &.3 w (MBDJFS44FMFDU w (MVF w *". TFDVSJUZQPMJDZFOGPSDFNFOU w *P5 JODMVEJOH*P5"OBMZUJDT *P5%BUB w ,JOFTJT w ,JOFTJT%BUB"OBMZUJDT w -BNCEB JODMVEJOH-BNCEB-BZFST$POUBJOFS*NBHFT w .BOBHFE4USFBNJOHGPS,BGLB .4, w .FEJB4UPSF w /FQUVOF%# w 2-%# w 3%4"VSPSB4FSWFSMFTT w 3FETIJGU 1PTUHSFT%#TVQQPSU w 3PVUF %/4JOUFHSBUJPO w 4BHF.BLFS w 5JNFTUSFBN w 5SBOTGFS w 93BZ IUUQTMPDBMTUBDLDMPVEGFBUVSFTΑΓ

Slide 9

Slide 9 text

%PDLFSͰࢼͯ͠Έͨ

Slide 10

Slide 10 text

%PDLFSͰࢼ͢ %PDLFSͷ४උ w %PDLFS%FTLUPQͷ४උ w ݸਓར༻͸ແྉ w ۀ຿Ͱ࢖͏ͱ͖͸اۀن໛ʹΑΓ༗ྉͳͷͰ֬ೝ͕ඞཁ w %PDLFSpMFΛ࡞੒͢Δ͔%PDLFS)VCͷΠϝʔδΛ࢖͏ w %PDLFSpMF w IUUQTHJUIVCDPNMPDBMTUBDLMPDBMTUBDLCMPCNBTUFS%PDLFSpMF w %PDLFS)VC w MPDBMTUBDLMPDBMTUBDL w IUUQTIVCEPDLFSDPNSMPDBMTUBDLMPDBMTUBDL

Slide 11

Slide 11 text

%PDLFSͰࢼ͢ %PDLFSͷ४උ w %PDLFS%FTLUPQͷ४උ w ݸਓར༻͸ແྉ w ۀ຿Ͱ࢖͏ͱ͖͸اۀن໛ʹΑΓ༗ྉͳͷͰ֬ೝ͕ඞཁ w %PDLFSpMFΛ࡞੒͢Δ͔%PDLFS)VCͷΠϝʔδΛ࢖͏ w %PDLFSpMF w IUUQTHJUIVCDPNMPDBMTUBDLMPDBMTUBDLCMPCNBTUFS%PDLFSpMF w %PDLFS)VC w MPDBMTUBDLMPDBMTUBDL w IUUQTIVCEPDLFSDPNSMPDBMTUBDLMPDBMTUBDL

Slide 12

Slide 12 text

%PDLFSͰࢼ͢ %PDLFS$PNQPTFͷ४උ version: "3" services: localstack: image: localstack/localstack:0.13.3 container_name: localstack ports: - 4566:4566 environment: - DEFAULT_REGION=ap-northeast-1 - SERVICES=s3 - DATA_DIR=/tmp/localstack/data volumes: - localstack:/tmp/localstack/ volumes: localstack:

Slide 13

Slide 13 text

%PDLFSͰࢼ͢ %PDLFS$PNQPTFͷ४උ version: "3" services: localstack: image: localstack/localstack:0.13.3 container_name: localstack ports: - 4566:4566 environment: - DEFAULT_REGION=ap-northeast-1 - SERVICES=s3 - DATA_DIR=/tmp/localstack/data volumes: - localstack:/tmp/localstack/ volumes: localstack: λά৘ใΛ֬ೝͯ͠ ࠷৽Λࢦఆ

Slide 14

Slide 14 text

%PDLFSͰࢼ͢ %PDLFS$PNQPTFͷ४උ version: "3" services: localstack: image: localstack/localstack:0.13.3 container_name: localstack ports: - 4566:4566 environment: - DEFAULT_REGION=ap-northeast-1 - SERVICES=s3 - DATA_DIR=/tmp/localstack/data volumes: - localstack:/tmp/localstack/ volumes: localstack: -PDBM4UBDL͕αʔϏεͰ ར༻͢Δϙʔτ

Slide 15

Slide 15 text

%PDLFSͰࢼ͢ %PDLFS$PNQPTFͷ४උ version: "3" services: localstack: image: localstack/localstack:0.13.3 container_name: localstack ports: - 4566:4566 environment: - DEFAULT_REGION=ap-northeast-1 - SERVICES=s3 - DATA_DIR=/tmp/localstack/data volumes: - localstack:/tmp/localstack/ volumes: localstack: 4Λ౦ژϦʔδϣϯ ͱͯ͠ࢼ͢

Slide 16

Slide 16 text

%PDLFSͰࢼ͢ %PDLFS$PNQPTFͷ४උ version: "3" services: localstack: image: localstack/localstack:0.13.3 container_name: localstack ports: - 4566:4566 environment: - DEFAULT_REGION=ap-northeast-1 - SERVICES=s3 - DATA_DIR=/tmp/localstack/data volumes: - localstack:/tmp/localstack/ volumes: localstack: %PDLFS࠶ىಈ࣌ʹ 4ͷσʔλ͕ ফ͑ͳ͍Α͏ʹ ӬଓԽ͓ͯ͘͠

Slide 17

Slide 17 text

%PDLFSͰࢼ͢ %PDLFSΛىಈ $ docker-compose up -d Creating network "localstack_default" with the default driver Creating volume "localstack_localstack" with default driver Creating localstack ... done $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4c337f07f604 localstack/localstack:0.13.3 "docker- entrypoint.sh" About a minute ago Up About a minute 4571/tcp, 0.0.0.0:4566->4566/tcp, 5678/tcp localstack ϙʔτΛ ϗετଆʹެ։

Slide 18

Slide 18 text

4ʹΞΫηεͯ͠ΈΔ

Slide 19

Slide 19 text

4ʹΞΫηε "84μϛʔϓϩϑΝΠϧ࡞੒ $ cat >> ~/.aws/credentials << EOF [LocalStack] aws_access_key_id = dummy aws_secret_access_key = dummy EOF $ cat >> ~/.aws/config << EOF [profile LocalStack] region = ap-northeast-1 output = json EOF w "84$-*ͰΞΫηε͢ΔͨΊϓϩϑΝΠϧ͕ඞཁ w μϛʔͷϓϩϑΝΠϧΛ࡞੒͓ͯ͘͠

Slide 20

Slide 20 text

4ʹΞΫηε 4ίϚϯυΛࢼ͢ w BXTT΍BXTTBQJͷར༻͕ՄೳʹͳΔ w ΤϯυϙΠϯτΛΦϓγϣϯࢦఆ͢Δඞཁ͋Γ w ŠFOEQPJOUVSMIUUQMPDBMIPTU $ aws s3 mb s3://sample --endpoint-url=http://localhost:4566 --profile LocalStack make_bucket: sample $ aws s3 cp ./sample.txt s3://sample/ --endpoint-url=http:// localhost:4566 --profile LocalStack upload: ./sample.txt to s3://sample/sample.txt $ aws s3 ls s3://sample/ --endpoint-url=http://localhost:4566 --profile LocalStack 2022-02-02 20:35:45 7 sample.txt

Slide 21

Slide 21 text

%PDLFSޙย෇͚ %PDLFSΛఀࢭ $ docker-compose down Stopping localstack ... done Removing localstack ... done Removing network localstack_default $ docker volume ls DRIVER VOLUME NAME local localstack_localstack $ docker volume rm localstack_localstack DRIVER VOLUME NAME local localstack_localstack w σʔϞϯىಈ͍ͯ͠Δ%PDLFSΛࢭΊΔ w ӬଓԽ͍ͯ͠ΔϘϦϡʔϜ͕ෆཁʹͳΕ͹࡟আ w ϓϨϑΟοΫε͸؀ڥґଘʢσΟϨΫτϦ໊ʣ

Slide 22

Slide 22 text

·ͱΊ

Slide 23

Slide 23 text

ࢥͬͨΑΓ΋؆୯ʹͰ͖·ͨ͠ ·ͱΊ w -PDBM4UBDLΛ࢖͏ͱ4ͷϩʔΧϧ։ൃ؀ڥ͕؆୯ʹͰ͖Δ w %PDLFS%FTLUPQͷ४උ w -PDBM4UBDLͷ%PDLFSىಈ w ϙʔτΛϗετ΁ެ։ w σʔλͷӬଓԽ w "84༻μϛʔϓϩϑΝΠϧͷ४උ w %PDLFS$PNQPTFΛར༻͢Ε͹Ԡ༻͕ޮ͘ w -PDBM4UBDLҎ֎ͷίϯςφΛར༻ͨ͠αʔϏε΋ ಉ࣌ʹ্ཱͪ͛ͯ·ͱΊͯ։ൃ؀ڥ͕Ͱ͖Δ w (MVFษڧதͳͷͰ(MVF΋Ұॹʹىಈͯ͠ࢼ͍ͯ͠Δ w 4ޓ׵ͷπʔϧ͸NJOJPͳͲଞʹ΋͋Δ

Slide 24

Slide 24 text

0OFNPSFUIJOH

Slide 25

Slide 25 text

1ZUIPO൛ 1ZUIPO൛͸΋ͬͱָ $ pip install localstack $ lolcalstack start -d $ pip install awscli-local $ awslocal s3 mb s3://sample make_bucket: sample w QJQͰೖΕͯσʔϞϯΛىಈ͢Δ͚ͩ w ཪͰ%PDLFS্ཱ͕ͪΔ w BXTDMJMPDBMͰݺͼग़ͤΔ w ΤϯυϙΠϯτͷࢦఆ΍μϛʔϓϩϑΝΠϧͷ࡞੒ෆཁ w -PDBM4UBDLఀࢭͰ4ͷ৘ใ͸ফ͑Δ w *TTVFͷΛݟΔݶΓରԠ༧ఆͳͦ͞͏ʁ IUUQTHJUIVCDPNMPDBMTUBDLMPDBMTUBDLJTTVFT

Slide 26

Slide 26 text

஥ؒืूத ΧδϡΞϧ໘ஊ΋ͯ͠·͢ w ΠϯϑϥΤϯδχΞʢ"84 w όοΫΤϯυΤϯδχΞʢ(Pʣ w σʔλΤϯδχΞ 1IPUP1",65"40 'POU.PSJTBXB