Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Decouple Namespace access from User resource #109

Open
DmytroRomantsovM opened this issue Aug 12, 2024 · 3 comments
Open
Assignees
Labels
API dependency required This issue requires an API before TF work can begin enhancement New feature or request

Comments

@DmytroRomantsovM
Copy link

Is your feature request related to a problem? Please describe.

In our company, we use Namespaces to isolate environments and, in the future, teams. For this we have created our own wrapper on top of Namespace resource. The wrapper (terraform module) is going to be deployed per environment and per team. We would like to be able to manage access in it, however, as we can only provision access via User so duplicated deployments will lead to conflicts. This creates limitation that can be overcome only by moving user management outside of our terraform module and deploying it once in a centralised way. This is far from ideal as we need to gather and hardcode the references to the existing namespace names.

Describe the solution you'd like

Create another resource like temporal_user_namespace_accesses. With the following schema:
user_email (String) - Email of the user.
namespace_id (String) The namespace to assign permissions to.
permission (String) The permission to assign. Must be one of admin, write, read

@DmytroRomantsovM DmytroRomantsovM added the enhancement New feature or request label Aug 12, 2024
@swgillespie
Copy link
Collaborator

@ennyjfrick would love to hear your thoughts on this! what do you think?

@ennyjfrick
Copy link
Contributor

ennyjfrick commented Aug 14, 2024 via email

@DmytroRomantsovM
Copy link
Author

Thank you for such fast feedback!

The model of having one user only with a global account_access role and many namaspace_access resources is precisely what we need.

If namespaces are managed separately in API by unique ID, to avoid race conditions, we need to ensure that Create and Delete operations are handled sequentially. Or, even have a simple, unique constraint on the DB level over the combination of email, namespace and company_id. It should be enough as the race conditions are very unlikely as it requires at least two deployments to manage the same users for the same namespace nearly simultaneously (time of API request). So it's possible just to return an error or even accept the latest request value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API dependency required This issue requires an API before TF work can begin enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants