How Can I Define Multiple Roles for A Single dbt Transformation?
Question
How can I define multiple roles for a single dbt transformation?
Environment
Transformations for dbt Core
Answer
To define multiple roles for a single dbt transformation, you must create separate targets, with each defining a role:
- In Fivetran, go to the Transformations page and click Manage project.
- Locate the dbt Core project you want to edit.
- Click the more options menu next to the project, then select Edit connection settings.
- Under Targets, click + Add item to add a new target.
- Enter the required target details, such as the Target name and Schema. To learn more, see our Target management documentation.
- Under Optional keys, click + Add key.
- Set the key to
roleand enter the role name in the Values field. - Click OK, then click Save & Test.
- Repeat steps 4 to 8 for each additional role you want to define.
For example, if you want to define the roles DEV_DEVELOPER and PROD_DEVELOPER for your transformation, create two targets, then configure one target with role: DEV_DEVELOPER and the other with role: PROD_DEVELOPER.