繁体   English   中英

如何将 AWS Lambda 转换回 CloudFormation 模板

[英]How to convert AWS Lambda back into CloudFormation template

我有一个由 Cloudformation 模板创建的 AWS Lambda。 在过去的几天里,我增强了 function 代码。 现在我想用更新的 Lambda 代码更新原始的 function 模板。

实现这一目标的最佳方法是什么?

I'd like to avoid having to manually convert the Lambda python code to yaml or json as this will be too time consuming and error prone, anticipating that there will be fixes to the code over the next few weeks.

实现此目的的一种方法是使用 SAM https://aws.amazon.com/serverless/sam/
这样,您将始终能够在部署之前在 cloudformation 模板中 package 您的 lambdas。
CDK也将实现这个概念。

如果这只是您想做的一次性事情,您实际上不需要更改 lambda 中的任何内容,您只需复制代码并将其作为内联代码粘贴到 CloudFormation 模板中,如下所示: https:// docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM