问题
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