Role
Snowflake Docs - CREATE ROLE
Snowflake Docs - ALTER ROLE
Usage
- Role name = file name of role yml config
Limiations
- Currently does not support the REMOVAL of child roles. If a child role is removed from the list, the deployer will NOT automatically remove relationship in Snowflake. Future roadmap item.
Environment Config
- Use the ENV_ROLE_PREFIX in the environment config file to specify a prefix for ALL roles within an environment.
- If the role filename is INGEST.yml and the ENV_ROLE_PREFIX is "PROD_", the role name will compile to "PROD_INGEST"
- See Setup/Config for additional details & examples
Snowflake Attributes
Parameter |
Description |
|---|---|
COMMENT |
(String) - Optional |
OWNER |
(String) - Optional
|
CHILD_ROLES |
(String) - Optional
|
TAGS |
({KEY:VALUE}) - Optional |
GRANTS |
({KEY:VALUE}) - Optional |
Optional Parameter Defaults - if omitted, Snowflake defaults for parameters are used, just like creating an object manually.
Deployment attributes
Parameter |
Description |
|---|---|
DEPLOY_ENV |
(List) - Optional
|
DEPLOY_LOCK |
(Bool) - Optional
|
Folder Structure
snowflake/instance/roles/[role name].yml
Example Structure
snowflake/instance/roles/ANALYST.yml
snowflake/instance/roles/ADMIN.yml
This creates 2 roles named "ANALYST" and "ADMIN" each with their own yml file.
Samples
Basic
OWNER: INSTANCEADMIN
COMMENT: Test compute resources
CHILD_ROLES:
- {{role('CHILD_ROLE')}}
- CUSTOMROLE
TAGS:
- {{ref('CONTROL__GOVERNANCE__ENV')}}: PROD
With a deploy lock & restricted deployment environments.
OWNER: INSTANCEADMIN
COMMENT: Test compute resources
CHILD_ROLES:
- {{role('CHILD_ROLE')}}
- CUSTOMROLE
TAGS:
- {{ref('CONTROL__GOVERNANCE__ENV')}}: PROD
DEPLOY_LOCK: true
DEPLOY_ENV:
- PROD
- TEST