Default Credentials
You can
configure the pipeline to use Google Cloud default credentials. When using
Google Cloud default credentials, Transformer checks for the credentials file defined in the GOOGLE_APPLICATION_CREDENTIALS
environment variable.
If the environment variable doesn't exist and Transformer is running on a virtual machine (VM) in Google Cloud Platform (GCP), the stage uses the built-in service account associated with the virtual machine instance.
For more information about the default credentials, see Finding credentials automatically in the Google Cloud documentation.
Complete the following steps to define the credentials file in the environment variable:- Use the Google Cloud Platform Console or the
gcloud
command-line tool to create a Google service account and have your application use it for API access.For example, to use the command line tool, run the following commands:gcloud iam service-accounts create my-account gcloud iam service-accounts keys create key.json --iam-account=my-account@my-project.iam.gserviceaccount.com
- Store the generated credentials file in a local directory external to the Transformer installation directory. For example, if you installed Transformer in the following directory:
you might store the credentials file at:/opt/transformer/
/opt/transformer-credentials
- Add the
GOOGLE_APPLICATION_CREDENTIALS
environment variable to the appropriate file and point it to the credentials file.Modify environment variables using the method required by your installation type.
Set the environment variable as follows:
export GOOGLE_APPLICATION_CREDENTIALS="/var/lib/transformer-resources/keyfile.json"
- Restart Transformer to enable the changes.
- On the Dataproc tab, for the Credential Provider property, select Default Credentials Provider.