scaleway / terraform-provider-scaleway

Terraform Scaleway provider
https://www.terraform.io/docs/providers/scaleway/
Mozilla Public License 2.0
199 stars 125 forks source link

scaleway_iot_network does not accept region parameter #2773

Closed mrohlof-protofy closed 1 month ago

mrohlof-protofy commented 1 month ago

Community Note

Terraform Version

1.8.3

Affected Resource(s)

Terraform Configuration Files

resource "scaleway_iot_network" "iot_network" {
  region = "fr-par"
  name   = "rest-network-${terraform.workspace}"
  hub_id = scaleway_iot_hub.iot_hub.id
  type   = "rest"
}

Debug Output

ā”‚ Error: Unsupported argument ā”‚ ā”‚ on main.tf line 148, in resource "scaleway_iot_network" "iot_network": ā”‚ 148: region = "fr-par" ā”‚ ā”‚ An argument named "region" is not expected here.

or, if region is left out but the project provider is nl-ams:

ā”‚ Error: scaleway-sdk-go: http error 501 Not Implemented: unknown service ā”‚ ā”‚ with scaleway_iot_network.iot_network, ā”‚ on main.tf line 147, in resource "scaleway_iot_network" "iot_network": ā”‚ 147: resource "scaleway_iot_network" "iot_network" { ā”‚

Expected Behavior

If my provider region is set to "nl-ams", I should still be able to create a scaleway_iot_network in region fr-par. Either through the network resource seeing in which region its hub is or through a region parameter.

Actual Behavior

If the Scaleway provider is set to region "nl-ams", there is no way to create a scaleway_iot_network resource, because:

The IoT Hub has to be in region fr-par. No problem, since it accepts a region parameter. All resources within that hub must be in fr-par, as well. Not a problem for scaleway_iot_route, since that also accepts a region parameter. BUT: scaleway_iot_network does not accept the region parameter, which means it always default to the provider - which is nl-ams in my case.

Steps to Reproduce

  1. Configure provider with region nl-ams
  2. Add scaleway_iot_hub with region fr-par
  3. Try to add scaleway_iot_network