, you get credits if they don't meet the SLA
, $0.20 per 1M requests and $0.000016667 for every GB-second
You pay for the execution time of your function, rounded to 100 ms.
As event source you can have (just a few examples) S3 buckets, SES, SNS, DynamoDB and API Gateway or ALB (web requests), complete list here
, both synchronous and asynchronous.
Your function runs in one of the available runtimes
((versions of) languages)
The code you write does not have to be re-entrant, "If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency."
You can specify a timeout during creation of your function.
If you invoke your Lambda function via an ALB, you can use lb listener rules to send request to functions based of path or http headers, see Using AWS Lambda with an Application Load Balancer
, for each Lambda function you need an lb tgt group.
To create a Lambda function you first create a Lambda function deployment package, a .zip file consisting of your code (a Go executable) and any dependencies:
GOOS=linux go build main.go zip function.zip mainAllow the ALB to invoke your function:
aws lambda add-permission --function-name LambdaSample01 \ --statement-id load-balancer --action "lambda:InvokeFunction" \ --principal elasticloadbalancing.amazonaws.com
When coding a lambda in golang that responds to ALB events, make sure to use the aws-lambda-go alb events