如何在CF模板中将AWS :: Lambda ::版本始终更新为$ LATEST

编程入门 行业动态 更新时间:2024-10-18 10:32:44
本文介绍了如何在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

本文发布于:2023-10-27 11:03:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1533182.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中将   模板   版本   如何在   CF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!