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

container: when importing, namespace_id is not a regional id

Open norbjd opened this issue 1 year ago • 0 comments
trafficstars

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • Terraform v1.7.0
  • provider registry.terraform.io/scaleway/scaleway v2.36.0

Affected Resource(s)

  • scaleway_container

Terraform Configuration Files

terraform {
  required_providers {
    scaleway = {
      source  = "scaleway/scaleway"
      version = "2.36.0"
    }
  }
}

provider "scaleway" {}

resource "scaleway_container" "test" {
  name         = "test"
  namespace_id = "fr-par/22222222-2222-2222-2222-222222222222"
}

Expected Behavior

After terraform importing a scaleway_container, the namespace_id field should be a regional uuid value (like fr-par/22222222-2222-2222-2222-222222222222) to be consistent with scaleway_function, and with scaleway_container_namespace's id output.

Actual Behavior

After terraform importing a scaleway_container, the namespace_id field is an uuid (like 22222222-2222-2222-2222-222222222222).

So, if we run terraform apply after importing, Terraform will update the container's namespace_id field, while it should not.

Steps to Reproduce

  1. create a container (outside Terraform)
  2. import the container with terraform import scaleway_container.test fr-par/11111111-1111-1111-1111-111111111111
  3. check the namespace_id field: jq '.resources[] | select(.name == "test") | .instances[0].attributes.namespace_id' terraform.tfstate

References

  • for scaleway_function, the namespace_id have been added here: #2364

norbjd avatar Jan 30 '24 15:01 norbjd