compose icon indicating copy to clipboard operation
compose copied to clipboard

Ability to point directly to serverless.yml config files in the same folder

Open arondeparon opened this issue 3 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched existing issues, it hasn't been reported yet

Use case description

I don't really work on monorepos with lots of services, but I do like to split my deployments into several pieces (serverless-vpc.yml, serverless-rds.yml, serverless-backend.yml, etc...).

Currently, I keep these files in the root folder and deploy them individually.

I tried adding these files to serverless-compose.yml but it seems that this is not possible because they don't live in subfolders.

Is there some way to do this already?

Proposed solution (optional)

No response

arondeparon avatar Aug 18 '22 20:08 arondeparon

Hi Aron, this is indeed not supported for the same reason as for multi-region deployments. You can find a low-level explanation here: https://www.serverless.com/framework/docs/guides/compose#faq

mnapoli avatar Aug 19 '22 11:08 mnapoli

I have done multi-region by having separate folders. You would obviously need to have your serverless.yml file in both folders:

/baseInfrastructure-E2

  • serverless.yml

/baseInfrastructure-W2

  • serverless.yml

In the serverless.yml file, just need to specify the correct region.

stephenbawks avatar Nov 07 '22 20:11 stephenbawks

Same need here, and actually config is not really supported is it? 🤔

services:
  backend-lambdas:
    path: ${sls:stage}-lambdas
    config: serverless-lambdas.yml
  backend-appsync:
    path: ${sls:stage}-appsync
    config: serverless-appsync.yml
    params:
      lambdaNamePrefix: ${backend-lambdas.lambdaNamePrefix}


Error:
The "--config" option is not supported (yet) in Serverless Framework Compose
You can search and/or open feature requests here: https://github.com/serverless/compose'

Hideman85 avatar Mar 24 '23 14:03 Hideman85