Files
teleport/docs/pages/includes/database-access/cloudsql_service_credentials.mdx
T
mica e17b120b52 docs: refactor Spanner DB guide (#65118)
* initial draft refactor of Spanner db guide

* heading and formatting changes

* updated examples per variable linter warning

* post-feedback: intro for service account section, formatting

* fixing var entries for linter

* casing issue for linter

* codex issues - db service account description and typo

* changing grep statement to find token role for service act

* moved images to strapi, + some clarification changes

* moved cloudsql db images to strapi, removed images from github

* review edits for consistency and clarity

* cleaning up the troubleshooting section

* cleaning up the troubleshooting section

* restore troubleshooting include

* updating the query to find service account and role

* post-feedback from Gavin
2026-04-28 08:57:52 +00:00

36 lines
1.6 KiB
Plaintext

The Teleport Database Service must have credentials for the
"{{ serviceAccount }}" GCP service account.
If the Teleport Database Service is hosted on a GCE instance, you can
[change the attached service account](https://cloud.google.com/compute/docs/instances/change-service-account).
For non-GCE deployments of Teleport, we recommend using
[workload identity](https://cloud.google.com/iam/docs/workload-identity-federation).
<details>
<summary>Using service account keys (insecure)</summary>
Alternatively, go to that service account's Keys tab and create a new key:
![Service Account Keys](https://website.goteleport.com/_uploads/service_account_keys_2x_084609a658.png)
Make sure to choose JSON format:
![Service Account New Key](https://website.goteleport.com/_uploads/service_account_new_key_2x_a9873dd5d5.png)
Save the file. Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to
point to the JSON credentials file you downloaded earlier. For example, if you
use `systemd` to start `teleport`, then you should edit the service's
`EnvironmentFile` to include the env var:
```code
$ echo 'GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json' | sudo tee -a /etc/default/teleport
```
<Admonition type="warning">
A service account key can be a security risk - we only describe using a key in
this guide for simplicity.
We do not recommend using service account keys in production.
See [authentication](https://cloud.google.com/docs/authentication#service-accounts)
in the Google Cloud documentation for more information about service account
authentication methods.
</Admonition>
</details>