KrysKruk / serverless-import-config-plugin

Split your serverless.yaml config file into smaller modules and import them.
MIT License
10 stars 6 forks source link

Working with sls3? #20

Open digitalkaoz opened 2 years ago

digitalkaoz commented 2 years ago

i dont know how to use this plugin, here is my use case:

the to be imported config:

# sls.provider.go.yml
provider:
  name: aws
  runtime: go1.x
  region: ${opt:region, 'eu-central-1'}
  stage: ${opt:stage, 'int'}
  logRetentionInDays: 90
  memorySize: 256
  lambdaHashingVersion: "20201221"
  timeout: 60
  vpc:
    securityGroupIds: ${self:custom.ENV_CONFIG.SECURITY_GROUP_IDS}
    subnetIds: ${self:custom.ENV_CONFIG.PRIVATE_SUBNET_IDS}
  stackTags: ${self:provider.tags}
  tags:
    PROJECT: 'jhps-dx'
    STACK: '${self:service}'
    REGION: '${self:provider.region}'
    STAGE: '${self:provider.stage}'
# serverless.yml
service: my-service-name

package:
  individually: true

plugins:
  - serverless-import-config-plugin

custom:
  ENV_CONFIG: ${file(serverless.${self:provider.stage}.conf.yml)}
  import:
    - ./sls.provider.go.yml

functions:
# ...

the output is this:

$ serverless deploy --verbose --conceal -s int --region eu-central-1

Environment: darwin, node 17.5.0, framework 3.2.1, plugin 6.0.0, SDK 4.3.1
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Invalid service configuration: "provider.name" property is missing

so how is this plugin supposed to work? reading all the other issues or the docs wasnt helpful et all...

digitalkaoz commented 2 years ago

the much more important question is, why isnt that part of serverless itself?

KrysKruk commented 2 years ago

Hi @digitalkaoz . Thanks for creating the issue. Unfortunately, I stopped using serverless some time ago and I don't have much time now and experience to maintain it. Feel free to port the repo. Sorry, for not giving the best answer.

slatermorgan commented 1 year ago

Anyone found an alternative approach? this is the only thing stopping me from updating to SLS3.

AndrewChubatiuk commented 1 year ago

added support of some of this plugin functionality for SLSv3 in my fork