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

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

Yohei Kawahara
October 19, 2018
1.2k

開発で使える 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
  2. ࢲ͸ • ઒ݪ ༸ฏ (͔ͬͺ) • ΞΠϨοτגࣜձࣾ • ࣛࣇౡग़਎Ͱ͝Θ͢ •

    Github: inokappa • twitter: @inokara • Facebook: inokappa ࣮Ո͸ਅ࠭ͳͷͰ, ࠙਌ձ͕ऴΘͬͨΒ ਅ࠭ʹؼΓ·͢. ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 2
  3. AWS ͷ API ૢ࡞ͬͪ ͸͍Ί࣮ͬߦͬ࣌͢͸ ۓுͬ͢Ͳͳʔ2 2 ࣛࣇౡห༁: AWS ͷ

    API ૢ࡞ΛॳΊ࣮ͯߦ͢Δ࣌͸ۓு͠·͢ΑͶ. ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 7
  4. AWS ͷ API ૢ࡞Λ໛฿, API ޓ׵ ͷ OSS ͕ ৭ʑͱ͍͋΋͢6

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

    ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 12
  6. 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
  7. SAM Local • https://github.com/awslabs/aws-sam-cli • Lambda ؔ਺΍ API Gateway ΛϩʔΧϧ؀ڥͰ࣮ߦग़དྷΔʂ

    • S3 ΍ DynamoDB ౳ͷαʔϏεͷݺͼग़͠ΛΤϛϡϨʔτʂ ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 14
  8. localstack • https://github.com/localstack/localstack • Lambda ͱ͔ API Gateway ͱ͔ϝδϟʔͳαʔϏεͷ API

    Λ αϙʔτʂ • Web UI ͕༻ҙ͞Ε͍ͯΔʂ ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 15
  9. moto (moto_server) • https://github.com/spulec/moto • Python ੡ͷ mock ϥΠϒϥϦ •

    αϙʔτ͢ΔαʔϏε͕ localstack ΑΓ΋޿͍͔΋ • ϥΠϒϥϦ൛ͷ moto ͱαʔόʔ൛ͷ moto_server ͕༻ҙ͞ Ε͍ͯΔ ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 16
  10. elasticmq • https://github.com/adamw/elasticmq • SQS ޓ׵ͷΠϯλϑΣʔεΛఏڙʂ • Scala Ͱ࣮૷ ։ൃͰ࢖͑Δ

    AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 17
  11. minio • https://github.com/minio/minio • S3 API ޓ׵ͷΦϒδΣΫτετϨʔδ • S3 ͷΑ͏ͳ

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

    Kinesis Stream ͷػೳΛఏڙ͢Δ࣮૷ ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 19
  13. Ұཡ (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
  14. Ұཡ (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
  15. ग़དྷΕ͹...σϞ ͜ΕΒͷπʔϧ͸ HTTP ͷΤϯυϙΠϯτΛఏڙ͍ͯ͠ΔͷͰ, ҎԼͷΑ͏ʹ, Φϓγϣϯ౳ͰΤϯυϙΠϯτΛࢦఆͯ͠ར༻͠ ·͢.8 aws --profile=dummy \

    --endpoint=http://xxx.xxx.xxx.xxx:1234 \ s3 ... 8 AWS CLI Ͱͷར༻ྫͰ͢. ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 23
  16. ᄠ͔͍͜ ௓΅͔͍ ᄠ͜Α͔ͬ ͻͬ௓ !! ։ൃͰ࢖͑Δ AWS ͷ API ૢ࡞Λ໛฿͢Δ

    OSS πʔϧΛ୳ͯ͠Έͨ | JAWS-UG ࣛࣇౡษڧձ Vol.8 25