当您在 AWS API Gateway 中部署一个阶段然后更新您的 Lambda 时会发生什么? Lambda 是版本化的吗?
假设我有一个 lambda charlie
我上传它(版本 1)然后部署一个 API 网关阶段,dev
.然后我更新到 charlie
(版本 2)并部署另一个阶段(prod
)?
dev
和舞台prod
运行相同的 Lambda? dev
运行 version 1
查理 & prod
运行 version 2
? 最佳答案
What happens when you deploy a stage in the AWS API Gateway and then update your Lambda? Is the Lambda versioned?
如果您遵循 AWS Lambda Versioning,Lambda 将被版本化并且您通过 a) 显式发布版本或 b) publishing a version at the time you create or update a Lambda function 发布版本
如果您正在使用 API Gateway stage variables ,然后您可以使用阶段变量和 Lambda 版本别名调用不同的 Lambda 版本。
Are stage dev and stage prod running the same Lambda?
是的。除非您发布和管理 Lambda 版本。
Or is dev running version 1 of charlie & prod running version 2?
否。如上所述,您需要使用阶段变量和别名。
关于amazon-web-services - AWS Lambda 和 API 网关阶段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37821013/