Skip to content

MongoDB creation fails with public-and-private service endpoint #574

@prakash-ibm

Description

@prakash-ibm

I'm provisioning MongoDB on IBM Cloud using the Terraform IBM module terraform-ibm-icd-mongodb. Setting service_endpoint = "public-and-private" results in an error.

Affected modules

Terraform CLI and Terraform provider versions

  • Terraform version:
  • Provider version:
> terraform -v
Terraform v1.12.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/time v0.13.1
+ provider registry.terraform.io/ibm-cloud/ibm v1.79.1
module "mongodb" {
  source            = "terraform-ibm-modules/icd-mongodb/ibm"
  version           = "2.19.9"

Terraform output

module.resource_group.data.ibm_resource_group.existing_resource_group[0]: Reading...
module.resource_group.data.ibm_resource_group.existing_resource_group[0]: Read complete after 1s [id=67190d770f09485fb472747fd806dd6f]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create
 <= read (data resources)

Terraform will perform the following actions:

  # module.mongodb.data.ibm_database_connection.database_connection will be read during apply
  # (config refers to values not yet known)
 <= data "ibm_database_connection" "database_connection" {
      + amqps         = (known after apply)
      + analytics     = (known after apply)
      + bi_connector  = (known after apply)
      + cli           = (known after apply)
      + deployment_id = (known after apply)
      + emp           = (known after apply)
      + endpoint_type = "public"
      + grpc          = (known after apply)
      + https         = (known after apply)
      + id            = (known after apply)
      + mongodb       = (known after apply)
      + mqtts         = (known after apply)
      + mysql         = (known after apply)
      + ops_manager   = (known after apply)
      + postgres      = (known after apply)
      + rediss        = (known after apply)
      + secure        = (known after apply)
      + stomp_ssl     = (known after apply)
      + user_id       = (known after apply)
      + user_type     = "database"
    }

  # module.mongodb.ibm_database.mongodb will be created
  + resource "ibm_database" "mongodb" {
      + adminuser               = (known after apply)
      + configuration_schema    = (known after apply)
      + deletion_protection     = false
      + groups                  = (known after apply)
      + guid                    = (known after apply)
      + id                      = (known after apply)
      + location                = "eu-de"
      + name                    = "mongodb-develop-v7.0"
      + plan                    = "standard"
      + resource_controller_url = (known after apply)
      + resource_crn            = (known after apply)
      + resource_group_id       = "67190d770f09485fb472747fd806dd6f"
      + resource_group_name     = (known after apply)
      + resource_name           = (known after apply)
      + resource_status         = (known after apply)
      + service                 = "databases-for-mongodb"
      + service_endpoints       = "public-and-private"
      + status                  = (known after apply)
      + tags                    = [
          + "created_using:terraform",
          + "project: test",
        ]
      + version                 = "7.0"

      + auto_scaling (known after apply)

      + group {
          + group_id = "member"

          + disk {
              + allocation_mb = 10240
            }

          + host_flavor {
              + id = "b3c.4x16.encrypted"
            }

          + members {
              + allocation_count = 3
            }
        }

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

  # module.mongodb.ibm_resource_tag.mongodb_tag[0] will be created
  + resource "ibm_resource_tag" "mongodb_tag" {
      + account_id  = (known after apply)
      + id          = (known after apply)
      + replace     = false
      + resource_id = (known after apply)
      + tag_type    = "access"
      + tags        = [
          + "setby:access-tag",
        ]
    }

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

Changes to Outputs:
  + crn                        = (known after apply)
  + guid                       = (known after apply)
  + hostname                   = (known after apply)
  + id                         = (known after apply)
  + port                       = (known after apply)
  + resource_group_id          = "67190d770f09485fb472747fd806dd6f"
  + version                    = "7.0"

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

module.mongodb.ibm_database.mongodb: Creating...
╷
│ Error: [ERROR] Error creating database instance: Open a support case with 'Databases for MongoDB' service. The service's broker returned error, [400, Bad Request] We were unable to complete your request: Multiple service endpoints are not supported for mongodb in eu-de. Try again with valid values or contact support if the issue persists. {
│     "StatusCode": 422,
│     "Headers": {
│         "Cache-Control": [
│             "max-age=0, no-cache, no-store"
│         ],
│         "Content-Length": [
│             "647"
│         ],
│         "Content-Type": [
│             "application/json; charset=utf-8"
│         ],
│         "Date": [
│             "Thu, 12 Jun 2025 08:35:34 GMT"
│         ],
│         "Expires": [
│             "Thu, 12 Jun 2025 08:35:34 GMT"
│         ],
│         "Pragma": [
│             "no-cache"
│         ],
│         "Request-Id": [
│             "626c-71d28eba0851d4e9"
│         ],
│         "Retry-After": [
│             "0"
│         ],
│         "Server": [
│             "istio-envoy"
│         ],
│         "Set-Cookie": [
│             "ak_bmsc=<some token>; Domain=.cloud.ibm.com; Path=/; Expires=Thu, 12 Jun 2025 10:35:28 GMT; Max-Age=7194"
│         ],
│         "Strict-Transport-Security": [
│             "max-age=31536000;includeSubDomains"
│         ],
│         "Transaction-Id": [
│             "626c-b9e3ef3fd3990602"
│         ],
│         "X-Content-Type-Options": [
│             "nosniff"
│         ],
│         "X-Correlation-Id": [
│             "626c-b9e3ef3fd3990602"
│         ],
│         "X-Envoy-Upstream-Service-Time": [
│             "5263"
│         ],
│         "X-Op-Completion-Time": [
│             ""
│         ],
│         "X-Ratelimit-Limit": [
│             "100"
│         ],
│         "X-Ratelimit-Remaining": [
│             "99"
│         ],
│         "X-Ratelimit-Reset": [
│             "0"
│         ]
│     },
│     "Result": {
│         "details": "{\"error\":\"BadRequest\",\"description\":\"We were unable to complete your request: Multiple service endpoints are not supported for mongodb in eu-de. Try again with valid values or contact support if the issue persists.\"}",
│         "error_code": "RC-ServiceBrokerErrorResponse",
│         "message": "Open a support case with 'Databases for MongoDB' service. The service's broker returned error, [400, Bad Request] We were unable to complete your request: Multiple service endpoints are not supported for mongodb in eu-de. Try again with valid values or contact support if the issue persists.",
│         "status_code": 422,
│         "transaction_id": "626c-b9e3ef3fd3990602"
│     },
│     "RawResult": null
│ }
│
│
│   with module.mongodb.ibm_database.mongodb,
│   on .terraform/modules/mongodb/main.tf line 163, in resource "ibm_database" "mongodb":
│  163: resource "ibm_database" "mongodb" {
│
╵

Debug output

Expected behavior

The service_endpoint option public_private option is either missing from the IBM Cloud Console UI or need to remove it in Terraform mongodb.

Image

Actual behavior

Steps to reproduce (including links and screen captures)

  1. Run terraform apply

Anything else


By submitting this issue, you agree to follow our Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions