Adopting it incrementally¶
Access-as-code projects usually stall at the same step: before anything can be automated, someone has to inventory every account, database, role and grant, decide which are still right, and re-create them in the new tool. In an enterprise with several Snowflake accounts and hundreds of databases, that reconciliation is most of the project.
You can skip it. DCM manages only what its definitions name. Objects and grants it didn't create are left alone, and roles it creates can be granted to roles it doesn't manage. So the project can start small, next to the existing setup, and grow one database, one team and one account at a time. Nothing has to be reconciled up front.
The principle: grow the boundary, never jump it¶
Each step below widens what the project controls. The early ones touch nothing that exists today. Only the last one, adopting existing objects, puts anything you already have at risk, and you take it one object at a time, when you choose.
| Step | What the project controls | What it changes that exists today |
|---|---|---|
| 1. A new database | Its own database, schemas and roles | Nothing |
| 2. Hand its roles to existing ones | The same | Existing roles receive new roles |
| 3. Grant on existing databases | Grants on databases you name | Adds grants; owns no objects there |
| 4. Adopt existing objects | Objects you move into the definitions | Takes them over; removing them later drops them |
Steps 1 to 3 are additive: undoing one is a revert and a deploy.
Step 1: start with something new¶
Pick the next database somebody asks for, or one team's new schema, and
create it through the project as in Setup. The bootstrap creates
only the project's own roles and database. The project role, DCM_ADMIN,
holds CREATE ROLE and CREATE DATABASE and nothing over existing objects,
so a mistake in the definitions can't reach them. Every plan for this step
contains only CREATE lines.
This is also where the team learns the workflow: what a plan looks like, who reviews, how long a change takes.
Step 2: connect people without re-provisioning them¶
People keep the roles they have. Grant the project's functional roles to those roles:
roles:
- name: ANALYST
read: [SANDBOX.CURATED]
granted_to: [FINANCE_ANALYSTS] # an existing role, made by hand or by SCIM
Granting a role needs ownership of the role being granted, not of the role
receiving it. The project owns ANALYST, so it can grant it to any existing
role without managing that role. The reference project does exactly this to
roll every functional role up to SYSADMIN.
Never list an existing role under roles. That defines it, which brings
it under the project's management. If the role is owned by another role, the
plan fails ("already exists, but current role has no privileges on it"). If
the project could take it over, a later edit could drop it. Existing roles
belong in granted_to only.
Users and Entra groups¶
Leave existing users as they are. If you turn on Entra SCIM provisioning, set
the enterprise application to provision only assigned users and groups,
and start with one new group for one team. SCIM creates that group's role and
users, owned by AAD_PROVISIONER. Snowflake syncs only the users and roles
that role owns, so hand-made users are untouched. Put the new group role in a
functional role's granted_to (step 2), and that team is on the new model
while everyone else carries on. The SCIM setup is in
Entra groups and repository permissions.
Step 3: grant on databases the project doesn't own¶
Most of the value is in existing data, so the next step is granting the project's roles access to existing databases without adopting them:
grant usage on database FINANCE to role ANALYST;
grant usage on schema FINANCE.REPORTING to role ANALYST;
grant select on all views in schema FINANCE.REPORTING to role ANALYST;
DCM resolves every object a statement names when it compiles, as the project
owner. If DCM_ADMIN can't see the database, the plan fails before
evaluating anything:
Unresolved or ambiguous dependency: Dependency Database FINANCE does not exist or not authorized
Give the project owner grant authority on that database only, with
container-level MANAGE GRANTS (generally available since September 2026):
USE ROLE ACCOUNTADMIN;
GRANT MANAGE GRANTS ON DATABASE FINANCE TO ROLE DCM_ADMIN;
Needs an account opt-in
Container-level MANAGE GRANTS is off until an administrator runs
ALTER ACCOUNT SET FEATURE_RBAC_INHERITED_GRANTS = 'ENABLED' (the default
is DISABLED). Without it the grant fails with Unsupported feature
'MANAGE GRANTS ON DATABASE'. With it, the plan above succeeded:
ALTER role ANALYST
+ USAGE ON DATABASE FINANCE
+ USAGE ON SCHEMA FINANCE.REPORTING
+ SELECT ON VIEW FINANCE.REPORTING.<each view>
ON ALL shows up as one grant per existing object, so a large schema
makes a long plan.
The project can't give itself this privilege: a definition granting
MANAGE GRANTS on a container, even one the project owns, fails with
"Insufficient privileges". An administrator grants it, outside the
project, once per database.
Two things to know before you do:
- It's still a broad privilege within that database.
MANAGE GRANTSon a database lets the project grant anything in it to anyone. Use one database at a time, and only after its owners agree. - Your grants and the existing ones coexist. DCM revokes only grants it deployed. Access people already have through hand-made grants stays until you remove it by hand, which you can do once the project's grants cover it.
ON ALL grants cover what exists when they deploy. For what comes later,
container-level MANAGE GRANTS also allows inherited grants
(GRANT INHERITED SELECT ON ALL VIEWS IN SCHEMA ...), which cover existing and
future objects in one grant. In our test, though, the plan's changeset left
the inherited grant out entirely while listing the grants around it, so
reviewers wouldn't see it. Until plans show inherited grants, prefer ON ALL
plus ON FUTURE where you can review them.
Step 4: adopt existing objects, one at a time¶
Adopting means defining an object that already exists. From the next deploy on, the project manages it: it alters the object to match the definition, and drops it if the definition is later removed. That second part is why this step comes last.
- The project owner must hold the object's current owner role (or the
plan fails), and DCM recommends a
GRANT OWNERSHIPin the definitions to make the intended owner explicit. DCM checks for owner lockout before it changes anything. - Write the definition to match the object as it is, then read the plan.
Every
ALTERline is a property the definition would change. Iterate until the plan shows only what you mean to change. - Adopt containers before what's inside them, and protect anything holding
data: Snowflake has no undo for a dropped database beyond Time Travel and
UNDROP, within the retention period.
Many organizations never need this step for their older databases. Steps 2 and 3 already put access to them under review.
Several accounts¶
A DCM project object lives in one account, and a manifest target names the account it belongs to. Roll out account by account: bootstrap the next one, add a target, and let the pipeline plan and deploy it.
targets:
DEV:
account_identifier: "<org>-<dev account>"
project_name: "DCM.PROJECTS.ACCESS_CONTROL"
project_owner: "DCM_ADMIN"
templating_config: DEV
PROD:
account_identifier: "<org>-<prod account>"
project_name: "DCM.PROJECTS.ACCESS_CONTROL"
project_owner: "DCM_ADMIN"
templating_config: PROD
templating:
defaults: { ... } # the model every account shares
configurations:
DEV: { ... } # what differs per account
PROD: { ... }
- A target doesn't choose the connection.
snow dcm plan --target PRODtakes the project name and templating from the target, but signs in wherever the connection points. The CLI only warns when the account doesn't match. The workflow must pass each target's account explicitly, for example a matrix over targets with a per-target--account. - One pair of managed identities can serve every account. Each account
gets its own
SVC_DCM_PLANandSVC_DCM_DEPLOYnaming the same identities; aWORKLOAD_IDENTITYonly has to be unique within an account. - Each account has its own network policy. Check that the runner is allowed into the next account before adding its target.
- Start with the least critical account, and promote a change to the next target only after it has deployed cleanly to the previous one.
Several databases and teams¶
One project for everything becomes a bottleneck: every team's change waits on one reviewer, and one mistake can reach every database. Split along ownership instead.
- One project per team or data domain, each in its own folder with its own
manifest.yml. They can share a repository; DCM requires the folders not to overlap. CODEOWNERS then gives each team review over its own folder. - One owner role per project (
DCM_FINANCE,DCM_MARKETING), each withMANAGE GRANTSonly on its own databases. A mistake in one project can't reach another team's data. - One shared project for the cross-cutting parts, such as the functional roles that span domains, if you need it.
- Keep each object in exactly one project. Plans record which project manages each object. We haven't tested what happens when two projects define the same object, so don't rely on it.
A rollout checklist¶
- Bootstrap the project in the least critical account, then create one new database through it.
- Grant its functional roles to one team's existing role. Watch a few changes go through review.
- Turn on SCIM for one new Entra group, provisioning only assigned groups, and grant a functional role to that group's role.
- Add container-level
MANAGE GRANTSon one existing database, grant the functional roles on it, then remove the hand-made grants the new ones replace. - Add the next account as a target.
- Split into per-team projects when a second team wants its own reviewers.
- Adopt existing objects only where the project needs to own them.
Next: Troubleshooting.