# Terra Platform Profile

## Overview

[Terra](https://terra.bio/) is the Broad Institute's cloud-native platform for biomedical research, built on Google Cloud. It provides WES/TES workflow execution, DRS data access, and TRS tool discovery.

## Supported GA4GH Specs

| Spec | Support | Notes |
|------|---------|-------|
| DRS v1.4 | Full | Via Terra Data Repository (TDR) |
| WES v1.1 | Full | Cromwell workflow execution |
| TRS v2.0.1 | Full | Dockstore integration |
| Passports v1 | Full | OAuth2 via Google identity |
| Data Connect v1 | Partial | Via TDR snapshot queries |

## Configuration

```toml
# profiles/terra.toml
[platform]
name = "terra"
display_name = "Terra (Broad Institute)"
base_url = "https://firecloud-orchestration.dsde-prod.broadinstitute.org"

[auth]
method = "oauth2"
# Uses Google OAuth2 - authenticate via gcloud CLI
# gcloud auth application-default login

[drs]
enabled = true
base_url = "https://drshub.dsde-prod.broadinstitute.org"

[wes]
enabled = true
base_url = "https://cromwell.dsde-prod.broadinstitute.org"

[trs]
enabled = true
base_url = "https://dockstore.org/api"
```

## Quick Start

```python
from ai4gh.specs.wes.client import WESClient

async with WESClient(
    base_url="https://cromwell.dsde-prod.broadinstitute.org",
) as client:
    info = await client.get_service_info()
    print(f"Engine: {info.workflow_engine_versions}")
```

## Authentication

Terra uses Google OAuth2:

1. Install the [gcloud CLI](https://cloud.google.com/sdk/docs/install)
2. Run `gcloud auth application-default login`
3. The SDK picks up credentials automatically

```bash
gcloud auth application-default login
```

## Compliance Testing

```bash
ai4gh test wes https://cromwell.dsde-prod.broadinstitute.org
ai4gh test drs https://drshub.dsde-prod.broadinstitute.org
```
