Skip to content

Can't use an equals sign "=" in a serverless.yml variable default #5136

@jacobevans

Description

@jacobevans

This is a Bug Report

Description

When using ${var, default} syntax, if the default is a string with an "=" in it, the whole ${} construct will just be returned literally.

For example (this is in env variable section, for ease of demonstration) but it seems to apply anywhere)
serverless.yml:

provider: 
  environment:
    TEST1: ${self:does_not_exist, "This_is_fine"}
    TEST2: ${self:does_not_exist, "this=not_fine"}

shell:

$ sls package -s dev
$ cat .serverless/cloudformation-template-update-stack.json  | grep TEST
        "TEST1": "This_is_fine",
        "TEST2": "${self:does_not_exist, \"this=not_fine\"}",

I would expect TEST2 to have a value of this=not_fine

Additional Data

  • Serverless 1.28.0
  • Mac OSX

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions