# GCP

GCP connections enable integration with Google Cloud Platform for health checks, configuration scraping, and playbook automation.

## Used By[​](#used-by "Direct link to Used By")

* [GCP Config Scraper](/docs/guide/config-db/scrapers/gcp.md) - Scrape GCP resource configurations
* [GCS Folder Check](/docs/reference/canary-checker/.md) - Check Cloud Storage buckets
* [Playbook Actions](/docs/guide/playbooks/actions/.md) - Execute GCP-related automation

| Field           | Description                                                      | Scheme                                        |
| --------------- | ---------------------------------------------------------------- | --------------------------------------------- |
| `connection`    | The connection url to use, mutually exclusive with `credentials` | [Connection](/docs/reference/connections/.md) |
| `credentials`   | The credentials to use for authentication                        | [EnvVar](/docs/reference/env-var.md)          |
| `endpoint`      | Custom GCP Endpoint to use                                       | `string`                                      |
| `skipTLSVerify` | Skip TLS verification when connecting to GCP                     | `boolean`                                     |

## Authentication Methods[​](#authentication-methods "Direct link to Authentication Methods")

1GKE Workload Identity

Use GKE [workload identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity). This is the default when no `connection` or `credentials` is specified and the recommended approach for workloads running on GKE.

2Connection Reference

Reference a shared connection:

```
using-connection.yaml
apiVersion: canaries.flanksource.com/v1

kind: Canary

metadata:

  name: gcs-check

spec:

  interval: 60

  folder:

    - name: GCS Backup Check

      path: gcs://my-bucket

      gcpConnection:

        connection: connection://gcp/production
```

3Inline Credentials

Specify service account credentials directly:

```
inline-credentials.yaml
apiVersion: canaries.flanksource.com/v1

kind: Canary

metadata:

  name: gcs-check

spec:

  interval: 60

  folder:

    - name: GCS Backup Check

      path: gcs://my-bucket

      gcpConnection:

        credentials:

          valueFrom:

            secretKeyRef:

              name: gcp-credentials

              key: service-account.json
```

## Examples[​](#examples "Direct link to Examples")

Service Account Connection

Create a GCP connection with service account:

```
gcp-connection.yaml
apiVersion: mission-control.flanksource.com/v1

kind: Connection

metadata:

  name: gcp-production

  namespace: default

spec:

  gcp:

    credentials:

      valueFrom:

        secretKeyRef:

          name: gcp-credentials

          key: service-account.json
```

With Project ID

Include project for resource access:

```
gcp-with-project.yaml
apiVersion: mission-control.flanksource.com/v1

kind: Connection

metadata:

  name: gcp-project

spec:

  gcp:

    project: my-gcp-project

    credentials:

      valueFrom:

        secretKeyRef:

          name: gcp-credentials

          key: service-account.json
```
