Back Home

AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second. You pay only for the compute time you consume - there is no charge when your code is not running.

So they are not free. You still pay for compute time.

Typically lamda's are used in response to events:

Lamda's do come with limits including:

Overview

Scaling and Performance

  • Have your initial Lambda use the SDK to asynchronously launch further lambdas that actually do work (fan out)
  • Use Lambda scheduling with scheduling offsets and long timeouts, so that you have multiple lambdas running concurrently.

Http Lambda

The entry point of the Lambda function. AWS will create an instance of this class and call the handleRequest method for every request it receives.

  • It will hold on to the same LambdaHandler instance for the life of the container.
class LambdaHandler implements RequestHandler<Map, Response> {
 
 
 // lambda handler
    Map myHandler(String data, Context context) {
    }
}

Monitoring (MetOps)

S3 with Lamdas

Build and Gradle

There is a gradle https://github.com/classmethod/gradle-aws-plugin

buildscript {
  repositories {
    mavenCentral()
    maven { url "https://plugins.gradle.org/m2/" }
  }
  dependencies {
    classpath "jp.classmethod.aws:gradle-aws-plugin:0.30"
  }
}
 
apply plugin: 'jp.classmethod.aws'
 
aws {
  profileName = 'credentials-profile-name-in-your-profile-configuration-file (~/.aws/credentials)'
  region = 'ap-northeast-1'
}

Testing

Lambda Logging and Monitoring

 
amazon_lamdas.txt · Last modified: 2017/11/24 03:30 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd