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
Allow boolean environment variables #8311
Comments
@danilofuchs Thanks for report. We have PR that provides that is welcome! |
How do I get started with this? @medikoo |
Perhaps a more general Maybe limit it to booleans and numbers at first |
Please point me to the file that should be worked on |
Hey guys, can we simply add an expected type to the lambda variable in awsProvider.js?
I will submit a pull request with the above changes if you think this solves the problem. I apologize if this was a naive solution, this is my first contribution. |
@oviecodes @danilofuchs after giving this a bit more thought I decided that it'll probably be good to simply coerce given values where possible. AJV schema validation engine which we use to validate input configuration, has such functionality built in. I've proposed a PR that enables that: #8319 As a side comment, in my experience, best way to propagate boolean values in env vars is simply via existence check (if To adapt in your case to that, you may probably define |
I ran into this issue and made a simple Edit: reading from |
Use case description
Currently, Serverless only allows string values as environment variables. This is completely acceptable, as envs can only be strings.
My use case is the following:
true
is boolean, so when validating, serverless will raise the warning:But, during runtime,
XRAY_ENABLED
will be"true"
(string).I cannot use
lambda: "true"
as the field expects a boolean.Proposed solution
Serverless should allow usage of boolean values on environment variables with no warnings about unsupported configuration, as it is clearly supported (it converted to string after all)
I understand I could look into some weird workarounds using the
custom
field, but I feel it would be hard to understand in the future.The text was updated successfully, but these errors were encountered: