Link Search Menu Expand Document

Reconsider the default decision of using API Gateway

Somehow, most people end-up using API Gateway to invoke their Lambda Functions, even though it may not be necessary. There are multiple ways of invoking a Lambda Function, and invoking it “directly” involves the least amount of moving parts, while also incurring the least cost.

Yes, API Gateway pricing is over & above AWS Lambda pricing. API Gateway may not even be necessary in your use-case. Do you really need to expose your Lambda Function as an HTTP API? Consider the alternative instead: you can treat your Lambda Function as an RPC by invoking it via the AWS SDK. Almost all languages have an AWS SDK. In Haskell there is the amazonka family of libraries. So, insteaed of making an HTTP API call via wreq or http-client (which would force you to configure an API Gateway), you can use the invoke function, provided by amazonka-lambda instead.

With all the reasons for using serverless-haskell gone, we could finally get rid of one moving part along with its crappy YAML configuration.

But that amplified an existing problem with the amazonka library…