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
Amplifyを使ったWebサイト構築 〜 Nstockの事例を添えて 〜
fukuiretu
0
110
開発生産性と品質の横断的な課題を解決する!エンジニアリング支援室の挑戦 -1Qで取り組んだことを添えて-
fukuiretu
2
6.5k
EMになって最初の失敗談 - コミュニケーション編 -
fukuiretu
2
6.3k
問い合わせ対応当番を自動化で業務効率化している話
fukuiretu
0
720
サーバーレスで始める ゆるふわデータ基盤 - noteの事例 -
fukuiretu
2
7.6k
191109_sacss.pdf
fukuiretu
1
2.3k
noteをNuxt.jsで再構築した話 -2nd-
fukuiretu
6
12k
181117_wannatech.pdf
fukuiretu
1
500
noteをNuxt.jsで再構築した話
fukuiretu
22
56k
Other Decks in Technology
See All in Technology
podman_update_2024-12
orimanabu
1
280
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
110
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
1
290
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
5分でわかるDuckDB
chanyou0311
10
3.2k
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
110
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
170
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
350
Featured
See All Featured
Designing for Performance
lara
604
68k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Code Review Best Practice
trishagee
65
17k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
How STYLIGHT went responsive
nonsquared
95
5.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
How GitHub (no longer) Works
holman
311
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
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ศར ίετ͕ΫϦΞͰ͖ΔͳΒಋೖ͖͢ ͕ଟ͍ͷͰτϨʔυΦϑΛԡ͑Δ
͋Γ͕ͱ͏͍͟͝·ͨ͠