-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to define a default value for undefined parameters #6
base: main
Are you sure you want to change the base?
Conversation
* Mock a custom SSM client to return a result with InvalidParameters
Thanks for the PR! I'm afraid this is extra logic to maintain, and the feature doesn't have great DX (creating a special syntax) 🤔 What is the use case for you? Where have you seen that need? |
As serverless allows to set default values on variables, I already have some variables that have a default value when it's not present on the For example, these are my current serverless.yml provider:
environment:
DB_HOST: ${env:SLS_DB_HOST}
DB_DATABASE: ${env:SLS_DB_DATABASE, self:custom.UUID}
DB_USERNAME: ${env:SLS_DB_USERNAME, self:custom.UUID}
DB_PASSWORD: ${env:SLS_DB_PASSWORD}
custom:
UUID: ${self:service}-${self:provider.stage} The I want to update those values to serverless.yml provider:
environment:
DB_HOST: bref-ssm:/${param:UUID}/DB_HOST
DB_PORT: bref-ssm:/${param:UUID}/DB_PORT,3306
DB_DATABASE: bref-ssm:/${param:UUID}/DB_DATABASE,${self:custom.UUID}
DB_USERNAME: bref-ssm:/${param:UUID}/DB_USERNAME,${self:custom.UUID}
DB_PASSWORD: bref-ssm:/${param:UUID}/DB_PASSWORD
custom:
UUID: ${self:service}-${self:provider.stage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the solution, it worked for me in my project !!
Hello!
I'm thinking about the possibility to define a default value for parameters that don't exist on SSM.
Just have one question:
What character we could define as separator for the parameter name and the default value?
Since the name can't have the colon symbol in it, you think that it could be the separator @mnapoli?