Skip to content

RDB update PN doesn't use IPAM #2299

Closed
@abarbare

Description

@abarbare

Hello,

When creating a rdb instance with a PN and IPAM, it works like expected, the config send to the API is using ipam_config flag.
When updating the PN id to a new one using another IPAM subnet, it seems to drop and recreate the instance endpoint but reusing the service_ip already defined with the previous configuration.
In case of update of a PN, we should check the client request and do not push the service_ip field if the client request an ipam_config.
service_ip is still necessary if the endpoint is configured with a service_ip (without ipam)

Thanks a lot,

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

Affected Resource(s)

  • scaleway_rdb_instance

Terraform Configuration Files

provider "scaleway" {
  access_key      = var.secret.scaleway.access_key
  secret_key      = var.secret.scaleway.secret_key
  organization_id = var.scaleway.organization_id
  project_id      = var.scaleway.project_id
  region          = var.scaleway.region
  zone            = var.scaleway.zone
}

resource "scaleway_vpc" "demo_vpc" {
  name       = "demo_vpc"
  region     = var.scaleway.region
  project_id = var.scaleway.project_id
}

resource "scaleway_vpc_private_network" "subnet_0" {
  name       = "subnet_0"
  vpc_id     = scaleway_vpc.demo_vpc.id
  project_id = var.scaleway.project_id
  region     = var.scaleway.region
  ipv4_subnet {
    subnet = "192.168.0.0/24"
  }
}

resource "scaleway_vpc_private_network" "subnet_1" {
  name       = "subnet_1"
  vpc_id     = scaleway_vpc.demo_vpc.id
  project_id = var.scaleway.project_id
  region     = var.scaleway.region
  ipv4_subnet {
    subnet = "192.168.1.0/24"
  }
}

resource "scaleway_rdb_instance" "demo" {
  project_id     = var.scaleway.project_id
  name           = "rdb_migrate_pn_bug_demo"
  region         = var.scaleway.region
  node_type      = "DB-DEV-S"
  engine         = "MySQL-8"
  disable_backup = true
  is_ha_cluster  = false
  user_name      = "demo"
  password       = "Azety123!"
  private_network {
    pn_id = scaleway_vpc_private_network.subnet_1.id
  }
}

Debug Output

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000

Metadata

Metadata

Assignees

Labels

bugpriority:highestBugs filled by customers, security issuesrdbManaged MySQL and PostgreSQL issues, bugs and feature requests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions