Option to Change Lambda Memory Based on API Gateway

Viewed 54

Basically I have a serverless Express application running through AWS lambda with API gateways attached. I don't need high function memory allocation for most endpoints but some endpoints I do need way more memory allocated. Instead of making multiple functions, is there a way to setup the function memory allocation depending on the endpoint, the request, or the event parameters?

1 Answers

Sadly, you can't control memory usage on per-invocation basis. Memory is function level setting, and it applies to all invocations.

In your case, if some endpoints require little memory and others much more, you have to have two functions.

Related