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

開発で使える AWS の API 操作を模倣する (OSS) ツールを探してみた/JAWS-UG Kagoshima Vol.8

Yohei Kawahara
October 19, 2018
1k

開発で使える AWS の API 操作を模倣する (OSS) ツールを探してみた/JAWS-UG Kagoshima Vol.8

JAWS-UG鹿児島勉強会 Vol.8 (https://jawsug-kagoshima.doorkeeper.jp/events/79902) でトークさせて頂く死霊です.

Yohei Kawahara

October 19, 2018
Tweet

Transcript

  1. ։ൃͰ͔ͭΏͬ AWS ͷ
    API ૢ࡞Λ໛฿͢Δ
    πʔϧΛΈ͚ͯ͠Έͨ1
    JAWS-UG ࣛࣇౡษڧձ Vol.8
    @inokara
    1 ࣛࣇౡห༁: ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ (OSS) πʔϧΛ୳ͯ͠Έͨ
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 1

    View full-size slide

  2. ࢲ͸
    • ઒ݪ ༸ฏ (͔ͬͺ)
    • ΞΠϨοτגࣜձࣾ
    • ࣛࣇౡग़਎Ͱ͝Θ͢
    • Github: inokappa
    • twitter: @inokara
    • Facebook: inokappa
    ࣮Ո͸ਅ࠭ͳͷͰ, ࠙਌ձ͕ऴΘͬͨΒ
    ਅ࠭ʹؼΓ·͢.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 2

    View full-size slide

  3. એ఻
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 3

    View full-size slide

  4. JAWS-UG ෱Ԭۙล͔Β͖·ͨ͠ʂ
    ΄΅ຖि΋͘΋͘ձ΍ͬͯ·͢͹͍
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 4

    View full-size slide

  5. Զͷπʔϧζ
    oreno.tools
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 5

    View full-size slide

  6. એ఻
    ऴΘΓ
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 6

    View full-size slide

  7. AWS ͷ API ૢ࡞ͬͪ
    ͸͍Ί࣮ͬߦͬ࣌͢͸
    ۓுͬ͢Ͳͳʔ2
    2 ࣛࣇౡห༁: AWS ͷ API ૢ࡞ΛॳΊ࣮ͯߦ͢Δ࣌͸ۓு͠·͢ΑͶ.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 7

    View full-size slide

  8. γεςϜ։ൃͰ͸
    ίετ͸Ͱ͚ͬͩ͘
    ཈͔͑ͨʔ3
    3 ࣛࣇౡห༁: γεςϜ։ൃͰ͸ίετ͸ग़དྷΔ͚ͩ཈͍͑ͨͰ͢ΑͶ.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 8

    View full-size slide

  9. ςετͰ
    ࣮ϦιʔεΛ͔͔ͱ͸
    ͓͡Ͳͳ͋ʔ4
    4 ࣛࣇౡห༁: ςετͰ࣮ϦιʔεΛ৮Δͷͬͯා͍Ͱ͢ΑͶ.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 9

    View full-size slide

  10. ͦ͛ͳօ͞Μʹ
    Ͳͯ͠Μ࿕ใͰ͢5
    5 ࣛࣇౡห༁: ͦΜͳօ͞Μʹ͓ͦΒ͘࿕ใͰ͢.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 10

    View full-size slide

  11. AWS ͷ API ૢ࡞Λ໛฿,
    API ޓ׵ ͷ OSS ͕
    ৭ʑͱ͍͋΋͢6
    6 ࣛࣇౡห༁: AWS ͷ API ૢ࡞Λ໛฿, API ޓ׵ ͷ OSS ͕৭ʑͱଘࡏ͍ͯ͠·͢.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 11

    View full-size slide

  12. ͦ͛ͳ OSS Λ͍͔ͬ͘
    ݟસͬͯΈ΋ͨ͠7
    νΣετʔʂʂʂ
    7 ࣛࣇౡห༁: ͦΜͳ OSS Λز͔ͭݟસͬͯΈ·ͨ͠.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 12

    View full-size slide

  13. DynamoDB Local
    • https://docs.aws.amazon.com/ja_jp/amazondynamodb/
    latest/developerguide/DynamoDBLocal.html
    • DynamoDB ͷجຊతͳػೳΛϩʔΧϧ؀ڥͰఏڙ, AWS Φϑ
    Ογϟϧπʔϧʂ
    • σʔλͷ put ΋ग़དྷΔ͠, scan ΋ग़དྷΔʂ
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 13

    View full-size slide

  14. SAM Local
    • https://github.com/awslabs/aws-sam-cli
    • Lambda ؔ਺΍ API Gateway ΛϩʔΧϧ؀ڥͰ࣮ߦग़དྷΔʂ
    • S3 ΍ DynamoDB ౳ͷαʔϏεͷݺͼग़͠ΛΤϛϡϨʔτʂ
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 14

    View full-size slide

  15. localstack
    • https://github.com/localstack/localstack
    • Lambda ͱ͔ API Gateway ͱ͔ϝδϟʔͳαʔϏεͷ API Λ
    αϙʔτʂ
    • Web UI ͕༻ҙ͞Ε͍ͯΔʂ
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 15

    View full-size slide

  16. moto (moto_server)
    • https://github.com/spulec/moto
    • Python ੡ͷ mock ϥΠϒϥϦ
    • αϙʔτ͢ΔαʔϏε͕ localstack ΑΓ΋޿͍͔΋
    • ϥΠϒϥϦ൛ͷ moto ͱαʔόʔ൛ͷ moto_server ͕༻ҙ͞
    Ε͍ͯΔ
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 16

    View full-size slide

  17. elasticmq
    • https://github.com/adamw/elasticmq
    • SQS ޓ׵ͷΠϯλϑΣʔεΛఏڙʂ
    • Scala Ͱ࣮૷
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 17

    View full-size slide

  18. minio
    • https://github.com/minio/minio
    • S3 API ޓ׵ͷΦϒδΣΫτετϨʔδ
    • S3 ͷΑ͏ͳ Web UI ΋උ͍͑ͯΔ
    ͔ͳΓͷߴػೳͰ SDK ౳΋༻ҙ͞Ε͓ͯΓ, ଞͷΫϥ΢υαʔ
    Ϗε΍ΦϯϓϨ্ʹల։࣮ͯ͠ࡍʹӡ༻͢Δ͜ͱ΋૝ఆ͞Εͯ
    ͍Δײ͡Ͱ͢.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 18

    View full-size slide

  19. dynalite
    • https://github.com/mhart/dynalite
    • DynamoDB ͷػೳΛఏڙ͢Δ࣮૷
    kinesalite
    • https://github.com/mhart/kinesalite
    • Kinesis Stream ͷػೳΛఏڙ͢Δ࣮૷
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 19

    View full-size slide

  20. Ұཡ (1)
    ໊લ ର৅αʔϏε ϥΠηϯε
    DynamoDB Local DynamoDB Amazon ϥΠηϯε
    SAM Local Lambda ଞ Apache License 2.0
    localstack Lambda ଞ Apache License 2.0
    moto EC2 ଞ Apache License 2.0
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 20

    View full-size slide

  21. Ұཡ (2)
    ໊લ ର৅αʔϏε ϥΠηϯε
    elasticmq SQS Apache License 2.0
    minio S3 Apache License 2.0
    dynalite DynamoDB MIT License
    kinesalite Kinesis MIT License
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 21

    View full-size slide

  22. ୳ͤ͹΋ͬͱ͋Δ͸ͣ...
    ͡ΌͬͲΜ...
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 22

    View full-size slide

  23. ग़དྷΕ͹...σϞ
    ͜ΕΒͷπʔϧ͸ HTTP ͷΤϯυϙΠϯτΛఏڙ͍ͯ͠ΔͷͰ,
    ҎԼͷΑ͏ʹ, Φϓγϣϯ౳ͰΤϯυϙΠϯτΛࢦఆͯ͠ར༻͠
    ·͢.8
    aws --profile=dummy \
    --endpoint=http://xxx.xxx.xxx.xxx:1234 \
    s3 ...
    8 AWS CLI Ͱͷར༻ྫͰ͢.
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 23

    View full-size slide

  24. ࠷ޙʹ
    • ࣮ϦιʔεΛ࿔ΔલͷૉৼΓʹΦεεϝ͡ΌͬͲʂ
    • ͋͘·Ͱ΋։ൃ༻్΍͓ࢼ͠༻్Ͱ࢖͍ͬͯ͘΍Μͤʂ
    • ୳ͤ͹΋ͬͱ৭ʑͱग़ͯ͘Δ͸ͣ͡ΌͬͲͳ͋ʂ
    • Let's ΤϯδϣΠ AWS !!
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 24

    View full-size slide

  25. ᄠ͔͍͜
    ௓΅͔͍
    ᄠ͜Α͔ͬ
    ͻͬ௓ !!
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 25

    View full-size slide

  26. ׬
    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 26

    View full-size slide