DrFaust92 / terraform-provider-bitbucket

Terraform Bitbucket Cloud provider.
https://registry.terraform.io/providers/drfaust92/bitbucket
Mozilla Public License 2.0
36 stars 29 forks source link

Prevent using user name with bitbucket_repository_user_permission. Must be UUID. #209

Closed barrywhart closed 1 month ago

barrywhart commented 1 month ago

This fixes a nuisance issue I noticed. With bitbucket_repository_user_permission, if user_id is a user name (rather than a UUID), the changes apply without error, but subsequent runs of terraform plan and terraform apply always show a change needs to be applied.

I noticed that the provider documentation explicitly states that user_id is "The UUID of the user.", so it seems best to disallow the use of user names. This PR does that. As a bonus, the error message provides the UUID of the user to make it easy to fix the code.

  user_permissions = {
    "my-user-name" = "write",
    # Should be a UUID
  "{aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa}" = "write",
  }