Darshu Bc
Darshu Bc

Reputation: 546

Prod grade Directory Structure for AWS serverless applications

I am trying to figure out what can be the best project directory structure for a serverless application developed using aws also to mention I am using serverless framework. Directory structure I am looking for is a monorepo of multiple micro-services. It should be optimized to accomodate layers, code re-usability, accommodate backend & frontend code, easy to deploy each service individually, should accommodate testing framework so that app is tested in the ci-cd pipeline.

Upvotes: 1

Views: 264

Answers (1)

Aaron Stuyvenberg
Aaron Stuyvenberg

Reputation: 3787

There's no one best directory structure. In general what I'd recommend is:

  • One serverless.yml file per service.
  • Your service should encapsulate one domain and one domain only (like Users, Organizations, Events, etc).
  • Shared infrastructure (like sns topics, event bridge, authenticators, etc) should be separate (in another serverless.yml file or managed by something like terraform, pulumi, etc)

Beyond that, you can read more of my thoughts on serverless at (team) scale and on setting up your project so you can develop against the cloud

Upvotes: 1

Related Questions