1. Docs
  2. Secrets & Configuration
  3. Environments
  4. Environment Definition Syntax
  5. Reserved Properties
  6. environmentVariables

environmentVariables

    The environmentVariables reserved property contains values that should be exported as environment variables. For example, esc run exports each key-value pair in the environmentVariables property as an environment variable that is accessible to the command to run.

    This property is also used by Pulumi policy packs. When an ESC environment is attached to a policy pack in a policy group, environmentVariables are injected into the policy runtime as environment variables.

    Properties

    PropertyTypeDescription
    namestringThe value of the environment variable name

    Example

    values:
      environmentVariables:
        GREETING: Hello
    

    Evaluated result

    {
      "environmentVariables": {
        "GREETING": "Hello"
      }
    }
    

    Using esc run

    $ esc run default/greet -- sh -c '${GREETING}, ${USER}!'
    Hello, user!