I have several AWS Lambda Functions created using AWS Console and every function has some dependent APIs.Now I want to integrate the same with AWS CI/CD using CodeBuild, CodePipeline, and CloudFormation. But the problem is I'm unable to update the existing lambda functions that are not created using the CloudFormation Stack
Error Message ABC_Lambda already exists
Please note that if I create a new lambda using the CI/CD flow and then try to update it, that's working fine.
So my questions are
How do I integrate the existing Lambda functions with AWS CI/CD workflow, without deleting and re-creating them?
Is there any way or SAM_template config param that force the CloudFormation to update the existing lambda(created using AWS console/AWS Commandline tool).
As noted by @omuthu, if you have not created the Lambdas with Cloudformation, you cannot use Cloudformation to update them.
What you could do, is, in your CodeBuild step, use the update-function-code
and update-function-configuration
APIs to perform the operations you need. This though does not allow you to integrate with SAM due to the limitation mentioned above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With