cockroachdb / terraform-provider-cockroach

Terraform provider for CockroachDB Cloud
Apache License 2.0
56 stars 10 forks source link

Feature request: create non-admin database users with cockroach_sql_user #110

Open shellderp opened 1 year ago

shellderp commented 1 year ago

Database users created through the provider are placed in the admin role and I haven't found a way to create a user that does not have this role.

One use case is creating readonly developer accounts for use with sso sql login. We would like to create a database user for a developer then grant them SELECT on all tables in a database, but no other privileges.

marksoper commented 3 months ago

@shellderp thanks Gersh. Role grant should cover this. Please let me know if not. https://github.com/cockroachdb/terraform-provider-cockroach/blob/main/docs/resources/user_role_grant.md

shellderp commented 3 months ago

Thanks, role grant is a cockroach cloud role, I meant to create a SQL user that is not an admin then give specific grants to that user (eg SELECT on table), does it work for that as well?