rissson / terraform-provider-rgw

Mirror for https://gitlab.com/lama-corp/infra/tools/terraform-provider-rgw
MIT License
7 stars 1 forks source link

Error: NoSuchUser #4

Open rgruyters opened 2 years ago

rgruyters commented 2 years ago

When using tenant with user_id I get with the next plan, apply or destroy the following error:

Error: NoSuchUser tx00000000000000000c41c-006294b945-2bd8627-test-sc 2bd8627-test-sc-test

Here are the steps that i'm following:

$ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # rgw_user.my_user will be created
  + resource "rgw_user" "my_user" {
      + bucket_quota          = (known after apply)
      + caps                  = (known after apply)
      + default_placement     = (known after apply)
      + default_storage_class = (known after apply)
      + display_name          = "Test account via Terraform"
      + email                 = (known after apply)
      + id                    = (known after apply)
      + keys                  = (known after apply)
      + max_buckets           = (known after apply)
      + op_mask               = (known after apply)
      + placement_tags        = (known after apply)
      + subusers              = (known after apply)
      + suspended             = (known after apply)
      + swift_keys            = (known after apply)
      + type                  = (known after apply)
      + user_id               = "robin_test$robin"
      + user_quota            = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

rgw_user.my_user: Creating...
rgw_user.my_user: Creation complete after 0s [id=robin_test$robin]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
$ terraform plan
rgw_user.my_user: Refreshing state... [id=robin_test$robin]
╷
│ Error: NoSuchUser tx00000000000000000c41c-006294b945-2bd8627-test-sc 2bd8627-test-sc-test
│
│   with rgw_user.my_user,
│   on main.tf line 14, in resource "rgw_user" "my_user":
│   14: resource "rgw_user" "my_user" {
│

The user is available on radosgw service:

$ sudo radosgw-admin user list
[
    "robin_test$robin",
]

Here is my main.tf file:

terraform {
  required_providers {
    rgw = {
      source = "rissson/rgw"
      version = "0.3.1"
    }
  }
}

provider "rgw" {
  # Configuration options
}

resource "rgw_user" "my_user" {
  user_id      = "robin_test$robin"
  display_name = "Test account via Terraform"
}
rgruyters commented 2 years ago

Do you have an idea why this is?