How to point ApiGateway to a specific Lambda alias

前端 未结 2 699
北恋
北恋 2020-12-24 01:47

I created a resource in Amazon\'s ApiGateway. It is pointing to a Lambda function. This is being hit by a native mobile application (android and ios) which is already in t

相关标签:
2条回答
  • 2020-12-24 02:06

    Under Integration Type -> Lambda Function you need to add a reference to the stage variable MyLambdaFuntionName:${stageVariables.lambdaAlias} and then for each stage set the lambdaAlias in the Stage Variables tab accordingly(lambdaAlias=dev, lambdaAlias=prod, etc.)

    There is an example with screenshots here: https://aws.amazon.com/blogs/compute/using-api-gateway-stage-variables-to-manage-lambda-functions/

    Its kind of hidden towards the very bottom of the page starting with "Alternatively, you can mix and match static names"

    0 讨论(0)
  • 2020-12-24 02:12

    For the later googler, be careful to add permissions WITH the correct alias like yourfunc:prod not only yourfunc. That means if you'r planning to use 3 alias to invoke the lambda functions, you have to add 3 of them.

    0 讨论(0)
提交回复
热议问题