Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CloudFront use cases - noteの事例 -
Search
Retu Fukui
June 12, 2019
Technology
0
8.6k
CloudFront use cases - noteの事例 -
2019/06/12 note engineer meetup #3 (
https://pieceofcake.connpass.com/event/128607/
) でお話しました
Retu Fukui
June 12, 2019
Tweet
Share
More Decks by Retu Fukui
See All by Retu Fukui
開発生産性と品質の横断的な課題を解決する!エンジニアリング支援室の挑戦 -1Qで取り組んだことを添えて-
fukuiretu
2
6.2k
EMになって最初の失敗談 - コミュニケーション編 -
fukuiretu
2
6.1k
問い合わせ対応当番を自動化で業務効率化している話
fukuiretu
0
690
サーバーレスで始める ゆるふわデータ基盤 - noteの事例 -
fukuiretu
2
7.4k
191109_sacss.pdf
fukuiretu
1
2.3k
noteをNuxt.jsで再構築した話 -2nd-
fukuiretu
6
12k
181117_wannatech.pdf
fukuiretu
1
490
noteをNuxt.jsで再構築した話
fukuiretu
22
56k
フロントエンド刷新中のnoteの開発環境について
fukuiretu
6
7.6k
Other Decks in Technology
See All in Technology
オーティファイ会社紹介資料 / Autify Company Deck
autifyhq
9
120k
Amazon_CloudWatch_ログ異常検出_導入ガイド
tsujiba
4
1.6k
Aurora_BlueGreenDeploymentsやってみた
tsukasa_ishimaru
1
130
AWS re:Inventを徹底的に楽しむためのTips / Tips for thoroughly enjoying AWS re:Invent
yuj1osm
1
570
チームを主語にしてみる / Making "Team" the Subject
ar_tama
4
310
Autify Company Deck
autifyhq
1
39k
新卒1年目が挑む!生成AI × マルチエージェントで実現する次世代オンボーディング / operation-ai-onboarding
cyberagentdevelopers
PRO
1
170
国土交通省 データコンペ参加者向け勉強会
takehikohashimoto
0
120
Apple/Google/Amazonの決済システムの違いを踏まえた定期購読課金システムの構築 / abema-billing-system
cyberagentdevelopers
PRO
1
220
カメラを用いた店内計測におけるオプトインの仕組みの実現 / ai-optin-camera
cyberagentdevelopers
PRO
1
120
ユーザーの購買行動モデリングとその分析 / dsc-purchase-analysis
cyberagentdevelopers
PRO
2
100
10分でわかるfreeeのQA
freee
1
3.4k
Featured
See All Featured
What's new in Ruby 2.0
geeforr
342
31k
What's in a price? How to price your products and services
michaelherold
243
12k
How to Ace a Technical Interview
jacobian
275
23k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Side Projects
sachag
452
42k
Done Done
chrislema
181
16k
Six Lessons from altMBA
skipperchong
26
3.5k
4 Signs Your Business is Dying
shpigford
180
21k
A Tale of Four Properties
chriscoyier
156
23k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
290
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Transcript
Ҫ @fukuiretu 2019.06.12 OPUFFOHJOFFSNFFUVQ $MPVE'SPOU VTFDBTFT OPUFͷࣄྫ
ࣗݾհ Engineer Full Remote Worker piece of cake, inc. ೖࣾ
੨ݝ߂લࢢࡏॅ 3VCZPO3BJMT /VYUKT "84 @r82 @fukuiretu @fukuiretu Ҫ
ΞδΣϯμ OPUFͷΠϯϑϥߏ $'Λར༻͢ΔϝϦοτʗσϝϦοτ 5JQT ·ͱΊ
ΞδΣϯμ OPUFͷΠϯϑϥߏ $'Λར༻͢ΔϝϦοτʗσϝϦοτ 5JQT ·ͱΊ
OPUFͷΠϯϑϥߏ $MPVE'SPOUͰ"OHVMBS /VYUΛΓସ͑
ΞδΣϯμ OPUFͷΠϯϑϥߏ $'Λར༻͢ΔϝϦοτʗσϝϦοτ 5JQT ·ͱΊ
$MPVE'SPOU $' ͱ "84͕ఏڙ͢ΔߴɾߴύϑΥʔϚϯεͳ ίϯςϯπ৴αʔϏε $%/ ΞηοτͷΩϟογϡ༻్Ҏ֎ʹ͑Δʂ
ύεϕʔεͷϦόʔεϓϩΩγ ! $'Λར༻͢ΔϝϦοτ
Multi Origin &MBTUJD#FBOTUBML "1*(BUFXBZ "-# 4 etc… $'Λར༻͢ΔϝϦοτ
ύεຖʹΩϟογϡઃఆ͕Մೳ ElasticBeanstalk path /login /recommend ALB ͳ͠ ͳ͠ /aseets/images/* ࣌ؒ
S3 origin cache $'Λར༻͢ΔϝϦοτ Cache Behavior
ҎԼͷϫΠϧυΧʔυͷΈར༻Մೳ ͦ͘͠ΕҎ্ͷจࣈྻ จࣈ ॊೈͳਖ਼نදݱ͑ͳ͍ͷͰ63-ઃܭ৻ॏʹʂ ύεύλʔϯͷҙ ! $'Λར༻͢ΔϝϦοτ
$'Λར༻͢ΔϝϦοτ ηΩϡϦςΟରࡦ !
1$*%44ରԠ #05ରࡦ %%P4؇ 944ରࡦ 42-Jରࡦ https://aws.amazon.com/jp/waf/ $'Λར༻͢ΔϝϦοτ "848"'ʢΣϒΞϓϦέʔγϣϯϑΝΠΞΥʔϧʣ AWS WAF
ແྉͰ͑ΔʢΕͳ͍ͯ͘͘Δʣ %%P4؇ https://aws.amazon.com/jp/shield/ $'Λར༻͢ΔϝϦοτ "844IJFMEʢϚωʔδυܕͷ%%P4อޢʣ AWS Shield Standard
$'Λར༻͢ΔϝϦοτ "-#ͷલஈʹஔ͘͜ͱͰϨεϙϯε্ !
$'Λར༻͢ΔϝϦοτ Secured API Acceleration with Engineers from Amazon CloudFront and
Slack https://www.slideshare.net/AmazonWebServices/secured-api-acceleration-with-engineers-from-amazon-cloudfront-and-slack 4MBDLࣾͷࣄྫ
$'Λར༻͢ΔϝϦοτ DSA %ZOBNJD4JUF"DDFMFSBUJPO Τοδϩέʔγϣϯ ΦϦδϯ ωοτϫʔΫ࠷దԽ ϨΠςϯγ͕͘ͳΔϨεϙϯε͕͘ͳΔ ˞ΤοδϩέʔγϣϯΦϦδϯؒͷڑ͕͍ۙ߹ޮՌ͕ബ͍
$'Λར༻͢ΔϝϦοτ ৄͦ͘͠ͷͬͭ͞Μͷϒϩάʹͯ $MPVE'SPOUΛ͔·͢ͱΩϟογϡͳ͠ͷ"1*ίʔϧͰ͘ͳΔΑ͏ͩ http://blog.livedoor.jp/sonots/archives/48002650.html
ίετ ·ͣ؆қݟੵπʔϧͰ͓ݟੵΓΛʂ Πϯλʔωοτͷσʔλసૹྔ )551ϝιουͷϦΫΤετ ΦϦδϯͷσʔλసૹྔ https://calculator.s3.amazonaws.com/index.html?lng=ja_JP FUDʜ $'Λར༻͢ΔσϝϦοτ
$MPVE'SPOU #FIBWJPS ϧʔςΟϯάͷࢄࡏԽ /VYUKT WVFSPVUFS "OHVMBS+4 VJSPVUFS 3VCZPO3BJMT SPVUFSSC New
$'Λར༻͢ΔσϝϦοτ
ΞδΣϯμ OPUFͷΠϯϑϥߏ $'Λར༻͢ΔϝϦοτʗσϝϦοτ 5JQT ·ͱΊ
5JQT ΫϥΠΞϯτ*1ͷऔಘ !
3BJMTͰ*1Λऔಘ͢Δϝιου 5JQT ActionDispatch::Request .remote_ip ActionDispatch::Request .ip 53645&%*1 ΞυϨεͷ֦ுੑ )551@$-*&/5@*1 ΛՃຯ
☓ ̋ ̋ ☓ "DUJPO%JTQBUDI3FRVFTUJQ Λར༻
5JQT ͷར༻έʔε 3BDLNJEESFXBSF (SBQF "QQMJDBUJPO$POUSPMMFS SFRVFTUJQͷ࣮ମ3BDL3FVRFTUJQ "DUJPO%JTQBUDI3FRVFTUJQΛར༻͢Δ͜ͱͰ౷Ұ 3BDL3FVRFTU (SBQF3FRVFTU "DUJPO%JTQBUDI3FRVFTU
3BDLNJEESFXBSF
$MPVE'SPOUͷ*1͕औΕΔ $'ͷ*1֎෦*1ͱͯ͠அ 5JQT ݪҼ ൃੜͨ͠
5JQT 3BDL3FVRFTUʹϞϯΩʔύον $'ͷ*1ϨϯδΛ53645&%*1ΞυϨεʹՃ ରॲ
ΛΦʔόʔϥΠυ ͠ɺˢͰੜͨ͠ 53645&%ͳ*1܈ Λར༻ trusted_proxy? $MBTTϩʔυ࣌ʹ $'ͷ*1ϨϯδΛ ੜ͢Δ ˢͰੜͨ͠$'ͷ *1ϨϯδΛؚΊɺ
MPDBMܥJOUBSOBM ܥͷ*1Λ߹Θͤͯ ఆٛ 5JQT
3BDL3FRVFTUJQ $MPVE'SPOUͷ*1ΞυϨεൣғ 3BDL3FRVFTUJQ $MPVE'SPOUͷ*1ΞυϨεൣғ ࢀߟࢿྉ https://github.com/rack/rack/blob/master/lib/rack/ request.rb#L267-L277 https://docs.aws.amazon.com/ja_jp/AmazonCloudFront/latest/ DeveloperGuide/LocationsOfEdgeServers.html 5JQT
5JQT ϝϯςφϯεϖʔδͷදࣔ !
Ϟνϕʔγϣϯ ιʔϦʔαʔόʔͷ༻ҙ໘ /HJOYͷDPOpHมߋ໘ -BNCEB!&EHFͰସ 5JQT
-BNCEB!&EHFͱ ᶃViewer Request ᶄ0SJHJO Request ᶅ0SJHJO Response ᶆ7JFXFS Response Ϣʔβʔ
$' ΦϦδϯ $MPVE'SPOU্ͰҎԼͷ͍ͣΕ͔ͷΠϕϯτΛ ϑοΫͯ͠-BNCEBΛ࣮ߦ͢ΔαʔϏε 5JQT
ΞΫηεڐՄ*1ϝϯςφ ϯε։࢝࣌ؒͳͲಈతʹม ߋ͍ͨ͠4ʹKTPOͱ ͯ͠ஔ͠ಡΈࠐΈ εςʔλεͰɺ ҙͷ)5.-#PEZΛฦ͢ ʢ7JFXFS3FRVFTUʹઃఆʣ 5JQT
-BNCEBಉ༷ʹεϩοτϦϯά͕ൃੜ 5JQT ڥมͷར༻ෆՄ ಈ࡞ͨ͠ΤοδϩέʔγϣϯʹΑͬͯϩά ग़ྗ͞ΕΔϦʔδϣϯ͕ܾ·Δ όʔδχΞϦʔδϣϯʹஔ -BNCEB!&EHFͷҙ
ࢀߟࢿྉ 5JQT "84-BNCEB!&EHFͷϩάͲ͜ʁ $MPVE'SPOU-BNCEB!&EHFͰͷ"84 -BNCEBͷ༻ https://dev.classmethod.jp/cloud/aws/where-is-the-lambda- edge-log/ https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/lambda-edge.html
ΞδΣϯμ OPUFͷΠϯϑϥߏ $'Λར༻͢ΔϝϦοτʗσϝϦοτ 5JQT ·ͱΊ
·ͱΊ ΫϥΠΞϯτ*1ΛऔΓ͍ͨͱ͖ཁҙ $'ʹݶΒͣϓϩΩγΛհͯ͠ଟஈʹͳΔ߹ -BNCEB!&EHFศར ίετ͕ΫϦΞͰ͖ΔͳΒಋೖ͖͢ ͕ଟ͍ͷͰτϨʔυΦϑΛԡ͑Δ
͋Γ͕ͱ͏͍͟͝·ͨ͠