Skip to content

Plugins not functioning when plugins included using ${file} #7203

@benjaminsims

Description

@benjaminsims

Bug Report

Description

I'm attempting to load a list of plugins from an external file, in order to maintain a generic list across several similar microservices.

When doing sls deploy, the plugins will be triggered when in the serverless.yml file; they will not if included using the ${file()) syntax.

With serverless-stage-manager installed:

service: test
provider: aws
custom:
  stages:
    - dev
functions:
  test:
    handler: test.py
    events:
      - http:
          path: /test/
          method: get
# This will work 
plugins:
  - serverless-stage-manager
# This will not
# plugins: ${file(./plugins.yml):plugins}

plugins.yml:

plugins:
  - serverless-stage-manager

Running:

sls package --stage doesnotexist

will trigger an error message with the first plugins config, but not the second.

I have compared the serverless-state.json file for the two cases and the plugins section is identical, which seems to suggest the config itself is correct.

This also occurs with serverless-python-requirements so it is not plugin-specific.

Serverless versions:

Framework Core: 1.60.1
Plugin: 3.2.6
SDK: 2.2.1
Components Core: 1.1.2
Components CLI: 1.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions