如何将ApiGateway指向特定的Lambda别名 [英] How to point ApiGateway to a specific Lambda alias

查看:122
本文介绍了如何将ApiGateway指向特定的Lambda别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在亚马逊的ApiGateway中创建了一个资源.它指向一个Lambda函数.本地移动应用程序(Android和ios)已经将其击中了.

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.

我现在想修改Lambda函数,但是我看不到将ApiGateway资源更改为指向lambda别名的方法.这是我第一次使用其中任何一种技术,并且在aws控制台中看不到任何简单的机制来管理该技术.

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.

如何修改ApiGateway资源以指向我的lambda别名,以便我可以在不影响现有客户端的情况下编辑中继?

推荐答案

在集成类型-> Lambda函数中,您需要添加对阶段变量MyLambdaFuntionName:${stageVariables.lambdaAlias}的引用,然后为每个阶段在阶段中设置lambdaAlias相应地使用变量标签(lambdaAlias = dev,lambdaAlias = prod等)

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.)

这里有一个带有屏幕截图的示例: https://aws.amazon.com/blogs/compute/using-api-gateway-stage-variables-to-manage-lambda-functions/

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"

这篇关于如何将ApiGateway指向特定的Lambda别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆