scaleway/terraform-provider-scaleway

scaleway_documentdb_private_network_endpoint state issue

Opened this issue ยท 0 comments

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.9.4
on linux_amd64
+ provider registry.terraform.io/scaleway/scaleway v2.42.1

Affected Resource(s)

  • scaleway_documentdb_private_network_endpoint
  • scaleway_rdb_instance

Terraform Configuration Files

terraform {
  required_providers {
    scaleway = {
      source = "scaleway/scaleway"
      version = "2.42.1"
    }
  }
  required_version = ">= 1.1.0"
}

provider "scaleway" {
  project_id        = "replaceme"
  zone            = "fr-par-2"
  region          = "fr-par"
  access_key      = "replaceme"
  secret_key      = "replaceme"
}

resource "scaleway_vpc_private_network" "vpc" {
  name = "test"
  ipv4_subnet {
      subnet = "192.168.0.0/24"
    }
}

resource "scaleway_rdb_instance" "postgresql" {
  name           = "test"
  node_type      = "DB-DEV-S"
  engine         = "PostgreSQL-15"
  is_ha_cluster  = false
  user_name      = "test"
  password       = "Th1s_is_my_password"
}

resource "scaleway_documentdb_private_network_endpoint" "main" {
  instance_id    = scaleway_rdb_instance.postgresql.id
  private_network {
    id           = scaleway_vpc_private_network.vpc.id
    ip_net       = "192.168.0.42/30"
  }
  depends_on = [scaleway_rdb_instance.postgresql]
}

Debug Output

The output of terraform after the second apply with no modification:
https://gist.github.com/D0wn3r/fbdfcd31436bc17f525d90f85544f35e

Expected Behavior

The private network should stay in the database if it doesn't have any modification

Actual Behavior

When we apply even touching nothing, the private network is delete
First apply create everything ok
Second apply delete the private network from the database
Third apply will add again the private network to the database
...

Steps to Reproduce

  1. terraform apply
  2. terraform apply
  3. terraform apply