Select spec version:

Account Resources YAML Reference Beta

Complete reference for defining your Reverse ETL warehouse account resources using YAML configuration files.
Available Plans
  • free
  • growth
  • enterprise

This guide serves as a detailed reference for the CLI project YAML files that contain definitions of your Reverse ETL warehouse account resources.

Overview

An account holds the credentials and connection settings for a data warehouse. A Reverse ETL SQL model does not carry its own credentials — it points at an account through its account_id. Defining accounts in YAML keeps warehouse credentials under the same Git-based workflow as your other CLI resources.

You define accounts by setting kind to account. As with every other resource type, you can store the YAML files anywhere within the project’s root directory or subdirectories.

Account support is experimental.

Enable the accountSupport flag in your CLI configuration (or set RUDDERSTACK_X_ACCOUNT_SUPPORT=true) before applying account resources — without it the account kind is not registered and your specs will fail validation.

Because account specs reference secrets as variables, you also need to enable the enableVarSubstitution flag (RUDDERSTACK_X_ENABLE_VAR_SUBSTITUTION=true) in your CLI configuration.

Account resources

The spec parameter of the YAML file has the following structure:

PropertyTypeDescription
id
Required
StringUnique identifier for the account resource within the project. This parameter must be unique across all account resources, and identifies the account on subsequent applies.
name
Required
StringDisplay name for the account as shown in the RudderStack dashboard.
account_definition_name
Required
StringThe warehouse type this account connects to.

See Supported account definitions for the values you can use.
config
Required
ObjectFlat map of connection settings and credentials for the warehouse. The available keys depend on account_definition_name.
account_definition_name is immutable. Changing it on an existing account fails the apply rather than silently recreating the resource — a warehouse account is a credential, and recreating one would break every Reverse ETL source pointing at it. To move to a different warehouse type, define a new account.

Supported account definitions

Warehouseaccount_definition_name value
Google BigQuerySOURCE_BIGQUERY
PostgreSQLSOURCE_POSTGRES
SnowflakeSOURCE_SNOWFLAKE

BigQuery configuration

The config object for SOURCE_BIGQUERY accepts the following keys:

KeyTypeDescription
project
Required
StringThe Google Cloud project ID that owns the BigQuery dataset.
location
Required
StringThe BigQuery dataset location, for example US or EU.
credentials
Required
StringThe service account key JSON. This is a secret — supply it as a variable reference, never as a literal. See Secret handling.

Although config is a single flat map in YAML, it is split on the way to the API — the secret keys are sent as a write-only credential payload and everything else as plain options. You do not need to model that split yourself.

Example definition

yaml
version: "rudder/v1"
kind: "account"
metadata:
  name: "prod-bq"
spec:
  id: "prod-bq"
  name: "Production BigQuery"
  account_definition_name: "SOURCE_BIGQUERY"
  config:
    project: "acme-analytics-prod"
    location: "US"
    credentials: "{{ .BQ_CREDENTIALS }}"

With a var file (credentials.vars.yaml) alongside it:

yaml
BQ_CREDENTIALS: '{"type":"service_account","project_id":"acme-analytics-prod","private_key":"..."}'

Apply the two together:

bash
rudder-cli apply --location ./project --var-file ./credentials.vars.yaml

PostgreSQL configuration

The config object for SOURCE_POSTGRES accepts the following keys:

KeyTypeDescription
host
Required
StringDatabase host
dbname
Required
StringDatabase name
user
Required
StringDatabase username — this is a plain option, not a secret
port
Required
StringDatabase port — this is a string, not a number, matching the PostgreSQL source form
sslModeStringOne of disable or require. Defaults to disable.
password
Required
StringDatabase password — this is a secret; supply it as a variable reference
yaml
version: "rudder/v1"
kind: "account"
metadata:
  name: "prod-postgres"
spec:
  id: "prod-postgres"
  name: "Production Postgres"
  account_definition_name: "SOURCE_POSTGRES"
  config:
    host: "warehouse.acme.internal"
    dbname: "analytics"
    user: "rudderstack"
    port: "5432"
    sslMode: "require"
    password: "{{ .PG_PASSWORD }}"

Snowflake configuration

The config object for SOURCE_SNOWFLAKE accepts the following keys:

KeyTypeDescription
account
Required
StringSnowflake account identifier.
dbname
Required
StringDatabase name.
warehouse
Required
StringVirtual warehouse to run against.
user
Required
StringLogin name. This is a plain option, not a secret.
roleStringSnowflake role to assume.
authenticationType
Required
StringOne of keyPair or password. Determines which secret key you must supply — see below.
privateKeyStringPEM private key. Secret, required when authenticationType is keyPair.
privateKeyPassphraseStringPassphrase for the private key. Secret, optional, only valid with keyPair.
passwordStringAccount password. Secret, required when authenticationType is password.

authenticationType decides which secret keys are legal. The combination is validated rather than ignoring surplus keys:

  • keyPair accepts only privateKey and privateKeyPassphrase.
  • password accepts only password.

Supplying a secret that does not belong to the selected authentication type — for example, a password alongside authenticationType: keyPair — is rejected, not silently dropped.

yaml
version: "rudder/v1"
kind: "account"
metadata:
  name: "prod-snowflake"
spec:
  id: "prod-snowflake"
  name: "Production Snowflake"
  account_definition_name: "SOURCE_SNOWFLAKE"
  config:
    account: "acme-prod.us-east-1"
    dbname: "ANALYTICS"
    warehouse: "TRANSFORMING"
    user: "RUDDERSTACK"
    role: "RUDDERSTACK_ROLE"
    authenticationType: "keyPair"
    privateKey: "{{ .SF_PRIVATE_KEY }}"
    privateKeyPassphrase: "{{ .SF_PRIVATE_KEY_PASSPHRASE }}"

Secret handling

Secret fields must be written as {{ .VARIABLE_NAME }} references and resolved at apply time from a var file. This keeps the credential out of the spec file you commit.

  • Secrets are never read back. The RudderStack API does not return credential values, so the CLI cannot compare the remote secret against your local one. It therefore re-sends the secret on every apply. A re-apply that reports a change to a secret field is expected behavior, not drift.
  • Secrets never appear in exported specs. When you import an existing account, the credential is written out as a {{ .VAR }} placeholder rather than a value.
  • Keep the var file out of version control. It holds real credentials. Add it to .gitignore.

Import existing accounts

You can bring warehouse accounts created through the dashboard under Git control:

bash
rudder-cli import workspace --location ./project

This scaffolds two things under ./project/imported:

  • accounts/<id>.yaml — one spec per importable account, with every secret field masked to a {{ .VAR }} reference.
  • secrets.vars.yaml — a fill-in-the-blanks var file with one placeholder line per variable the generated specs reference.

Fill in each placeholder with the real credential, then run apply with --var-file to adopt the accounts. Import scaffolds the files; the accounts are claimed on apply, after which they are managed resources and are no longer offered for import.

An unfilled (null) placeholder makes the apply fail loudly rather than silently sending an empty credential. To deliberately send an empty value, set the key to "".

You can list the accounts in your workspace, managed or not, with:

bash
rudder-cli workspace accounts list

See more

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.