Skip to content

Fix variable usage in TF Pipeline Templates

What does this MR do and why?

The current template doesn't work without modifications. The YAML Variables don't support the bash-like variable value fallback with the ${variable:-fallbackValue} syntax.

This leads to TF_STATE_NAME being empty. When the TF_STATE_NAME variable is empty, the gitlab-terraform script doesn't know where it's backend is.

In this MR, I'm changing the value to the fallback value of default, assuming that anyone who includes this template has either TF_STATE_NAME or TF_ADDRESS set in a way which overrides this variable (because if they don't, the template doesn't even work)

On the Community Discord, we were searching pretty long (more than an hour) for the reason why the usage of this template was failing until we noticed the wrong definition of the TF_STATE_NAME variable.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports