Skip to main content

Global Environment Variables in atmos.yaml

· One min read
Erik Osterman
Founder @ Cloud Posse

Atmos now supports a global env section in atmos.yaml that applies environment variables to all subprocesses spawned by Atmos, including Terraform, Helmfile, Packer, workflows, and custom commands.

What's New​

You can now define environment variables at the root level of your atmos.yaml configuration:

# atmos.yaml
env:
AWS_DEFAULT_REGION: "us-east-1"
TF_PLUGIN_CACHE_DIR: "/path/to/cache"
MY_CUSTOM_VAR: "value"

These variables are automatically injected into every subprocess that Atmos spawns, providing a single place to configure environment-wide settings.

Precedence​

Global env variables have the lowest priority and can be overridden at any level:

  1. atmos.yaml global env: section (lowest priority)
  2. Stack manifest global env: section
  3. Component-type env (terraform.env/helmfile.env)
  4. Component env: section
  5. Component overrides.env: section (highest priority)

Visibility​

The global env section is visible via atmos describe config:

atmos describe config | grep -A5 '"env"'

Use Cases​

  • Set default AWS regions across all operations
  • Configure Terraform plugin cache directories
  • Define organization-wide proxy settings
  • Set logging or debugging flags for all tools

For usage and configuration, see Environment Variables.