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
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
Can We Measure Developer Productivity?
ewolff
1
150
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
Platform Engineering for Software Developers and Architects
syntasso
1
510
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
580
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.1k
フルカイテン株式会社 採用資料
fullkaiten
0
40k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
680
Featured
See All Featured
BBQ
matthewcrist
85
9.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Writing Fast Ruby
sferik
627
61k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
What's in a price? How to price your products and services
michaelherold
243
12k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Visualization
eitanlees
145
15k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Scaling GitHub
holman
458
140k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
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ศར ίετ͕ΫϦΞͰ͖ΔͳΒಋೖ͖͢ ͕ଟ͍ͷͰτϨʔυΦϑΛԡ͑Δ
͋Γ͕ͱ͏͍͟͝·ͨ͠