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.7k
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.2k
貴方はOmniAuth::AuthHashを知っていますか?
teitei
0
7.7k
myhome-progress
teitei
0
76
recommend parallel career
teitei
0
1k
impression of google chrome headless
teitei
0
1.8k
嫁に怒られずにGoを書く技術
teitei
0
2.5k
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Code Reviewing Like a Champion
maltzj
520
39k
How to Ace a Technical Interview
jacobian
276
23k
Docker and Python
trallard
41
3.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Practical Orchestrator
shlominoach
186
10k
Statistics for Hackers
jakevdp
796
220k
Code Review Best Practice
trishagee
65
17k
Optimising Largest Contentful Paint
csswizardry
33
3k
Music & Morning Musume
bryan
46
6.2k
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:
·ͱΊ • Ψοͱ࣌ؒͰ࡞Δ͖ͩͬͨ • ੵΈॏͳΔݴ͍༁ɺ৳ͼΔೲظɺΕ͍ͯ͘ίʔ υ • αʔόʔϨεΞʔΩςΫνϟศར • αʔόͷӡ༻Λ͋·Γؾʹ͔͚ͣʹྑ͍
• ͪΐͬͱͨ͠λεΫΛΓग़͢ʹΓྑ͍