confluentinc / terraform-provider-confluent

Terraform Provider for Confluent
Apache License 2.0
118 stars 61 forks source link

confluent_invitation resource is trying to create inviation as service account #323

Closed onepointfivem closed 8 months ago

onepointfivem commented 8 months ago

Hello,

I'm using I'm trying to deploy users in confluent using terraform and while my configurations were working last month, today I added a new user and it stopped working.

This is the error:

 module.confluent_user_invite["xxxx@xxx.com"].confluent_invitation.this[0]: Creating...
 │ Error: error creating invitation 400 Bad Request: Must not use GetUser for service account
  │ 
  │   with module.confluent_user_invite["xxxxx@xxxxxx.com"].confluent_invitation.this[0],
  │   on ../modules/module-confluent-user-invitation/main.tf line 1, in resource "confluent_invitation" "this":
  │    1: resource "confluent_invitation" "this" {
  │ 

Created resources:

Terraform will perform the following actions:

  # module.confluent_user_invite["xxxx@xxxxx.com"].data.confluent_user.example_using_email will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "confluent_user" "example_using_email" {
      + api_version = (known after apply)
      + email       = "xxxxx@xxxxx.com"
      + full_name   = (known after apply)
      + id          = (known after apply)
      + kind        = (known after apply)
    }

  # module.confluent_user_invite["xxxxx@xxxxx.com"].confluent_invitation.this[0] will be created
  + resource "confluent_invitation" "this" {
      + accepted_at = (known after apply)
      + auth_type   = (known after apply)
      + creator     = (known after apply)
      + email       = "xxxxx.xxxxx@xxxxx.com"
      + expires_at  = (known after apply)
      + id          = (known after apply)
      + status      = (known after apply)
      + user        = (known after apply)
    }

  # module.confluent_user_invite["xxxxxa@xxxxx.com"].confluent_role_binding.org-example-rb will be created
  + resource "confluent_role_binding" "org-example-rb" {
      + crn_pattern = "crn://confluent.cloud/organization=xxxxx/environment=***"
      + id          = (known after apply)
      + principal   = (known after apply)
      + role_name   = "EnvironmentAdmin"
    }

Versions:

 - Using hashicorp/tls v3.4.0 from the shared cache directory
 - Using confluentinc/confluent v1.51.0 from the shared cache directory
linouk23 commented 8 months ago

@onepointfivem thanks for reporting the issue!

I believe our backend team is aware of the issue and is working on a fix. I'll keep you posted!

linouk23 commented 8 months ago

@onepointfivem I believe the issue was resolved by our backend team. Let me know if that helps!