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.6k
myhome-progress
teitei
0
76
recommend parallel career
teitei
0
980
impression of google chrome headless
teitei
0
1.8k
嫁に怒られずにGoを書く技術
teitei
0
2.5k
Featured
See All Featured
Robots, Beer and Maslow
schacon
PRO
157
8.2k
A better future with KSS
kneath
237
17k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
39
2.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.8k
Building Applications with DynamoDB
mza
90
6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
A Philosophy of Restraint
colly
203
16k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
25
660
How GitHub Uses GitHub to Build GitHub
holman
473
290k
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:
·ͱΊ • Ψοͱ࣌ؒͰ࡞Δ͖ͩͬͨ • ੵΈॏͳΔݴ͍༁ɺ৳ͼΔೲظɺΕ͍ͯ͘ίʔ υ • αʔόʔϨεΞʔΩςΫνϟศར • αʔόͷӡ༻Λ͋·Γؾʹ͔͚ͣʹྑ͍
• ͪΐͬͱͨ͠λεΫΛΓग़͢ʹΓྑ͍