New Build Environment Variable Precedence

No worries at all @matbaker!

Looks like on that former picture - you’ve found the default way that the UI sets new pipelines to be created in :slight_smile: (its Legacy Steps by default, but you can change the default behaviour for new pipelines to use the YAML editor in your organizations settings page).

Me and my immediate team are actually maintainers of the Terraform Provider - happy that you’re using such a tool for managing your Buildkite infrastructure (in this case pipelines). The underlying pipeline creation/update calls do use YAML steps as you’ve found out (the actual input for said mutations expects YAML step input).

As for the original ask - given that you’ve set step level environment variable (ENVIRONMENTS) - that should be the variable that is set through to your builds: as the provider will just set the actual config and leave it there. Correcting what I mentioned before - the deeper level the variable is set in, the higher precedent it is placed. If you have both Options»Environment Variables (calling this the Build popup) and set in pipeline YAML, the former will take precedence. If the variable was defined in all 3 layers (Build popup and on both pipeline/step level in YAML) - it is the step variable that will override the former two.

Hope that clears it up!