Upgrade to Pro — share decks privately, control downloads, hide ads and more …

now

06c292fa0b9557777d3cb4663ceec40a?s=47 aggre
November 03, 2017

 now

Serverless Conf Tokyo 2017 での LT 資料です。

06c292fa0b9557777d3cb4663ceec40a?s=128

aggre

November 03, 2017
Tweet

Transcript

  1. now © 2017 @aggre

  2. Cloud hell Lambda Cloud Functions SAM Local Azure Functions Cloud

    Functions Local Emulator Azure Functions Core Tools DynamoDB Local LocalStack template.yaml local.settings.json Step Functions
  3. Simplicity

  4. $ now

  5. now === 'Just a Node.js server’ && now === 'Ultra

    easy deployment'
  6. $ vi server.js require('http').createServer((req, res) => { res.end('▲ Hello World')

    }).listen(process.env.PORT)
  7. $ vi package.json { "name": "try-now", "scripts": { "start": "node

    server.js" } }
  8. $ now

  9. $ now > Enter your email: hiroyuki.aggre@gmail.com

  10. $ now > Enter your email: hiroyuki.aggre@gmail.com >We sent an

    email to hiroyuki.aggre@gmail.com. Please follow the steps provided
  11. None
  12. $ now > Enter your email: hiroyuki.aggre@gmail.com >We sent an

    email to hiroyuki.aggre@gmail.com. Please follow the steps provided > Ready! https://try-now-wenliudgwx.now.sh [3s] > You (aggre) are on the OSS plan. Your code and logs will be made public. > Are you sure you want to proceed with the deployment? [y|N]: y > Deployment complete!
  13. $ curl https://try-now-wenliudgwx.now.sh ▲ Hello World

  14. ✔ Auto-scale ✔ Auto-freeze ✔ Free SSL ✔ HTTP/2 ✔

    Custom domain ✔ Alias
  15. module.exports = (req, res) => { res.end('Welcome to Micro') }

    micro
  16. But… …Lambda …Cloud Functions …Azure Functions

  17. But… Lambda Cloud Functions Azure Functions now

  18. AWS $ now aws login > AWS credentials found in

    "~/.aws/credentials". > Would you like to use them? [Y|n]: y > Ready! Credentials will be read from your AWS config when needed
  19. AWS $ vi now.json { "name": "try-now", "description": "from now

    to lambda", "regions": "us-wese-1" }
  20. Deploy $ now aws > ✔ Build generated a 12.07KB

    zip [1s] > ✔ API resources created (id: "now-try-now- 0ZfLN4pSAI") [10s] > Success! https://p5o38dwqt3.execute-api.us- west-1.amazonaws.com/now [12s]
  21. Done! $ curl https://p5o38dwqt3.execute-api.us-west- 1.amazonaws.com/now

  22. Done? $ curl https://p5o38dwqt3.execute-api.us-west- 1.amazonaws.com/now {"message": "Internal server error"}

  23. Issues…

  24. now Lambda?

  25. None
  26. Thank you!