Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
803 views
in Technique[技术] by (71.8m points)

amazon web services - How to point ApiGateway to a specific Lambda alias

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 the wild.

I now want to modify the Lambda function, but I see no way to change my ApiGateway resource to point to an alias of the lambda. This is my first time playing with any of these technologies and I see no easy mechanism to manage this in the aws console.

How can I modify my ApiGateway resource to point to my lambda alias so I can edit trunk without affecting existing clients?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...