Configuration
Environment Configuration Overview
Once installed, additional environment configuration can be set up using environment specific yaml files.
In the base folder of the database config (base working directory), create a yml file for each environment.
For example:
deploy_config_dev.yml deploy_config_prod.yml
Referencing a Config File
There are 2 ways to tell Snowflake Deployer which config file to use during execution.
Option 1 - Command Line Parameter
Use the -c parameter when calling
snowflake-deployer deploy -c "deploy_config_dev.yml"
Option 2 - Environment Var
Use the environment variable DEPLOY_CONFIG_PATH.
export DEPLOY_CONFIG_PATH="deploy_config_dev.yml"
Usage - If both the command line parameter AND environment variable are set, execution will use the command line parameter.
Supported Config Parameters
Parameter |
Description |
|---|---|
ENV_DATABASE_PREFIX |
(String) Database Prefix within environment
|
ENV_WAREHOUSE_PREFIX |
(String) Warehoue Prefix within environment
|
ENV_ROLE_PREFIX |
(String) Role Prefix within environment
|
ENV_PROCEDURE_PREFIX |
(String) Procedure Prefix within environment
|
ENV_FUNCTION_PREFIX |
(String) Function Prefix within environment
|
OBJECT_METADATA_ONLY |
(Boolean) Flag to support the creation of Tables & Views or only the metadata.
|
MAX_THREADS |
(Int) Number of threads the deployer will process in parrellel during deployment. Balance Snowflake warehouse load with python execution environment.
|
DEPLOY_ENV |
(String) Name of the current environment.
|
VARS |
List({key:value}) A list of key value pairs of variables within an environment.
|
HANDLE_OWNERSHIP |
(String) How to handle the ownership of existing objects.
|
DEPLOY_DATABASE_NAME |
(String) Name of the MetaOps Deploy Database.
|
DEPLOY_ROLE |
(String) Name of the MetaOps Deploy Role.
|
IMPORT_DATABASES |
(List) List of databases to import for subcommand = IMPORT only. If not included, all databases imported. List values can either include or not include the ENV_DATABASE_PREFIX. If not included, then ENV_DATABASE_PREFIX is applied when finding databases to import. |
IMPORT_OBJECT_TYPES |
(List) List of object types to import for subcommand = IMPORT only. If empty list of not included, all object types will be imported. Valid object types:
|
CLASSIFY_DATABASES |
(List) List of databases to classify for subcommand = CLASSIFY only. If not included, all databases classified. List values can either include or not include the ENV_DATABASE_PREFIX. If not included, then ENV_DATABASE_PREFIX is applied when finding databases to classify. |
CLASSIFY_TAGS_DB_SCHEMA |
(String) Database.Schema location of where governance tags to be stored for subcommand = CLASSIFY only. Classify command auto creates necessary tags. |
CLASSIFY_IGNORE_TAGS |
(List) List of tags to signify that column should be ignored from classification for subcommand = CLASSIFY only. |
CLASSIFY_MAX_SAMPLE_SIZE |
(Int) Max sample size of Snowflake's auto-classification for subcommand = CLASSIFY only. This helps reduce processing time of classification. Default = 10000 |
Example config
deploy_config_dev.yml
ENV_DATABASE_PREFIX: DEV_
ENV_WAREHOUSE_PREFIX:
ENV_ROLE_PREFIX:
ENV_PROCEDURE_PREFIX:
ENV_FUNCTION_PREFIX:
OBJECT_METADATA_ONLY: True
MAX_THREADS: 5
HANDLE_OWNERSHIP: ERROR
IMPORT_DATABASES:
- ANALYTICS
- CONTROL
- RAW
- SECURITY
CLASSIFY_DATABASES:
- ANALYTICS
- RAW
DEPLOY_ENV: dev
VARS:
- my_comment: some dev comment
- another_var: some other var in dev