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.4k
EMになって最初の失敗談 - コミュニケーション編 -
fukuiretu
2
6.2k
問い合わせ対応当番を自動化で業務効率化している話
fukuiretu
0
700
サーバーレスで始める ゆるふわデータ基盤 - noteの事例 -
fukuiretu
2
7.5k
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
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
120
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
AGIについてChatGPTに聞いてみた
blueb
0
130
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
200
『Firebase Dynamic Links終了に備える』 FlutterアプリでのAdjust導入とDeeplink最適化
techiro
0
130
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
510
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.3k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
690
AIチャットボット開発への生成AI活用
ryomrt
0
170
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Rails Girls Zürich Keynote
gr2m
94
13k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Site-Speed That Sticks
csswizardry
0
28
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Documentation Writing (for coders)
carmenintech
65
4.4k
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ศར ίετ͕ΫϦΞͰ͖ΔͳΒಋೖ͖͢ ͕ଟ͍ͷͰτϨʔυΦϑΛԡ͑Δ
͋Γ͕ͱ͏͍͟͝·ͨ͠