KPD closed beta Sign inRequest access

6. Service accounts and role bindings

One account for the connector and one for Flink, each with just the access it needs.

Part 6 of 10 in the Hello World tutorial · Follow this part in the guided wizard · Printable version

In Confluent Cloud, connectors and Flink statements run as a service account, and the account's role bindings say what it may read and write. Least privilege means each account gets only what its job needs. KPD records the bindings you choose and writes them into Terraform; it never adds any by itself.

An account for the connector

  1. In the explorer, right-click Environments → Service accounts and choose New service account…
Right-click Service accounts → New service account…
Right-click Service accounts → New service account…
  1. Service account name sa-hwc-cdc; Description Runs the shop database CDC connector. Writes the raw topics and their schemas only.
  2. Under Clusters, tick hwc-prod.
  3. Click Add binding twice and fill the rows:
    RoleScopeClusterResourcePrefix
    DeveloperWriteTopichwc-prodhwc.prod.raw.ticked
    DeveloperWriteSchema subjecthwc-prodhwc.prod.raw.ticked
    Prefix means "every topic (or subject) whose name starts with this", so the connector can write any raw topic and its schema, and nothing else.
  4. Leave Create an API key unticked: connectors and Flink run as the account and need no key. Click Create service account.
The connector’s account: write access to raw topics and their schemas.
The connector’s account: write access to raw topics and their schemas.
  1. Create a second account: sa-hwc-flink, description Runs the three Flink statements. Reads raw and canonical topics, writes canonical and product topics., cluster hwc-prod, and these bindings:
    RoleScopeResourcePrefixWhy
    FlinkDeveloperEnvironment (of the cluster)(the cluster's environment)Run statements in the environment's pools.
    DeveloperReadTopichwc.prod.tickedRead raw and canonical topics.
    DeveloperWriteTopichwc.prod.ent.tickedWrite canonical and product topics.
    DeveloperReadSchema subjecthwc.prod.tickedRead their schemas.
    DeveloperWriteSchema subjecthwc.prod.ent.tickedRegister product schemas.
The Flink account. What do the roles allow? explains each role.
The Flink account. What do the roles allow? explains each role.

Say which asset runs as which account

  1. Click the connector hwc-shopdb-cdc. On General, set Service account to sa-hwc-cdc.
  2. Click each of the three Flink statements and set Service account to sa-hwc-flink. The hint under it lists the roles the account has.
orders_raw_to_cdm runs as sa-hwc-flink.
orders_raw_to_cdm runs as sa-hwc-flink.
Both accounts in the explorer, with their number of bindings.
Both accounts in the explorer, with their number of bindings.
Missed something?You don't have to get access perfect now. In Part 8, Terraform's permission advice compares what each asset reads and writes with its bindings, and offers what is missing for you to tick.

Save. Next: 7. Data quality and dead letter topics.