Connectors

Connect Google Cloud

One paste into Cloud Shell. Your connector finds the service account itself. No keys.

Your connector runs the actions you allow or approve in your Google Cloud project by acting as a service account you create (the method Datadog uses). Your agents never hold Google credentials, no key is created or stored, Tracehold's cloud cannot act in your project, and nothing is pasted into Tracehold: the connector finds the service account, tests it, and reports the project.

With the Cloud Run installer: nothing to do#

The connector's installer on Google Cloud (Connectors → Add connector → Google Cloud) creates tracehold-agent too. When the connector starts, Connectors shows the project under Accounts your connector acts in. The rest of this page is for a connector running anywhere else.

Before you start#

  • A connector that acts in Google Cloud: running with a Google service account of its own (Cloud Run, GKE, or GOOGLE_APPLICATION_CREDENTIALS), with TRACEHOLD_CONNECTOR_CLOUDS including gcp. Connectors shows its Google identity once it calls in.
  • Sign in to the Google Cloud console as someone who can create service accounts and grant roles on the project (for example Owner).

Connect#

Open Connectors in Tracehold and scroll to Accounts your connector acts in.

  1. Create the service account

    Click Open Google Cloud Shell. Pick the project at the top of the console, paste the script shown into the Cloud Shell panel and press Enter. It creates tracehold-agent and lets your connector act as it.

  2. Your connector finds it

    The connector looks for tracehold-agent in its own project every minute; click Check now to have it look straight away. It acts as the service account once and reads it back; nothing is recorded unless that works.

The connector looks in GOOGLE_CLOUD_PROJECT if it is set where it runs, and otherwise in the project its own service account belongs to. For a service account in another project, set TRACEHOLD_CONNECTOR_GCP_SERVICE_ACCOUNT where the connector runs.

Permissions#

OptionThe service account can
Editor (default)Read and write in the project (roles/editor)
ViewerRead only (roles/viewer). Google refuses writes, even approved ones.

Each call gets a token that lasts at most 15 minutes. Compute Engine instance and Cloud Storage object calls carry that API's scope; other actions currently get a read-only scope, so Google refuses their writes. Google's scopes are coarse, so within an API the role decides what the token can do.

What gets created#

One service account, tracehold-agent, with the role you chose on the project, and one grant that lets your connector's Google identity act as it (roles/iam.serviceAccountTokenCreator, on that service account only). Its description names your Tracehold organization, which the connector checks.

Remove it#

Delete the tracehold-agent service account under IAM & Admin → Service accounts. Nothing can then run in the project.

If something goes wrong#

Connectors shows what each connector found, or why it found nothing:

What you seeWhat to do
"Add a connector with an identity in Google Cloud first"Start a connector with a Google service account and TRACEHOLD_CONNECTOR_CLOUDS including gcp.
"Your connector may not act as this service account"If you just ran the script, wait a minute (Google applies new permissions within a few minutes) and check again. Otherwise run the script again in the right project.
"not set up for this Tracehold organization"Run the script from the Connectors page; it sets the description.
"Pick a project first" in Cloud ShellChoose a project at the top of the console, or run gcloud config set project PROJECT_ID, then paste again.

Google Cloud has been tested against Google's API definitions with simulated responses, not yet against a live project.