Reputation: 2489
I want to use code in file, but only inline code can be used in "AWS::Lambda::Function" template, can I convert "AWS::Lambda::Function" template to "AWS::Serverless::Function" template?
Upvotes: 0
Views: 500
Reputation: 663
The documenation clearly shows that the standard Lambda Function resource can take inline code but also a reference to a S3 location: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html
Inline code is anyway only recommended for simple just a few line lambda’s.
For pipelining it is makes deployment easy with aws cloudformation package
CLI command. It will take the lambda code upload it to a bucket and referend the correct artifact for you inside the template, which then is ready for deployment!
I known it is not a 100% answer to you quesion, but eventually you can reconsider if you really need to convert it!
Upvotes: 1