Anyone have some good resources for managing infrastructure of a fuckton of lambdas. I am a daily terraform user but I’m tasked with using lambdas instead of a server. I have tried amplify but it doesn’t give me the same level of comfort as Terraform. My manager seems to think it’s okay to be clicking through everything, but if you ask me infrastructure as code is the way to go. Learning cloudformation also just feels like vendor lock in
Any lambda backend horror stories or good stories?
You definitely don’t want to maintain this by hand. That’s a terrible idea and you’re right to find a way to codify and automate deployment. I don’t have any first-hand experience here though. I love terraform but it doesn’t seem like the right tool for the job, assuming this is for a web app.
If it’s for a web app I recommend checking out a framework built for that purpose like serverless if possible.
I have not used Terraform myself, we use straight Cloudformation Templates deployed via Azure Devops->Code Pipeline->Code Build->Cloudformation Stack, but for your use case of 100,000 lambda’s to manage. You have to use Infrastrucutre as Code, I can’t imagine having to recreate that via the console even if you only had 50.
If you are familiar with Terraform I would continue to use that. You have so many Lambda’s to deploy I would think you need to create your own small application to just keep track of them. Can you interface Terraform with a dynamodb table (or a local db) to keep all of the parameters for deployments stored there? Then just loop thru the table to deploy your lambdas.
I am not sure if Terraform is able todo this, but it seems the cleanest. In most of the other deployment options you would me managing 100,000 deployment yaml files, ugh!
To the boss who likes the console: what if you mis-click? What if you need to make the same change to 10 or 100 resources? After you make a change to your staging environment, how do you make the same change to production?
IaC is the way to go. You get dev-level support for operations: testing, preview to the business, consistency, confidence. Version control!
(FYI CloudFormation is fine. It’s solidly supported by AWS. Many companies whine about “vendor lock in”, but they rarely actually move.)
Terraform is great. Build a module that wraps Lambda, making it easy for the devs to get their job done and the module will take care of the lower-level details.
CDK is also great, and it can do Terraform as a backend – you get the best of both worlds! CDK will create permissions for you, which is a tremendous help.
Source: DevOps consultant to enterprises. Learned CloudFormation this year when studying to get my Cloud Developer Associate certificate.
My team manages about 90 lambdas right now using terraform. It’s a standard pattern for them to get started. Then if they need to add other things, they can in the same set of terraform.