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
4.1k
貴方はOmniAuth::AuthHashを知っていますか?
teitei
0
7.5k
myhome-progress
teitei
0
76
recommend parallel career
teitei
0
950
impression of google chrome headless
teitei
0
1.8k
嫁に怒られずにGoを書く技術
teitei
0
2.4k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Designing on Purpose - Digital PM Summit 2013
jponch
113
6.6k
How to train your dragon (web standard)
notwaldorf
79
5.5k
Visualization
eitanlees
139
14k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
36
9.1k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
26
1.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
23
1.9k
Clear Off the Table
cherdarchuk
89
320k
The Pragmatic Product Professional
lauravandoore
29
6.1k
Statistics for Hackers
jakevdp
792
220k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
17
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:
·ͱΊ • Ψοͱ࣌ؒͰ࡞Δ͖ͩͬͨ • ੵΈॏͳΔݴ͍༁ɺ৳ͼΔೲظɺΕ͍ͯ͘ίʔ υ • αʔόʔϨεΞʔΩςΫνϟศར • αʔόͷӡ༻Λ͋·Γؾʹ͔͚ͣʹྑ͍
• ͪΐͬͱͨ͠λεΫΛΓग़͢ʹΓྑ͍