Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdb_instance.private_network.enable_ipam does not work as expected #2568

Open
rwunderer opened this issue May 13, 2024 · 0 comments
Open

rdb_instance.private_network.enable_ipam does not work as expected #2568

rwunderer opened this issue May 13, 2024 · 0 comments
Assignees
Labels
bug priority:highest Bugs filled by customers, security issues rdb Managed MySQL and PostgreSQL issues, bugs and feature requests

Comments

@rwunderer
Copy link

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.8.3
on linux_amd64

Affected Resource(s)

  • scaleway_rdb_instance

Terraform Configuration Files

resource "scaleway_vpc" "demo_vpc" {
  name = "demo_vpc"
}

resource "scaleway_vpc_private_network" "subnet_0" {
  name   = "subnet_0"
  vpc_id = scaleway_vpc.demo_vpc.id

  ipv4_subnet {
    subnet = "192.168.0.0/24"
  }
}

resource "scaleway_rdb_instance" "demo" {
  name           = "rdb_migrate_pn_bug_demo"
  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_0.id
    enable_ipam = true
  }
}

data "scaleway_ipam_ip" "demo" {
  resource {
    name = scaleway_rdb_instance.demo.name
    type = "rdb_instance"
  }

  type = "ipv4"
}

output "ipam_address" {
  value = data.scaleway_ipam_ip.demo.address
}

Debug Output

Panic Output

Expected Behavior

MySQL instance is created with ipam enabled and data.scaleway_ipam_ip.demo shows information about the instance endpoint.

Actual Behavior

data.scaleway_ipam_ip.demo breaks:

data.scaleway_ipam_ip.demo: Reading...
╷
│ Error: no ip found with given filters
│ 
│   with data.scaleway_ipam_ip.demo,
│   on main.tf line 28, in data "scaleway_ipam_ip" "demo":
│   28: data "scaleway_ipam_ip" "demo" {
│

Also, enable_ipam has not been set as can be seen when trying to run terraform apply again:

scaleway_vpc.demo_vpc: Refreshing state... [id=fr-par/3441224b-c637-4f03-8b8f-286fd40ebd3d]
scaleway_vpc_private_network.subnet_0: Refreshing state... [id=fr-par/907c17d6-57e9-400d-b024-dfb45d3c5d2f]
scaleway_rdb_instance.demo: Refreshing state... [id=fr-par/5eb0844d-2712-4918-a4dd-7ae9caac4900]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place
 <= read (data resources)

Terraform will perform the following actions:

  # data.scaleway_ipam_ip.demo will be read during apply
  # (depends on a resource or a module with changes pending)
 <= data "scaleway_ipam_ip" "demo" {
      + address         = (known after apply)
      + address_cidr    = (known after apply)
      + id              = (known after apply)
      + organization_id = (known after apply)
      + project_id      = (known after apply)
      + region          = (known after apply)
      + type            = "ipv4"
      + zonal           = (known after apply)

      + resource {
          + name = "rdb_migrate_pn_bug_demo"
          + type = "rdb_instance"
        }
    }

  # scaleway_rdb_instance.demo will be updated in-place
  ~ resource "scaleway_rdb_instance" "demo" {
        id                        = "fr-par/5eb0844d-2712-4918-a4dd-7ae9caac4900"
        name                      = "rdb_migrate_pn_bug_demo"
        tags                      = []
        # (20 unchanged attributes hidden)

      ~ private_network {
          ~ enable_ipam = false -> true
            name        = null
            # (7 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Changes to Outputs:
  + ipam_address = (known after apply)

Steps to Reproduce

  1. terraform apply
@Mia-Cross Mia-Cross self-assigned this May 27, 2024
@Mia-Cross Mia-Cross added rdb Managed MySQL and PostgreSQL issues, bugs and feature requests bug priority:highest Bugs filled by customers, security issues labels May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority:highest Bugs filled by customers, security issues rdb Managed MySQL and PostgreSQL issues, bugs and feature requests
Projects
None yet
Development

No branches or pull requests

2 participants