dbt-materialize: allow setting object owners #34844
Open
+28
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Our CI/CD pipeline uses dbt to deploy Materialize objects in a multi-tenant Materialize instance that uses RBAC heavily. The CI/CD pipeline uses the mz_system user, so the objects it creates are owned by mz_system.
However, due to Materialize's RBAC model,
we are required to do explicit grants of USAGE/SELECT to mz_system on all the objects, which feels both redundant and confusing given that mz_system is a superuser, and is not related to the role running queries against the objects.
So, we'd like dbt to be able to swap the owner of each object to the appropriate tenant's role at creation time.
Tips for reviewer
This is not yet tested, and I can't access buildkit 😅
Checklist
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way), then it is tagged with aT-protolabel.