Skip to content

Snowflake

Snowflake is the core data platform hosting all storage and compute for the roche-data pipeline. It houses the full medallion architecture: physical Bronze tables (append-only), validated Silver views, business-ready Gold views, and the Semantic Layer for Cortex Analyst. Quality gates are embedded as view predicates — no separate DQ engine needed.

PropertyValue
Accountroche_dia.eu-central-1
URLhttps://roche_dia.eu-central-1.snowflakecomputing.com/
Auth method (CI/CD)External OAuth (PingFederate client_credentials grant via WAM)
Auth method (local dev)External Browser SSO (PingFederate)
NetworkCloud (direct — no VPN required)
Access tasksA05, A06
GitHub issue#23
ServiceNow requestRITM6279879
Service accountS1DEINGI (RXPMODE1)
VariableSourceDescription
SNOWFLAKE_ACCOUNTVault common/snowflakeAccount identifier (roche_dia.eu-central-1)
SNOWFLAKE_URLVault {env}/snowflakeFull account URL
SNOWFLAKE_DATABASEVault {env}/snowflakeTarget database (RDT_MODEL)
SNOWFLAKE_WAREHOUSEVault {env}/snowflakeCompute warehouse (RDT_MODEL_WH_DEV / _TEST / _PROD)
SNOWFLAKE_SCHEMA_PREFIXVault {env}/snowflakeSchema prefix (DEV / TEST / PROD)
SNOWFLAKE_ROLEVault {env}/snowflakeExecution role (RDT_MODEL_DEV_DEPLOYER / _TEST_ / _PROD_)
SNOWFLAKE_USERVault {env}/snowflakeService account (S1DEINGI@EMEA.ROCHE.COM)
SNOWFLAKE_USER_PWDVault {env}/snowflakeUser password (for ROPC flow)
SNOWFLAKE_AUTH_METHODVault {env}/snowflakeAuth method (oauth)
SNOWFLAKE_OAUTH_TOKEN_URLVault {env}/snowflakeWAM token endpoint (https://wam.roche.com/as/token.oauth2)
SNOWFLAKE_OAUTH_SCOPEVault {env}/snowflakeOAuth scope (session:role:PUBLIC)
SNOWFLAKE_OAUTH_CLIENT_IDVault {env}/snowflakePingFederate client ID
SNOWFLAKE_OAUTH_CLIENT_SECRETVault {env}/snowflakePingFederate client secret
SNOWFLAKE_WAM_USERNAMEVault {env}/snowflakeWAM username (default: S1DEINGI)

The project uses a split-database strategy:

DatabasePurposeSchemas
MDM_DEVBronze layer (Iceberg tables)RAW_DV_MDM
BUSINESS_MDM_DVSilver/Gold viewsBUSINESS_DV_MDM, DP_MDM
LayerSchemaContent
Bronze{PREFIX}_BRONZE or RAW_DV_MDMIceberg append-only tables (open format, S3-backed)
Silver{PREFIX}_SILVER or BUSINESS_DV_MDMValidated views (G2 predicates)
Gold{PREFIX}_GOLD or DP_MDMBusiness-ready views (G3+G4 predicates)
Semantic{PREFIX}_SEMANTICSemantic view definitions for Cortex Analyst
ModuleUsage
rdt-model-storeGenerates DDL, dbt models, and deploys across all layers
rdt-model-snowflake-horizonRegisters data products in Snowflake Horizon for cross-account discovery
rdt-model-profileDiscovers upstream tables for onboarding entities without RTiS representation

Script: scripts/access/check-snowflake.sh

Required tools: snowsql, curl, jq

Required env vars: SNOWFLAKE_ACCOUNT, SNOWFLAKE_USER, SNOWFLAKE_USER_PWD, SNOWFLAKE_OAUTH_CLIENT_ID, SNOWFLAKE_OAUTH_CLIENT_SECRET, SNOWFLAKE_ROLE

Checks performed:

  1. OAuth token acquisition via WAM (ROPC grant with role scoping)
  2. Snowflake connection verification (SELECT CURRENT_USER(), CURRENT_ROLE(), CURRENT_WAREHOUSE())
  3. Database visibility: MDM_DEV, MDM_TEST, MDM_PROD
  4. Schema access in MDM_DEV: RAW_DV_MDM, BUSINESS_DV_MDM, DP_MDM
  5. DDL permissions (CREATE ICEBERG TABLE, CREATE VIEW on MDM_DEV.RAW_DV_MDM)

Token acquisition via WAM Resource Owner Password Credentials (ROPC) grant:

Terminal window
TOKEN=$(curl -s -X POST "https://wam.roche.com/as/token.oauth2" \
-d "grant_type=password" \
-d "client_id=$SNOWFLAKE_OAUTH_CLIENT_ID" \
-d "client_secret=$SNOWFLAKE_OAUTH_CLIENT_SECRET" \
-d "username=$SNOWFLAKE_WAM_USERNAME" \
-d "password=$SNOWFLAKE_USER_PWD" \
-d "scope=session:role:PUBLIC" \
| jq -r '.access_token')

Local Development — External Browser SSO

Section titled “Local Development — External Browser SSO”

For interactive development, use External Browser authentication (STREITS user):

Terminal window
snowsql --accountname roche_dia.eu-central-1 \
--authenticator externalbrowser \
--username YOUR_EMAIL@roche.com

Key-pair Authentication (planned for CI/CD)

Section titled “Key-pair Authentication (planned for CI/CD)”

RSA key-pair auth (S1DEINGI) is the planned long-term approach for CI/CD. PAT (Programmatic Access Tokens) are not approved at Roche.

ArtifactOutput pathLayer
Bronze DDLsnowflake/ddl/{entity}.sqlBronze
Bronze COPY INTOsnowflake/copy_into/{entity}.sqlBronze
dbt Bronze modeldbt/models/bronze/{entity}.sql + .ymlBronze
dbt Silver viewdbt/models/silver/{entity}_silver.sql + .ymlSilver
dbt Gold viewdbt/models/gold/{entity}_gold.sql + .ymlGold
Semantic viewdbt/models/semantic/{entity}.semantic.ymlSemantic
  • Authentication: OAuth token acquisition confirmed working (2026-04-29)
  • Database provisioning: Pending (RITM6279879 — requested 2026-04-24)
  • Workaround: All modules generate artifacts in --dry-run mode without Snowflake access
  • Blocking: Database/schema/role provisioning before DDL can be deployed