Quantcast
Channel: Terraform - HashiCorp Discuss
Viewing all articles
Browse latest Browse all 11376

Assign a name of a variable based on another variable

$
0
0

I am looking into an existing pipeline using Gitlab and Terraform.
Basically what it comes down to -
I have a variable passed from the gitlab-ci.yml ( called TF_VAR_x - this is actually generated from a Gitlab CI_COMMIT_TAG variable ) . Is it possible to somehow assign the value of this to a variable name in tfvars? eg if I have something like this in terraform.tfvars -

is it possible to have y be the value of TF_VAR_x somehow?

myname = {
y = “alice”
}

7 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 11376

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>