Gitlab CI — extract environment variables from terraform definition variables
Gitlab offers multiple ways to define environment variables to be used in your cicd pipelines.
One of hight interest is the project variables, where you can define environment variables as a File.
That is useful for instance when we store Terraform variables definition (*.tfvars) with the gitlab project environment variables as a whole File.
Terraform variable definition is mainly composed of key=”value” list, as follow :