fivetran / terraform-provider-fivetran

Terraform Provider for Fivetran
https://fivetran.com
Apache License 2.0
41 stars 22 forks source link

Cannot manage in Terraform the multiple roles that definable in UI #234

Closed LeoTheGriff closed 3 months ago

LeoTheGriff commented 7 months ago

Describe the bug Cannot manage in Terraform the multiple roles that definable in UI. How do you set multiple roles to a user at different levels? e.g. account billing and destination analyst

I don't see from the docs how this can be described in existing resources. You can set a role with a user, but it is a string not a list.

image

To Reproduce Provide an example .tf configuration

In UI: create user with an account role and a destination role.

Expected behavior A clear and concise description of what you expected to happen.

Roles as an array or another resource mapping roles to users

Logs & Output Provide terraform CLI output on plan | apply. If it is possible, please, refer to this guide to enable debug output.

Plugin version: Please specify Fivetran Terraform Provider version you are using.

Additional context Add any other context about the problem here.

Workaround is to remove destination-specific role and rely on <inherited>

beevital commented 7 months ago

@LeoTheGriff have you tried to use https://registry.terraform.io/providers/fivetran/fivetran/latest/docs/resources/team_group_membership ?

beevital commented 7 months ago

In API we have slightly different approach. User may have only one role on account level. For each resource you have to assign role separately by adding user memberships in reaources

LeoTheGriff commented 7 months ago

https://registry.terraform.io/providers/fivetran/fivetran/latest/docs/resources/team_group_membership

I am not on the enterprise license so I cannot use teams.

For each resource you have to assign role separately by adding user memberships in resources

How do I do this?

beevital commented 7 months ago

How do I do this?

https://fivetran.com/docs/rest-api/users#connectormemberships - for connectors https://fivetran.com/docs/rest-api/users#groupmemberships - for destinations

But looks like these endpoints are not covered by TF provider. We will do that ASAP)

LeoTheGriff commented 7 months ago

Awesome, thank you!

fivetran-aleksandrboldyrev commented 3 months ago

https://github.com/fivetran/terraform-provider-fivetran/releases/tag/v1.1.19