Injecting GCP Service Account credentials using templates

How I can import a json gcp service account file using templates?

My secret:
“REPOSITORY_TEMPLATE”: “gs:lxsj5esx”,
“RESTIC_PASSWORD”: “password”,
“GOOGLE_PROJECT_ID”: “project_id”,
“GOOGLE_APPLICATION_CREDENTIALS”: “I need to import the json sa key here”

Hi @enmanuelmoreira!

Welcome to the Doppler Community!

Just to make sure I’m understanding you right – you have a secret in Doppler that’s a JSON string similar to what you posted. One of the keys in that JSON string needs to have a value that’s also JSON. Is that right so far?

Are you trying to set this up using project templates? Or is it just the JSON inside JSON bit that’s causing you problems?


Hi @watsonian

Thank you for your reply. The thing is that the secret is in Doppler, I need to parse a Google Cloud credential into the variable GOOGLE_APPLICATION_CREDENTIALS, including scapes. I don’t know how I archive this.

I figured out to create another secret in the Doppler CLI referencing the value that I need with ${GOOGLE_APPLICATION_CREDENTIALS} variable.

Ah, I see! Yep, in that case storing the credentials in a separate secret and then using secret referencing would certainly work! Glad you were able to get something working for you!