I'm trying to make GitLab pipelines that deploy GCP instances through the GCP terraform provider. Other platforms like AWS have environmental variables like $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY that can be used to authenticate requests, but GCP seems to use service account credential files instead.
I could create a CI gitlab file variable to contain my GCP service account credential file, but I can only add it in an insecure way. If I attempt to mask my file variable under the GitLab ci-cd settings it produces the error message This variable can not be masked.
What is the proper best practice for storing GCP service account credential files in GitLab CI/CD environmental variables?