How to update a AWS::Lambda::Version always to $LATEST in a CF template

大憨熊 提交于 2020-02-04 06:42:30

问题


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

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

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/53802340/how-to-update-a-awslambdaversion-always-to-latest-in-a-cf-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!