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
AWS parking lot shutter hack project
Search
teitei_tk
February 09, 2017
2
3.6k
AWS parking lot shutter hack project
teitei_tk
February 09, 2017
Tweet
Share
More Decks by teitei_tk
See All by teitei_tk
dive to Ruby on Rails module autoloading
teitei
1
4k
貴方はOmniAuth::AuthHashを知っていますか?
teitei
0
7.4k
myhome-progress
teitei
0
75
recommend parallel career
teitei
0
930
impression of google chrome headless
teitei
0
1.7k
嫁に怒られずにGoを書く技術
teitei
0
2.4k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
331
56k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Thoughts on Productivity
jonyablonski
57
3.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
16
1.4k
Typedesign – Prime Four
hannesfritz
36
2.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
77
42k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
A designer walks into a library…
pauljervisheath
199
23k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Code Reviewing Like a Champion
maltzj
513
39k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
13
1.5k
Transcript
AWSΛͬͨறྠγϟο λʔHACKϓϩδΣΫτ 2017/02/08 @teitei_tk
ࠓ·Ͱ͍ͬͯͨ͜ͱ • Slackͷͱ͋ΔνϟϯωϧͰಛఆͷݴ༿Λ ᄁ͘ͱ1Fறྠͷγϟολʔ͕։͘ • ศར • ָͪΜ • UX࠷ߴ
͕ɺ
ʊਓਓਓਓਓਓਓਓਓ_ ʼ αʔϏεऴྃͷ͓Βͤ ʻ ʉY^Y^Y^Y^Y^Y^Y^Yʉ
αʔϏεऴྃͷ͓Βͤ • ༻͍ͯͨ͠DBaaSͷڍಈ͕ෆ҆ఆ • Γ͑ઌͷݕ౼ɺઃܭɾ࣮ʹख͕ճΒ ͳ͍
AWSΛར༻ͯ͠ ͏Ұ͋ͷମݧΛ
ͱΓ͋͑ͣ ໊ΓΛ্͛ͨ
• AWSͷମܥతͳֶशΛ͍ͨ͠ • ೖ͔ࣾͨ͠ΓͩͬͨͷͰإΛ֮͑ͯΒ͏ • ͍ͬͯ͘ͱ͍͏ؾ࣋ͪ
͍ͬͯͧ͘
چ ߏਤ Post Get Every Sec
͜ΕΛϕʔεʹ͢Δ
৽ ߏਤ 1. Open Request 2. Update Shutter Status 3.
Request Check & Open Door 4. Finish Message
RaspberryPi(Client) • ຖඵAPI GatewayγϟολʔͷΦʔϓϯϦΫΤ ετ͕དྷ͍ͯͳ͍͔Λ֬ೝ • ΦʔϓϯϦΫΤετ͕དྷ͍ͯͨΒαʔϘ(։Ϙλ ϯ)Λ࣮ߦ
AWS(Server) • API Gateway & Lambda • ྲྀߦΓʁͷServerless Architecture @
Python • ϑϨʔϜϫʔΫΘͳ͍ • SQS • ΦʔϓϯϦΫΤετ͕དྷͨΒQueueΛEnQueue
API Gateway • ֤HTTP MethodຖʹׂΛࢄ • GET • γϟολʔͷঢ়ଶཧ •
PUT • γϟολʔͷΦʔϓϯ • POST • γϟολʔ͕։͖ऴΘͬͨࡍͷ௨
·͋Α͋͘Δ ΠϕϯτυϦϰϯͳઃܭ
ηΩϡϦςΟΠϯγσϯτ • URL࿙ΕͰੜ͡Δ֎෦ͷਓؒʹΑΔ։ด • SlackͰ͔͠ϦΫΤετདྷͳ͍ఆͰɺURL͕ ࿙ΕͨΒ౪͞Ε͔Ͷͳ͍ɻ • ϩʔυόΠΫ1XXສ͢Δ͋Δ༷ͳͷͰׂΓ ͱ͋Γ͑Δ
ରԠࡦ • API GatewayͷCustom Authorize༻ͷFunction Λ࡞ • Request Headerʹೝূ༻ͷTokenΛࡌͤͯೝূ Λߦ͏
ग़དྷΔͧʂʂʂ
None
աͪͱጻչͱݴ͍༁ͱ • ·͋PythonͳΒ༨༟Ͱ͠ΐͱ͍͏Ṗͷຫ৺ • ͑Ͱͨ͠ɻ • ઃܭϛεʹΑΔRollback • ࠷ॳDynamoͰ͍͜͏ͱ͍ͯͨ͠
ར༻ऀͷํʑ͏͠ Β͓ͪ͘Λ :pray:
·ͱΊ • Ψοͱ࣌ؒͰ࡞Δ͖ͩͬͨ • ੵΈॏͳΔݴ͍༁ɺ৳ͼΔೲظɺΕ͍ͯ͘ίʔ υ • αʔόʔϨεΞʔΩςΫνϟศར • αʔόͷӡ༻Λ͋·Γؾʹ͔͚ͣʹྑ͍
• ͪΐͬͱͨ͠λεΫΛΓग़͢ʹΓྑ͍