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

Learn to Program The Cloud with Ruby & AWS Lambda

Learn to Program The Cloud with Ruby & AWS Lambda

A curated set of resources and guides on how to use Ruby & Rails as your entry point to learning native AWS cloud architectures. Presented to DC Ruby User Group. https://www.meetup.com/dcruby/events/wzqbvpybcjbxb/


Ken Collins

June 18, 2020


  1. Learn to Program The Cloud with Ruby & AWS Lambda

  2. Ken Collins @MetaSkills Principal Engineer @CustomInkTech

  3. Programming The Cloud ⛅

  4. None
  5. Getting Started AWS, SAM, & Lambda https://aws.amazon.com/serverless/sam/

  6. https://dev.to/aws-heroes/aws-lambda-microservice- workshop-using-s3-libvips-ruby-4o96 Start Small. Ruby S3/Image Microservice.

  7. https://lamby.custominktech.com/docs/quick_start And Grow. Rails & JavaScript Starter Application. Deploy in

    5 min.
  8. https://lamby.custominktech.com/docs/quick_start And Grow. Rails & JavaScript Starter Application.

  9. https://lamby.custominktech.com/docs/quick_start And Grow. Rails & JavaScript Starter Application.

  10. Unconscious Bias? or Knowledge Gaps? (open discussion)

  11. Rails & Lambda (from the inside out)

  12. How Does Lamby Work?

  13. How Does Lamby Work? Hash Convert

  14. How Does Lamby Work? app.rb Everything else is just basically

  15. How Does Lamby Work? 3 Seconds (cold start) Milliseconds

  16. • Think of app.rb as config.ru for API Gateway. •

    Rails is in good company! Express, Flask, etc all do the same thing. • Think of Lambda as a cheaper PAYGO on Heroku. Rails & Lambda (inside out)
  17. Scaling compute is not your problem anymore.

  18. The Serverless Application Model https://aws.amazon.com/serverless/sam/

  19. Core SAM CLI Commands. More on the ./bin directory later.

  20. Infrastructure as Code (IaC) . I hope you like YAML!

  21. SAM is Syntactic Sugar for CloudFormation. Meta & DRY!

  22. AWS::Serverless::Function

  23. • AWS Resource Specification Language. • CLI Interface to Develop

    & Deploy Apps. • Lamby Uses Cutters Templates. • Super fast Squirrel on GitHub. Keep Up! • Bookmark These Resources… Serverless Application Model
  24. AWS Serverless Application Model (AWS SAM) Specification https://github.com/awslabs/serverless-application-model https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html Intrinsic

    Function Reference https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html AWS Resource and Property Types Reference https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html AWS SAM CLI GitHub Release Notes https://github.com/awslabs/aws-sam-cli/releases
  25. Docker Conventions

  26. https://github.blog/2015-06-30-scripts-to-rule-them-all/ Normalized Script Convention

  27. Docker & Docker Compose Bin Scripts.

  28. Docker Compose. Avoids Repeated ENV & Volume Configs

  29. Docker. Rails, SAM, JavaScript, Etc on Lambda Dev.

  30. Script Conventions. Underscore for Container bin/_server bin/server

  31. • Node & Webpacker • Compiled & Served Assets •

    Dotenv Integration • Encrypted Credentials with SSM Parameter Store Dig In & Explore https://github.com/customink/lamby-cookiecutter • CloudWatch Logging & Lograge • API Gateway HTTP API v2 Default • Custom Domain Names, SSL, & CloudFront • https://lamby.custominktech.com
  32. • Native MySQL & PostgreSQL using AWS RDS Proxy. Migrations?

    • Best Practices for Background Tasks & Event-Driven architecture using EventBridge, Asynchronous Invocations, and SNS/SQS. ActiveJob? Coming Soon…
  33. None