Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the best path to take for aws CI/CD workflow? Cloudformation, SAM or Serverless framework?

Need an expert's input who has used cloudformation, sam and serverless framework to deploy nodejs app.

Please advise which is the best path to take I have used serverless framework but not sam or cloudformation, while I agree that it simplifies the process, I wish to learn more on the underlying configuration.

I am leaning towards cloudformation just because both the frameworks transform the code to cloudformation templates. Please correct me if I am wrong and appreciate the best resources to learn the same.

like image 443
Khuram Niaz Avatar asked Nov 26 '25 02:11

Khuram Niaz


2 Answers

SAM is basically an extension of Cloudformation. If you know SAM, you basically know Cloudformation. SAM can and should be used in conjunction w/ Cloudformation for testing locally.

Serverless is an abstraction layer on top of Cloudformation. It helps to expedite app creation and deployment. It falls short if you are doing more advanced configurations

I always lean towards Cloudformation (or SAM) because it is provided by the CSP (ie AWS). This means everything new will be automatically available, rather than waiting for an abstraction layer (like serverless) to bake in support.

like image 195
LostJon Avatar answered Nov 27 '25 18:11

LostJon


I recommend the Serverless Framework. The advantages are several:

  • Much easier syntax than CloudFormation
  • More portable than CloudFormation (you can change between cloud providers)
  • Ability to write raw CloudFormation inline in serverless.yml if needed
  • Easy to deploy (just run sls deploy)

There is a sample project at my gitlab profile if you are interested (for GoLang but the principles are the same as for other runtimes) https://gitlab.com/montao/aws-lambda-go-gitlab-sls

like image 23
Niklas Rosencrantz Avatar answered Nov 27 '25 18:11

Niklas Rosencrantz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!