4.6 Practical exercise

Lesson

4.6 Practical exercise

Complete the steps below to configure a connection between Mage and Google Cloud Platform. You can substitute other data warehouses or databases if BigQuery is not a part of your data stack:

  • Upload your GCP service account JSON file to your Mage Pro workspace at /home/src/your-project-name/gcp-service-account.json

  • Configure the file path in your io_config.yml file

  • Add your GCP project ID and location settings

  • Test the connection using a simple BigQuery query

  GOOGLE_SERVICE_ACC_KEY:
    type: service_account
    project_id: project-id
    private_key_id: key-id
    private_key: "-----BEGIN PRIVATE KEY-----\\your_private_key\\n-----END_PRIVATE_KEY"
    client_email: your_service_account_email
    auth_uri: "<https://accounts.google.com/o/oauth2/auth>"
    token_uri: "<https://accounts.google.com/o/oauth2/token>"
    auth_provider_x509_cert_url: "<https://www.googleapis.com/oauth2/v1/certs>"
    client_x509_cert_url: "<https://www.googleapis.com/robot/v1/metadata/x509/your_service_account_email>"
  GOOGLE_SERVICE_ACC_KEY_FILEPATH: "/path/to/your/service/account/key.json"
  GOOGLE_LOCATION: US # Optional