Set lambda function based on stage variable

aws
lambda

#1

I’ve followed the guide at https://aws.amazon.com/blogs/compute/using-api-gateway-stage-variables-to-manage-lambda-functions/ and manually set my Lambda function to be a stage variable like the following:

However I can’t figure out how I can do the same from within my serverless configuration is there any way to do this?


#2

Stages in the Serverless Framework are very different to stages in the API Gateway. Unless you know what you’re doing and you have a very strong need for them I would stay away from API Gateway stages (beyond what serverless does automatically) and use the Serverless Framework stages instead.