pelican
pelican

Reputation: 6234

git version control lambda functions

In an attempt to give developers the ability to write their lambda function locally, then commit and push to git, we used SAM and SAM Local.

We have about 50 lambda functions and anticipate this number to grow into the hundreds if not thousands.

I'm wondering how to group the lambda functions repositories i.e should we group all the lambda functions that get triggered by api gateway in their own repo, then all the ones that get triggered by s3 separately etc ...

The challenge is some lambda functions have their own dependencies and it just looks weird to try and have multiple lambdas with different dependencies within same repo. One lambda might have npm package dependencies, another might have python libraries dependencies, etc ... so do I git commit and git push those two lambda in their own separate repos or organize them in separate folders and push them to same repo? Or have separe repos per lambda function?

It doesn't seem feasible to commit each lambda to its own repo especially as the number of those functions grow overtime.

I'm new to aws tools and would appreciate someone's insights on this!

Maybe you've ran into this problem before?

Upvotes: 10

Views: 3806

Answers (1)

Noel Llevares
Noel Llevares

Reputation: 16037

I would group them according to their purpose. For example,

  • REST API (HTTP endpoints)
  • GraphQL API (HTTP endpoints)
  • Auth API (HTTP endpoints)
  • Admin API (HTTP endpoints not part of our user-facing product but is essential for managing our customers such as billing systems and company dashboards)
  • Background workers (for processing background tasks like image resize, sending emails, aggregating data, etc.)
  • Operations (not directly part of the product but is essential in daily operations such as Slack WebHooks, CI/CD triggers)

I'd also recommend tools such as serverless-framework to help manage each project.

Upvotes: 3

Related Questions