Container registry creation failure

Hi, we are trying to create container registry (Scaleway) via Terraform and during apply step, we get this error even with admin level token. Is it possible to do that and what could be the problem? We already tried the latest provider version.

╷
│ Error: Error on container registry create
│ 
│   with qovery_container_registry.scaleway-cr,
│   on main.tf line 65, in resource "qovery_container_registry" "scaleway-cr":
│   65: resource "qovery_container_registry" "scaleway-cr" {
│ 
│ failed to create registry: Could not create container registry 'Scaleway CR 1', unexpected error: 401 Unauthorized
╵

Hello @km1414,

can you give me more information about your problem?
It looks like a terraform problem so can you share with me your terraform file?

Regards,
Charles-Edouard

Yes, the file is just simple example:

main.tf

terraform {
  required_providers {
    qovery = {
      source  = "qovery/qovery"
      version = "0.38.0"
    }
  }
  required_version = "1.9.3"
}

provider "qovery" {
  token = "<secret>"
}

module environment {
    source = "./modules/environment"
    cluster_id = "<secret>"
    project_id = "<secret>"
    name       = "test-env"
    mode       = "DEVELOPMENT"
}


resource "qovery_container_registry" "scaleway-cr" {
    organization_id = module.environment.environment_id
    name            = "Scaleway CR test"
    kind            = "SCALEWAY_CR"
    url             = "https://rg.pl-waw.scw.cloud"
}


Hello @km1414,

Thanks for your file.

Are you using a custom role to do this? Or are you using Admin role?

We have a limitation, you can only create a new Container Registry with the Admin role. This might be your problem.

If you want to use restricted roles for Terraform, you must create your Container Registry, either with a first Terraform using Admin role or in the console.

Regards,
Charles-Edouard

Ok, but does this work to you with “SCALEWAY_CR” type registry? I just created a new Admin level token, tried to create a new Container Registry using that token and got the same error. It works to us with other registry types.

Hello @km1414 ,

Sorry for the late answer.

We found a bug on our Terraform provider.
We are working on a fix,

regards,
Charles-Edouard

Hello @km1414 ,

Good news the bug is fixed.

Here is the updated Terraform documentation

Regards,
Charles-Edouard