OpenVPN / terraform-provider-cloudconnexa

OpenVPN Terraform CloudConnexa provider
https://registry.terraform.io/providers/OpenVPN/cloudconnexa
Apache License 2.0
3 stars 1 forks source link

"cloudconnexa_connector" resource doesn't have Update method defined #12

Open sahaqaa opened 5 days ago

sahaqaa commented 5 days ago

Related to: https://github.com/OpenVPN/cloudconnexa-go-client/issues/15

this would be required to update connectors without destroying them

Also was mentioned here: https://github.com/OpenVPN/terraform-provider-cloudconnexa/pull/11#issuecomment-2203808241

sahaqaa commented 5 days ago

Code to reproduce this:

resource "cloudconnexa_network" "foo" {
  description     = "Testing"
  egress          = true
  internet_access = "LOCAL"
  name            = "foo"

  default_connector {
    name          = "foo"
    vpn_region_id = "eu-central-1"
  }

  default_route {
    subnet = "192.168.1.0/24"
    type   = "IP_V4"
  }
}

resource "cloudconnexa_connector" "this" {
  name              = "qwerty"
  description       = "1234"
  vpn_region_id     = "eu-central-1"
  network_item_type = "NETWORK"
  network_item_id   = cloudconnexa_network.foo.id
}

Then when we change:

resource "cloudconnexa_connector" "this" {
  name              = "qwerty"
  description       = "ThisIsOurChange"
  vpn_region_id     = "eu-central-1"
  network_item_type = "NETWORK"
  network_item_id   = cloudconnexa_network.foo.id
}

"terraform plan" wants to remove it:

Plan: 1 to add, 0 to change, 1 to destroy.
sahaqaa commented 5 days ago

Also it effects "cloudconnexa_network" in a way that when we add for already existing "default_connector" description field:

  default_connector {
    description      = "ThisIsOurChange"
    name               = "foo"
    vpn_region_id = "eu-central-1"
  }

Terraform applies change, state is updated, but in UI "description" filed is not changed. This is because func resourceNetworkUpdate calls "c.Connectors.Create".

sahaqaa commented 4 days ago

Related report: https://github.com/OpenVPN/cloudconnexa-go-client/issues/14#issuecomment-2206887478