Skip to content

AWS Lambda

  • You can run your application  without having to manage any EC2 instances or containers
  • HA and scaling is built in
  • Application types:
    • data processing
    • real-time stream processing
    • machine learning
    • WebSockets
    • IoT backends
    • mobile backends
    • web applications
  • You can configure labmda function using:
    • Lambda console
    • Lambda API
    • AWS CloudFormation
    • AWS Serverless Application Model (AWS SAM)
  • You can invoke your function:
    • directly by using the Lambda API
    • you can configure an AWS service or resource to invoke your function in response to an event.

Managing

  • application framework
    • supports the package (ZIP archive to an Amazon S3 bucket) and deploy (deploy to AWS Lambda) steps
  • code repository
    • multiple Lambda functions per service
    • each service has own template, and use one repository per service and template
  • development environment
    • separate prod and other environments in different AWS accounts
    • strategies for developers
      • one AWS for every developer if you have management process in place to handle it
      • use one AWS account for every developers

Testing

Local testing

  • Unit tests
  • Mocking options
    • DynamoDB local and LocalStack
    • Custom mocks
      • Require developers's time
      • But it maybe less expensive in case when you are trying to test an application that relies on multiple services interacting with each other.

Debugging

  • You can't connect to remote lambda
  • But you can use SAM CLI to connect to your application. You local version of application is updated in SAM CLI image and you can debug it.

References

  1. https://explore.skillbuilder.aws/learn/course/external/view/elearning/1851/aws-technical-essentials?da=sec&sec=prep Module 2
  2. AWS course: Introduction to Serverless Development
  3. AWS website: Building Applications with Serverless Architectures(opens in a new tab)
  4. AWS blog: Best Practices for Organizing Larger Serverless Applications(opens in a new tab)
  5. AWS developer guide: Configuring AWS Lambda Functions(opens in a new tab)
  6. AWS blog: 10 Things Serverless Architects Should Know(opens in a new tab)
  7. AWS workshop: AWS Alien Attack: A Serverless Adventure(opens in a new tab)
  8. AWS blog: Resize Images on the Fly with Amazon S3, AWS Lambda, and Amazon API Gateway(opens in a new tab)
  9. AWS blog: New for AWS Lambda – 1ms Billing Granularity Adds Cost Savings