如何在CF模板中将AWS :: Lambda ::版本始终更新为$ LATEST [英] How to update a AWS::Lambda::Version always to $LATEST in a CF template

查看:67
本文介绍了如何在CF模板中将AWS :: Lambda ::版本始终更新为$ LATEST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有Lambda @ Edge函数的Cloudformation模板。这意味着我需要lambda函数和一个Version(类型WS :: Lambda :: Version)。

I have a Cloudformation template with a Lambda@Edge function. This means I need the lambda function, and a Version (type WS::Lambda::Version).

现在,我第一次创建CF模板时,它可以工作。
但是,当我更新CF模板并且更新Lambda函数时,Lambda版本不会更新(从某种意义上讲,它没有变化!)。

Now, the first time I create the CF template, it works. But when I update the CF template and the Lambda function is updated, the Lambda version does not get updated (kind of makes sense, it did not change!).

如何在Lambda函数更新时强制更新Lambda版本?

How can I force the Lambda version to update when the Lambda function updates?

推荐答案

您可以创建可编辑的脚本部署之前的模板。它可以更改版本资源名称,这将创建一个新版本。最后,需要确保Lambda资源指向该新版本名称。

You can create a script that edits the template before deployment. It can change the version resource name which will create a new version. Finally it will need to make sure the Lambda resource points to that new version name.

您也许可以使用新的 CloudFormation宏,但是我还没有尝试过,所以我不确定如何会起作用。

You might be able to do it with the new CloudFormation macros, but I haven't tried that yet so I'm not sure how that would work.

这篇关于如何在CF模板中将AWS :: Lambda ::版本始终更新为$ LATEST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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