Use variables from gitlab to variables file

Hi, I have a bunch of .tf files committed to I set variables in the ci/cd setting and pass them on to my .gitlab-ci.yml as per normal.
In my .gitlab-ci.yml I have the following:

name: hashicorp/terraform:light
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

I also have a file with the following:

variable “cluster-name” {
default = “name_from_gitlab ci”
type = string
description = “The name of your EKS Cluster”

How do I get the variable from the gitlab-ci to terraform “name_from_gitlab ci” variables file?
I have tried to use TF_VAR_AWS_CLUSTER_NAME in the file but it seems you can’t pull a variable from a variable in this file.

Terraform v0.12.21

  • v2.49.0
  • provider.http v1.1.1
  • provider.null v2.1.2
  • provider.random v2.2.1