> ## Documentation Index
> Fetch the complete documentation index at: https://sariva.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Service accounts & up-front keys

> Create the two up-front Confluent Cloud credentials before the wizard — the metrics key and the OrganizationAdmin key — each on its own service account.

This page creates the **two up-front Confluent Cloud credentials** you need before running the setup wizard:

* the **metrics key** — read-only, used by the Sariva platform pod at runtime;
* the **OrganizationAdmin key** — admin, used by GitHub Actions / Terraform.

Each lives on its **own service account**, so the runtime pod never holds admin privileges. Both can be created before any Kafka cluster exists.

## What you need first

* [ ] A Confluent Cloud org with billing enabled
* [ ] Confluent Cloud admin access (an `OrganizationAdmin` user) to create service accounts and assign roles
* [ ] The `confluent` CLI authenticated, or Console access with admin rights

## 1. Metrics service account and key

The Sariva platform reads Confluent Cloud's Metrics API for consumer-lag, throughput, and reachability checks. This requires an org-scoped Cloud API key bound to a service account with the `MetricsViewer` role.

```bash theme={null}
# 1. Create the Sariva metrics service account once per org
confluent iam service-account create sariva-platform-observability \
  --description "Sariva metrics access to Confluent Cloud"
# capture the sa-xxxxx ID

# 2. Grant MetricsViewer at org scope
confluent iam rbac role-binding create \
  --principal "User:<sa-id>" \
  --role MetricsViewer

# 3. Create an org-scoped Cloud API key bound to that service account
confluent api-key create \
  --service-account <sa-id> \
  --resource cloud
# capture the API key + secret; the secret is shown only once
```

Or use the Console: **Administration → API keys → Add key → Granular access** → select or create `sariva-platform-observability` → grant `MetricsViewer` → create the key.

⚠WARNING

Save the API key and secret immediately. You will paste them in as `CC_METRICS_API_KEY` and `CC_METRICS_API_SECRET` — into the generated `setup-secret.sh` on the Kubernetes paths, or the two `.env` lines on the [Linux VM (Docker) path](https://sariva.mintlify.site/deploy/vm-docker-cc.md#5-fill-the-env). The secret value is shown only once by Confluent Cloud.

## 2. Terraform runner service account and OrganizationAdmin key

GitHub Actions / Terraform uses this key to create Confluent Cloud resources — service accounts, API keys, RBAC bindings, environments, and clusters. It belongs to your **customer-owned Terraform runner service account** — a separate identity from the Sariva metrics account, which stays least-privilege. This is the **same runner service account** that later owns each per-cluster admin Kafka key (see [per-cluster credentials](https://sariva.mintlify.site/connecting-clusters/cc-per-cluster-access.md)), so create or select it once here. The docs use the name `sa-terraform-runner` (Confluent's own examples call it `tf_runner`); name it however your organization prefers — do not brand it `sariva-*`.

```bash theme={null}
# 1. Create or select your customer-owned Terraform runner service account
confluent iam service-account create sa-terraform-runner \
  --description "Terraform/CI admin access to Confluent Cloud"
# capture the sa-xxxxx ID

# 2. Grant OrganizationAdmin at org scope
confluent iam rbac role-binding create \
  --principal "User:<sa-id>" \
  --role OrganizationAdmin

# 3. Create an org-scoped Cloud API key owned by that service account
confluent api-key create \
  --service-account <sa-id> \
  --resource cloud
# capture the API key + secret; the secret is shown only once
```

Or use the Console: **Accounts & access → Service accounts** → create or select your Terraform runner account → **Access** tab → add the `OrganizationAdmin` role → then **Add key** → Cloud API key.

⚠WARNING

Save the API key and secret immediately — the secret is shown only once. You store it for CI later, during install setup, as `CONFLUENT_CLOUD_API_KEY` / `CONFLUENT_CLOUD_API_SECRET` — in GitHub Actions secrets or AWS SSM depending on your credential source. See [Confluent Cloud credentials for CI](https://sariva.mintlify.site/install-setup/access-and-state/cc-ci-credentials.md).

ⓘINFO

**Two separate service accounts, two owners.** The metrics account (`sariva-platform-observability`, `MetricsViewer`) is Sariva's low-privilege runtime identity, used by the platform pod. The Terraform runner (`sa-terraform-runner`, `OrganizationAdmin`) is your customer-owned CI identity — the same one that later owns each per-cluster admin Kafka key. They must not be the same account: `OrganizationAdmin` already includes metrics access, so combining them would over-privilege the pod and make `MetricsViewer` redundant.

## What this does not create

This page does **not** create the per-Kafka-cluster admin or observability credentials.

Those come later, after the Kafka cluster exists:

* the **admin Kafka key** is used by GitHub Actions / Terraform;
* the **observability Kafka key** is used by the Sariva platform pod.

Continue later with [Confluent Cloud: per-cluster credentials](https://sariva.mintlify.site/connecting-clusters/cc-per-cluster-access.md) — that is a later step, after the Kafka cluster exists, not the next one.

## Continue the deployment path

> [card] [Next: GitHub repository and token](https://sariva.mintlify.site/prerequisites/github.md)
>
> Create the GitOps repository and the Sariva platform GitHub token.

> [card] [Back to the AWS EKS path](https://sariva.mintlify.site/deploy/aws-eks-cc.md)
>
> Return to the EKS path map to confirm where this step fits.

> [card] [Back to the VM path](https://sariva.mintlify.site/deploy/vm-docker-cc.md)
>
> Running on a Linux VM? Return to the VM checklist.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.