Environment Configurations

Environment configurations contain values that can be referenced across stacks. Let’s look at an example:

Company Errors, Inc. has three stacks for their software error aggregation service:

  • Ingest, for ingesting error data from customers
  • Process, for processing errors
  • Frontend, for serving the product’s dashboard

Errors, Inc. also has two environments:

  • Production
  • Staging

Each environment has a set of configuration values. These values can include API keys and environment-specific settings like domain names, which can then be referenced in node settings like Function Environment Variables and Rest Api Domains.

Setting Configuration Store Values

Navigate to the environment manager page to add values to an environment’s configuration store. You can click here to open it directly, or you can navigate to it by clicking Environments in the header bar at the top of the Stackery dashboard. Select an environment from the dropdown on the left or create a new environment. On the right you will see an editor where you can provide configuration values in JSON format. Here’s an example environment with a few values:

Environment Manager With Configuration Store Values

Referencing Configuration Store Values

Environment values can be referenced in node settings by using the value reference syntax: ${config.<key>}. In the example above, the apiKey value is referenced by setting values to ${config.apiKey}. Likewise, the AWS account ID can be referenced using ${config.aws.accountId}. For convenience, configuration value references are provided as options in select boxes and suggested in text box node settings.

Configuration For Domain

Groups of properties may also be referenced. For example, the entire AWS configuration from the example above may be referenced using ${config.aws}. The value will be provided as a JSON string.

Configuration Environment Variable

Try Stackery For Free

Gain control and visibility of your serverless operations from architecture design to application deployment and infrastructure monitoring.