anasinnyk/terraform-provider-onepassword

Feature: Managed Group Memberships

Closed this issue · 3 comments

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

The new op versions look to have the ability to manage users and groups. This seems like a nice feature given that op is the only way [that I know] to programmatically manage these resources.

Describe the solution you'd like

  • A data source for user which will look up an existing user in the system. An actual resource for this would be much more difficult, but this feature request would only need the user identifier.
  • A group_member resource for managing the user's membership within a given group.

Describe alternatives you've considered

I would love for a 1Password API, but without that the current alternative has been to manually manage these users, leading to much drift from human error.

@anasinnyk I know from #18 that you may not have a 1Password account to help implement this. I'll try to take a stab at it from my side.

I added a PR for the onepassword_user data source above. As for onepassword_group_member it looks as though the CLI doesn't support enumerating the existing users within a group. It does support adding/removing so I could implement those and require that resources be tainted in order to "refresh" a layout, but that would be unpleasant for UX.

I made a feature request in the 1Password CLI forum hoping that the CLI can implement this feature.

EDIT: It turns out this feature does exist and was added in v0.7. I'll take a stab at PRing it.

@taiidani thanks for your PR and interesting in project