Terraform : Gitlab environment variable usage

I’m just trying tu use terraform .tf files to code infrastructure.
I’m using protected branches.

I’ve tried succesfully to protect and share variables (GCP for me) to an environment, used in a python script like this:

  stage: deploy
  environment: 0_DEV
  image: google/cloud-sdk
    - echo $GCP_ACCOUNT_KEY > gcloud-service-key.json
    - gcloud auth activate-service-account --key-file gcloud-service-key.json
    - gcloud config set project $GCP_PROJECT_ID
    - gcloud functions deploy hello-world

Now I m trying to do the same with terraform, but i don’t know how I can when running terraform script use the protected variables dedicated to the environment…

Any help is welcome,