title: How to concatenate variables in another one in .gitlab-ci.yml?
body: <p>I've set some variables in my &quot;Project -&gt; Settings -&gt; CI/CD -&gt; Variables&quot;, and I want to use them to define my Terraform state file name:</p>
  <p>Variables:</p>
  <ul>
  <li>PROJECT_NAME ('myproject')</li>
  <li>ENVIRONMENT ('dev')</li>
  </ul>
  <p>In my .gitlab-ci.yml:</p>
  <pre><code>variables:
    TF_ROOT: ${CI_PROJECT_DIR}/
    TF_STATE_NAME: ${PROJECT_NAME}_${ENVIRONMENT}
  </code></pre>
  <p>The problem is that when my state file is created during the pipeline execution, the variables values are not replaced in the file name, and it looks like this:</p>
  <pre><code>mygroup_${PROJECT_NAME}_${ENVIRONMENT}
  </code></pre>
  <p>Instead of what I expected:</p>
  <pre><code>mygroup_myproject_dev
  </code></pre>
  <p>The idea here is to <strong>have a different state file for each environment</strong>.</p>