Requirements¶
Infrastructure¶
- CI/CD Pipeline (for automated deployment)
- Azure DevOps, GitHub Actions, or similar
- See example pipelines in
docs/example-pipelines/ - Build service needs read access to git repository for change tracking
- Git Repository
- Stores database metadata and functional role configuration
- Uses git tags for change tracking between deployments
- Python Environment
- Python 3.11 or higher
- Package dependencies managed via pyproject.toml
Snowflake Technical User¶
A Snowflake technical/service user with appropriate privileges is required for deployment:
Required Privileges¶
- Role Management
-
CREATE ROLE ON ACCOUNT- To create new roles -
Grant Management (choose one approach)
- Option A:
MANAGE GRANTS ON ACCOUNT- Allows granting any privilege -
Option B: Ownership on all managed databases and schemas
-
Metadata Access (choose one approach)
- Option A:
SYSADMINrole - Full access to all objects -
Option B: Minimal access -
USAGE ON DATABASE,USAGE ON SCHEMA,SELECTon at least one table per schema -
Warehouse Access
USAGEprivilege on a warehouse (XS size is sufficient)
Connection Configuration¶
The deployer uses the cloe_util_snowflake_connector package for Snowflake connections. This connector supports both password-based and key pair authentication.
Required Environment Variables:
CLOE_SNOWFLAKE_USER- Technical user nameCLOE_SNOWFLAKE_ACCOUNT- Account identifier (e.g.,mycompany.west-europe.azure)CLOE_SNOWFLAKE_WAREHOUSE- Warehouse for executing DDL statements
Authentication (choose one method):
CLOE_SNOWFLAKE_PASSWORD- Password authentication (simpler, but being deprecated by Snowflake)CLOE_SNOWFLAKE_PRIVATE_KEYorCLOE_SNOWFLAKE_PRIVATE_KEY_FILE- Key pair authentication (recommended for production)
Optional:
CLOE_SNOWFLAKE_ROLE- Role to use; defaults to user's default roleCLOE_SNOWFLAKE_DATABASE- Default database contextCLOE_SNOWFLAKE_SCHEMA- Default schema context
Note: For detailed connector documentation including key pair authentication setup, see the
cloe_util_snowflake_connectorpackage documentation.
Permissions example¶
USE ROLE SECURITYADMIN;
CREATE USER U_T_CLOE_PERMISSIONS WITH PASSWORD = '';
CREATE ROLE R_T_CLOE_PERMISSIONS;
GRANT ROLE R_T_CLOE_PERMISSIONS TO ROLE ACCOUNTADMIN;
GRANT ROLE R_T_CLOE_PERMISSIONS TO USER U_T_CLOE_PERMISSIONS;
GRANT MANAGE GRANTS ON ACCOUNT TO ROLE R_T_CLOE_PERMISSIONS;
GRANT CREATE ROLE ON ACCOUNT TO ROLE R_T_CLOE_PERMISSIONS;
GRANT ROLE SYSADMIN TO ROLE R_T_CLOE_PERMISSIONS;
USE ROLE SYSADMIN;
CREATE WAREHOUSE WH_CLOE_PERMISSIONS WITH WAREHOUSE_SIZE=XSMALL INITIALLY_SUSPENDED=TRUE;
GRANT USAGE ON WAREHOUSE WH_CLOE_PERMISSIONS TO ROLE R_T_CLOE_PERMISSIONS;