terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

Databases does support VPE but error message is confusing

Open lionelmace opened this issue 3 years ago • 4 comments

If you try to provision VPE to target a Mongo DB with Public Endpoint you face the error message Service does not support VPE extensions.

Mongo does actually support VPE extensions, but you need to make sure your Cloud Databases deployment's private endpoint is enabled.

The error message Service does not support VPE extensions. should be replaced by Make sure your Cloud Databases deployment's private endpoint is enabled before creating VPE extensions.

resource "ibm_database" "icd_mongo" {
  name              = "${var.prefix}-mongo"
  service           = "databases-for-mongodb"
  plan              = "standard"
  version           = "4.2"
  service_endpoints = "private"
  location          = "eu-de"
  resource_group_id = ibm_resource_group.resource_group.id
  tags              = var.tags
  adminpassword                = "Passw0rd01"
  members_memory_allocation_mb = 3072  # 1GB  per member
  members_disk_allocation_mb   = 61440 # 20GB per member
}

# VPE (Virtual Private Endpoint) for Mongo
##############################################################################
# Make sure your Cloud Databases deployment's private endpoint is enabled
# otherwise you'll face this error: "Service does not support VPE extensions."
##############################################################################
resource "ibm_is_virtual_endpoint_gateway" "vpe_mongo" {
  name           = "${var.prefix}-mongo-vpe"
  resource_group = ibm_resource_group.resource_group.id
  vpc            = ibm_is_vpc.vpc.id

  target {
    crn           = ibm_database.icd_mongo.id
    resource_type = "provider_cloud_service"
  }

  # one Reserved IP for per zone in the VPC
  dynamic "ips" {
    for_each = { for subnet in ibm_is_subnet.subnet : subnet.id => subnet }
    content {
      subnet = ips.key
      name   = "${ips.value.name}-ip"
    }
  }

  tags = var.tags
}

lionelmace avatar Jan 17 '22 15:01 lionelmace

@lionelmace , we are working on it..

kavya498 avatar Jan 18 '22 05:01 kavya498

Hello. https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v1.38.1 release made today covers the VPE changes.

astha-jain avatar Jan 27 '22 14:01 astha-jain

@astha-jain

I run the same test with v1.38.1 and I still get the same error Create Endpoint Gateway failed Service does not support VPE extensions

Here is the terraform files I'm using to reproduce: https://github.com/lionelmace/ibmcloud-utils/tree/master/terraform/mongo

lionelmace avatar Jan 27 '22 16:01 lionelmace

@lionelmace This release doesn't yet support the fix for Create Endpoint Gateway failed Service does not support VPE extensions

The developement is in progress ...it will be part of next mid (pre release)

hkantare avatar Jan 28 '22 04:01 hkantare

I upgrated to terraform provider version 1.44.3.

I'm facing again the error Create Endpoint Gateway failed Service does not support VPE extensions

Error: Create Endpoint Gateway failed Service does not support VPE extensions. { "StatusCode": 400, "Headers": { "Cache-Control": [ "max-age=0, no-cache, no-store, must-revalidate" ], "Cf-Cache-Status": [ "DYNAMIC" ], "Cf-Ray": [ "743e8cb5fa6981af-IAD" ], "Content-Length": [ "133" ], "Content-Type": [ "application/json" ], "Date": [ "Thu, 01 Sep 2022 14:03:31 GMT" ], "Expires": [ "-1" ], "Pragma": [ "no-cache" ], "Server": [ "cloudflare" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "Vary": [ "Accept-Encoding" ], "X-Content-Type-Options": [ "nosniff" ], "X-Request-Id": [ "749ca314-d4b6-452b-9991-e0b138128b07" ], "X-Xss-Protection": [ "1; mode=block" ] }, "Result": { "errors": [ { "code": "not_found", "message": "Service does not support VPE extensions." } ], "trace": "749ca314-d4b6-452b-9991-e0b138128b07" }, "RawResult": null }
with ibm_is_virtual_endpoint_gateway.vpe_mongo
on mongo.tf line 67, in resource "ibm_is_virtual_endpoint_gateway" "vpe_mongo":
resource "ibm_is_virtual_endpoint_gateway" "vpe_mongo" {

What's wrong?

Here is the terraform script to reproduce: https://github.com/lionelmace/ibmcloud-utils/tree/master/terraform/mongo

lionelmace avatar Sep 01 '22 14:09 lionelmace

^ @hkantare

lionelmace avatar Sep 01 '22 14:09 lionelmace

I don't reproduce any more. There must be some instability on the VPC side....

lionelmace avatar Sep 08 '22 12:09 lionelmace