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

Real use-cases of using AWS Lambda for infrastr...

Avatar for Artem Nikitin Artem Nikitin
February 08, 2019

Real use-cases of using AWS Lambda for infrastructure tasks

In this talk, we will look at the application of the serverless approach on the example of AWS Lambda to solve various practical problems related to the infrastructure. It will cover both the practical application of AWS Lambda and the issues of testing, deployment and monitoring of serverless applications.

Examples of problems that we solve Lambda’oh:
– Keeping the AMI up to date (solution similar to Packer from HashiCorp, but to our specifications).
– Sending feedback from CI to code review.
– Disable unused EC2 instances.
– Microservice for collecting metrics, etc.

Avatar for Artem Nikitin

Artem Nikitin

February 08, 2019
Tweet

More Decks by Artem Nikitin

Other Decks in Technology

Transcript

  1. !2 Agenda What are we talking about today? What is

    serverless / AWS Lambda? 1 Why and how we use it 2 DevOps for Lambda 3
  2. !3

  3. !5 History • 2012
 Why The Future Of Software And

    Apps Is Serverless 
 https://readwrite.com/2012/10/15/why-the-future-of-software-and-apps-is- serverless/ • 2014
 AWS announced Lambda
 https://aws.amazon.com/blogs/aws/run-code-cloud/ Or how it all started
  4. !6 Serverless • PaaS 2.0 ?! • FaaS
 • A

    Serverless solution is one that costs you nothing to run if nobody is using it (excluding data storage) What is it?
  5. !7 Lambda • Ideal example of 12 factor app •

    New pricing model • New approach to infrastructure/ops It's not that new actually
  6. !9 Lambda • Logs (via CloudWatch) • Tracing (via X-Ray)

    • Monitoring Not just an infrastructure
  7. !10 Lambda • Supports C#, NodeJS, Python, Java, Go, Ruby

    • Lambda@Edge
 • Integrated with many AWS services • HTTP via API Gateway • Run in VPC • 3rd party Lambda’s via Serverless Application Repository More technical details
  8. !11

  9. !12 Why Lambda? • Complex CI, mostly in AWS •

    We needed an infrastructure to support CI
 • https://2018.heisenbug-piter.ru/en/talks/2018/spb/ 4wqvzujdickc2awoms6kgi/ 
 • https://devopsconf.io/moscow/2018/abstracts/3735
  10. !14

  11. !15 Our use cases • Posting feedback from CI to

    code review • Updating AMI (like Packer from HashiCorp but with our specifics)
  12. !16

  13. !17 Our use cases • Posting feedback from CI to

    code review • Updating AMI (like Packer from HashiCorp but with our specifics) • Collecting metrics from test apps
  14. !18

  15. !19 Our use cases • Posting feedback from CI to

    code review • Updating AMI (like Packer from HashiCorp but with our specifics) • Collecting metrics from test apps • And much more smaller tasks
  16. !20 What else can be done • Usual things like

    microservices • Glue for AWS services
 • https://github.com/AutoSpotting/AutoSpotting • Massive scaling of E2E tests • And much more..
  17. !21

  18. !23 Development • AWS SDK • Serverless Framework, APEX •

    https://github.com/artemnikitin/delex-code-example
  19. !24 Development • Cold start problem • No connection pooling

    • Lambda’s from Java to Go -> 2x money savings • 250K+ requests and 180K seconds in October for 3.16 USD*
  20. !27 Deployment • Only one way for release and versioning

    • Many modern practices are unusable • API Gateway with separated release process
  21. !29