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

俺とActive Storage + Cloud Front

俺とActive Storage + Cloud Front

Active Storage + S3 をCloudFront で配信する。認証付きURL生成で直接アクセスすることも防げる。

ふぁらお加藤

August 15, 2020
Tweet

More Decks by ふぁらお加藤

Other Decks in Technology

Transcript

  1. 1IBMBO9XBSF;͊Β͓Ճ౻
    Զͱ
    "DUJWF4UPSBHF$MPVE'SPOU
    ΍ͬͺΓઐ༻ͷαʔϏε࢖͍͍ͨΑͶ

    View full-size slide

  2. ໊લ
    ;͊Β͓Ճ౻
    !1IBSBPI,+
    झຯ
    αϒΧϧɾ໺॓ɾ##2ɾΊΊΊ
    ࢓ࣄ
    *$5ϑϦʔϥϯε
    5TVOEPLBOBJ3BEJP
    ࢀՃίϛϡχςΟ
    ,BOB[BXBSC
    +"846(ۚ୔
    "844BNVSBJ
    ࣗݾ঺հ

    View full-size slide

  3. 8IBUJT"DUJWF4UPSBHF

    View full-size slide

  4. w 3VCZPO3BJMTͷʮϑΝΠϧʯΛऔΓѻ
    ͏ػೳ
    w σʔλϕʔεͷϨίʔυʹؔ࿈͢ΔϑΝ
    ΠϧΛอଘͰ͖Δ
    w ϑΝΠϧ͸௨ৗͷσΟεΫ͔Β͍ΘΏΔ
    Ϋϥ΢υετϨʔδ·ͰରԠ͍ͯ͠Δ
    w "DUJWF4UPSBHFͷઃఆ͑ͯ͞͠͠·͑͹
    ͏·͘ந৅Խ͞Εɺ֤छϑΝΠϧΛऔΓ
    ѻ͏"1*Λ௨ͤ͹͏·͍͜ͱอଘͯ͘͠Ε
    Δ
    8IBUJT"DUJWF4UPSBHF
    "DUJWF.PEFM
    "[VSF4UPSBHF
    "DUJWF4UPSBHF

    View full-size slide

  5. ࠓճ͸4ͷ࿩

    View full-size slide


  6. w ΞϓϦέʔγϣϯΛհͯ͠ͷΞΫ
    ηε͸ڐ͕͢௚઀͸ΞΫηε͸
    ͤ͞ͳ͍ɻ
    w ͱ͍͏͔ͦ΋ͦ΋4ʹஔ͍ͯ͋
    Δ௚઀೷͚ΔՄೳੑ͢Β༩͑ͨ
    ͘ͳ͍
    ΞΫηε੍ޚ΄͍͠
    "DUJWF.PEFM
    "DUJWF4UPSBHF
    Ϣʔβʔ
    3VCZPO3BJMT

    Πϯλʔωοτ

    View full-size slide

  7. ΞϓϦ͕ετϦʔϜΛฦͤ͹ʁ

    w Θ͔ΔɺͰ΋͓ͬͦ
    w ΞϓϦ͕͜ͷϢʔβʔʹηογ
    ϣϯͱΒΕΔ࣌ؒͭΒ͘Ͷʁ
    w ·͊࠷ऴखஈతͳͱ͜Ζ͸͋Δ
    Ҋ
    "DUJWF.PEFM
    "DUJWF4UPSBHF
    Ϣʔβʔ
    3VCZPO3BJMT

    Πϯλʔωοτ
    ετϦʔϜ

    View full-size slide

  8. Ұॠ͚ͩΞΫηεͰ͖Δ63-

    w ͜Ε͕࠾༻͞Ε͍ͯΔ
    w "DUJWF4UPSBHF͕4ʹอଘͯ͠
    ͦͷ৘ใΛ.PEFMʹ࣋ͭ
    w ΞϓϦ͸ϢʔβʔʹΞΫηε͞
    ͍ͤͨͱ͖ɺ)."$4)"Ͱॺ໊
    ͨ͠ظݶ෇͖63-Λੜ੒͢Δ
    w Ϣʔβʔ͸ͦΕΛܦ༝ͯ͠ΈΔ
    Ҋ
    "DUJWF.PEFM
    "DUJWF4UPSBHF
    Ϣʔβʔ
    3VCZPO3BJMT

    Πϯλʔωοτ
    ॺ໊෇͖63-
    ෼͚ͩΞΫηεՄ

    View full-size slide

  9. ௚઀1045Ͱ͖Δ63-

    w ΞϓϦ͸)."$4)"Ͱॺ໊ͨ͠
    ظݶ෇͖63-Λੜ੒͠ɺ͞Βʹ
    .PEFMʹͦͷࢫΛه࿥͢Δ
    w Ϣʔβʔ͸ͦͷ63-Λ࢖ͬͯ
    3P3Λհͣ͞ɺ௚઀4ʹϒϥ΢
    β͔ΒϑΝΠϧΛ1045165Ͱ
    ͖Δ μΠϨΫτΞοϓϩʔυ

    w 4ͷ$034ͷઃఆ๨Εͣʹ
    Ҋ9
    "DUJWF.PEFM
    "DUJWF4UPSBHF
    Ϣʔβʔ
    3VCZPO3BJMT

    Πϯλʔωοτ
    ॺ໊෇͖63-
    ෼͚ͩΞΫηεՄ

    View full-size slide

  10. ৽ͨͳΔ՝୊

    View full-size slide

  11. ͦ΋ͦ΋4ͬͯ
    ίϯςϯπσϦόϦʔʹ޲͍ͯΔͷʁ

    View full-size slide

  12. "84$MPVE'SPOU
    WT"NB[PO4

    View full-size slide

  13. ഑৴ʹ͓͚Δ$MPVE'SPOUWT4
    w 4͸΍ͬͺΓϑΝΠϧετϨʔδͱ͍͏ଆ໘͕ߴ͍
    w ͕͢͞ʹ$MPVE'SPOUʹൺ΂ͨΒɺ଎౓͕҆ఆ͠ͳ͍ɺྉ͕ۚߴ͍৔߹΋͋Δ
    ͳͲͳͲ
    w 3P3ͷΞηοτΛ͜͜ʹஔ͘ͷ΋మ൘ͱͳ͍ͬͯΔ 3BJMTΨΠυʹ΋આ໌͕
    ৐͍ͬͯΔ

    w ࠓճٞ࿦͍ͨ͠ͷ͸Ξηοτ͡Όͳͯ͘ʮಈతͳίϯςϯπʯ
    w ಈతͳίϯςϯπ͸࠶ΩϟογϡࢦࣔͷλΠϛϯάͱ͔ํ๏΋ٞ࿦͕͍Δ

    View full-size slide

  14. ΋͏͍·͡Όೝূ෇͖$%/΋Ͱ͖Δ

    View full-size slide

  15. 3P3"84ͷઃఆ

    w $MPVE'SPOUͷઃఆͰʮ4ʯΛΩ
    ϟογϡʮͦΕΒ΁ͷ௚઀ͷΞΫ
    ηεېࢭʯΛઃఆ͓ͯ͘͠ɺ$%/
    ͷϗετ໊Λήοτ͓ͯ͘͠
    w $%/༻*%ͱൿີ伴Λੜ੒ͯ͠μ΢
    ϯϩʔυ͓ͯ͘͠
    w HFNBXTTELDMPVEGSPOUΛ࢖͏
    $MPVE'SPOU΋΍Δ
    "DUJWF.PEFM
    "DUJWF4UPSBHF
    Ϣʔβʔ
    3VCZPO3BJMT

    Πϯλʔωοτ
    ॺ໊෇͖63-
    ෼͚ͩΞΫηεՄ

    ௚઀͸ېࢭ

    View full-size slide