Deploy a project composed by several stacks

My project is composed by the following stacks defined through serverless framework:

  • tables.yml # DynamoDB tables stack
  • userpools.yml # Cognito UserPools stack
  • identitypools.yml # Cognito IdentityPools stack
  • apigateway.yml # ApiGateway stack
  • domain.yml # Route53 stack
  • buckets.yml # S3 buckets stack
  • foo.yml # Foo API stack
  • bar.yml # Bar API stack

Some of these stacks depend on other stack, for example foo and bar stack need apigateway (Fn:Import on RestApiId) and userpool stack (Fn:Import on cognito authorizer).

I decided to split my project in several stack to increase maintenability and I think to be in a right way but I would understand what should be a nice solution to perform in easily way a complete deploy to upload all stacks in respect of all dependencies.

I thought about nested stack as root stack, could be a solution?

Take a look at the tutorial at Serverless-stack
If you can put all your services into a mono-repo, it walks you through setting up the deployment accounting for cross-service dependencies using Seed.run

I’m in the process of migrating all or legacy service repos into a mono-repo for this specific reason.

1 Like

Thanks for response. I’ll try to use Seed, it seems very powerful.