dbt-labs / terraform-provider-dbtcloud

dbt Cloud Terraform Provider
https://registry.terraform.io/providers/dbt-labs/dbtcloud
MIT License
85 stars 19 forks source link

Allow for the Management of Users #202

Open anaghshineh opened 1 year ago

anaghshineh commented 1 year ago

Hey, @b-per - me again 😁. I'd love the flexibility to be able to create & remove users via this Terraform provider. I am not seeing a pre-existing user-related endpoint to allow for this. Is this something that you can support?

Example from Fivetran Terraform provider: https://registry.terraform.io/providers/fivetran/fivetran/latest/docs/resources/user

b-per commented 1 year ago

There are endpoints but they are not extremelly documented.

One of the key differences as well with other configs is that we don't create a user but we invite her/him (e.g. it requires some action on the user side to accept the invite). From a quick look this seems to be the way Fivetran works as well so this scenario should still work in the Terraform way of handling config.

I might have a look in the future to try to add the capability but I won't be able to work most likely until after Coalesce.

will-sargent-dbtlabs commented 1 year ago

Also @anaghshineh to add additional info to what @b-per said, currently, users are only "deactivated" in our systems (soft-deleted) rather than fully removed, including separate records for licenses that also need to be de-provisioned. i.e -> It's not trivial to both deactivate a user, and clear their license allocations for a given account.

Full SCIM capabilities (via the dbt Cloud Rest API, not Terraform specifically) are currently in development, which should reduce the amount of complexity necessary to remove users.

That being said, I agree it would be amazing to have via Terraform. I'm a big fan, and look forward to helping Benoit where I can on this.

anaghshineh commented 1 year ago

Thanks, @b-per! I was actually having a similar conversation with @Stevedow99, and he mentioned the invites as well. That makes sense.

He pointed me to these two endpoints: List Invites Retrieve Invite

A few questions:

anaghshineh commented 1 year ago

@will-sargent-dbtlabs - that's awesome. Agree that it would be amazing to be able to do this via Terraform. Selfishly, would love for you to work on this before Coalesce. Let me know if there are more details I can provide!

b-per commented 1 year ago

I just did some quick initial testing of the invite API and here is what I found:

github-actions[bot] commented 9 months ago

This issue has been marked as Stale because it has been open for 90 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

b-per commented 8 months ago

Reopening if some people are keen to investigate/implement it

will-sargent-dbtlabs commented 8 months ago

@b-per - I think we do need to do something on this front, especially since I think upcoming improvements to our SSO JIT might make this more plausible to use via TF

github-actions[bot] commented 5 months ago

This issue has been marked as Stale because it has been open for 90 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

kcd83 commented 3 months ago

Here's my use case for consideration:

We use SSO / Okta which is managed by our central IT team who have a process to add users and we (data platform team) use Terraform to control what users can do. This is true of a number of our platforms e.g. Snowflake.

Therefore for DBT Cloud via Terraform:

  1. We allocation User Groups ✔️
  2. We want to allocate User License ⛔

In other words the alternative we are not doing is using dbtcloud_license_map

b-per commented 3 months ago

Hi @kcd83

I am not sure that I understand your need here, or if it is related to this issue.

What you are after is to assign people to licenses directly and not using the SSO license mapping?

When the central IT team manages those users, do they assign them SSO groups specific to dbt Cloud?

jaklan commented 1 month ago

@b-per we have a bit different use-case, but related to the lack of user management capabilities in the provider - we want to inject user-level development credentials using Terraform, so we don't have to pass them to users to enter them manually in dbt Cloud.

b-per commented 1 month ago

Hi @jaklan .

I just did some tests and our APIs don't allow users or a service token with Account Admin access to set credentials for other users.

This action is only allowed when connected as the user for which the credentials need to be set. So, this is not something I would be able to add to Terraform for now.

jaklan commented 1 month ago

@b-per thanks for verifying. It seems we would need to wait for Redshift SSO in dbt Cloud then (as I expect it's going to happen faster than changes in API to allow the above)