New Module versions are not pushed from GitLab after changing VCS Provider in TF Cloud

Hi!

We have a number of modules on Terraform Cloud that are linked to repositories in our Gitlab. We had to re-create the VCS Provider in Terraform Cloud, which removed that link.
We’ve now gone through steps to create a new VCS Provider to the same Gitlab account and are able to publish new modules to TF Cloud. These new modules are linked correctly to Gitlab and pushing new tags to Gitlab publishes new version of the module to TF Cloud.

We are having issues with TF Cloud modules that were created using the old VCS Provider though. These modules seem to have lost links to Gitlab and new versions of modules are not pushed from Gitlab to TF Cloud. We have narrowed this down to webhooks not working. Manually testing the webhook from Gitlab repo results in:

Hook executed successfully but returned HTTP 401 {"errors":["vcs repo no longer connected to a workspace"],"success":false}

Which I could not find anything online for.

Digging deeper, when I call:

curl  --header "Authorization: Bearer mytoken" --header "Content-Type: application/vnd.api+json" --request GET  https://app.terraform.io/api/v2/registry-modules/show/myorganisation/my-existing-module/aws

I get, among other things, the vcs key, which contains:

"vcs-repo": {
        "branch": "",
        "ingress-submodules": true,
        "identifier": “myorganisation/aws-terraform-modules/my-existing-module”,
        "display-identifier": “myorganisation/aws-terraform-modules/my-existing-module”,
        "repository-http-url": "https://gitlab.com/myorganisation/aws-terraform-modules/my-existing-module”,
        "service-provider": "gitlab_hosted"
      },

Notice that there is no webhook-url property.

I have then used the API to create a new module from the same source repository with a different display-identifier of my-existing-module-test.

Calling

curl  --header "Authorization: Bearer mytoken" --header "Content-Type: application/vnd.api+json" --request GET  https://app.terraform.io/api/v2/registry-modules/show/myorganisation/my-existing-module-test/aws.

and looking into the vcs-repo key gives me:

"vcs-repo": {
        "ingress-submodules": true,
        "identifier": “myorganisation/aws-terraform-modules/my-existing-module-test”,
        "display-identifier": “myorganisation/aws-terraform-modules/my-existing”-module-test,
        "oauth-token-id": “valid-vcs-oauth-token”,
        "webhook-url": "https://app.terraform.io/webhooks/vcs/v2-1234…this_looks_valid",
        "repository-http-url": "https://gitlab.com/myorganisation/aws-terraform-modules/my-existing-module”,
        "service-provider": "gitlab_hosted"
      },

which contains the webhook-url, tags are pushed from Gitlab to TF Cloud successfully and everything works fine.

Unfortunately, I can’t find a way to fix my modules that were created with the now-deleted VCS Provider without actually deleting them and recreating them, which is a bit meh for 90+ modules.

Is there a way for me to link these modules that were created with now-deleted VCS provider to a new VCS Provider so that pushing tags in Gitlab pushes new module versions to TF Cloud without having to delete them and recreate them?