IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
342 stars 671 forks source link

Error is thrown when creating ES or ETCD DB with `ops_manager` user #5538

Open akocbek opened 4 months ago

akocbek commented 4 months ago

Community Note

We tried to use ibm_database terraform resource to created ES and etdc database, with new user which has ops_manager type. On terraform apply error is thrown and deployment fails.

Error: [ERROR] CreateDatabaseUser (user123) failed Not Found
│ {
│     .....
│     "Result": {
│         "errors": {
│             "errors": "not_found",
│             "hint": "You may need to URL-encode any included CRN(s), see https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5#deployment-ids-and-crns for details"
│         }
│     },
│ }
│ 
│ 
│   with ibm_database.db,
│   on main.tf line 11, in resource "ibm_database" "db":
│   11: resource "ibm_database" "db" {

Terraform CLI and Terraform IBM Provider Version

terraform -v
Terraform v1.6.6
on darwin_arm64
+ provider registry.terraform.io/ibm-cloud/ibm v1.67.1

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.


resource "ibm_resource_group" "resourceGroup" {
  name     = "test_bug_rg_2"
}

resource "ibm_database" "db" {
  name              = "test_bug_db_etcd_2"
  plan              = "standard"
  location          = "eu-gb"
  service           = "databases-for-etcd"
  resource_group_id = ibm_resource_group.resourceGroup.id
  tags              = ["tag1", "tag2"]
  adminpassword    = "password12345678"
  users {
    name     = "user123"
    password = "passwor!!!!d12345678"
    type     = "ops_manager"
  }

  timeouts {
    create = "120m"
    update = "120m"
    delete = "15m"
  }
}

Debug Output

https://gist.github.com/akocbek/1e9aeb278fd4cbfc66faa49ac864511c

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

alexhemard commented 4 months ago

@akocbek The ops_manager user type is only available for MongoDB Enterprise Edition. However, this error should be improved.