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.8k
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.3k
貴方はOmniAuth::AuthHashを知っていますか?
teitei
0
7.8k
myhome-progress
teitei
0
77
recommend parallel career
teitei
0
1.1k
impression of google chrome headless
teitei
0
1.8k
嫁に怒られずにGoを書く技術
teitei
0
2.5k
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
41
2.6k
Making Projects Easy
brettharned
116
6.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.6k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Writing Fast Ruby
sferik
628
61k
The Cult of Friendly URLs
andyhume
78
6.3k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
The Invisible Side of Design
smashingmag
299
50k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
660
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.1k
Into the Great Unknown - MozCon
thekraken
37
1.7k
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:
·ͱΊ • Ψοͱ࣌ؒͰ࡞Δ͖ͩͬͨ • ੵΈॏͳΔݴ͍༁ɺ৳ͼΔೲظɺΕ͍ͯ͘ίʔ υ • αʔόʔϨεΞʔΩςΫνϟศར • αʔόͷӡ༻Λ͋·Γؾʹ͔͚ͣʹྑ͍
• ͪΐͬͱͨ͠λεΫΛΓग़͢ʹΓྑ͍