Since serverless functions ultimately resolve into system-level processes, they can read environment variables visible to their runtime. Combined with the ability to specify their values at configuration level, this can be handy in cases where:
Additionally, different components may introduce their own variables into your project (usually at project scope), which should generally be left untouched.
Click the (x) button on the toolbar to open the Environment Variables configuration pop-up:
Click the (+) Add Variable button (below the last variable entry) to add a new entry.
Configure your variables as desired:
When done, click Save.
If any of the variable values are missing, Sigma will prompt you to provide them by automatically opening the environment variables pop-up when starting a project deployment (usually, right after the build stage completes).
Sigma allows you to define environment variables on a global (visible to all functions) or per-function basis. If the same variable (key) is defined at both global and per-function levels, the latter will take precedence.
In order to provide project portability while preventing the leaking of user-specific configurations, Sigma saves only the keys (names) of environment variables into source control. If you close and reopen a Sigma project, except for a few IDE-managed variables, you will have to re-enter the values for any variables that you had defined previously.
Alternatively you can explicitly mark the variables that you do need to save into source control, in order to make them available as part of the project itself, by toggling the Persist switch against each variable.
You can modify a variable by making appropriate changes on the corresponding entry on the environment variables pop-up, and clicking Save.
Similarly, you can delete a variable by clicking the cross button against the entry, and saving the configuration.