在AWS CloudFormation中,打包(deploy) Lambda函数代码时需要使用AWS SAM工具。如果打包后更新了代码,但是更新后的代码没有被更新到Lambda函数中,可能是因为缓存的问题导致的。解决这个问题的一种方法是使用以下命令替换原先的打包命令:
aws cloudformation package --template-file --s3-bucket --output-template-file && aws cloudformation deploy --template-file --stack-name --capabilities CAPABILITY_IAM
这个命令会在打包和部署过程中将输出缓存中的文件清除。
上一篇:AWSCloudFormation错误:使用ImageID部署错误。
下一篇:AWSCloudFormation代码管道在构建期间出错