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

[BUG] "Invalid region" error when using OVH Terraform module ovh_cloud_project_network_private and Local Zone #802

Open
jtrebaol opened this issue Jan 14, 2025 · 2 comments

Comments

@jtrebaol
Copy link

Describe the bug

Issue is only observed with Terraform module "ovh_cloud_project_network_private" and Local Zone. No issue with module OpenStack "openstack_networking_network_v2"

Terraform Version

OpenTofu v1.8.5

OVH Terraform Provider Version

  • Using previously-installed terraform-provider-openstack/openstack v3.0.0
  • Using previously-installed ovh/ovh v1.1.0
  • Using previously-installed hashicorp/null v3.2.3
  • Using previously-installed hashicorp/template v2.2.0
  • Using previously-installed hashicorp/aws v4.67.0
  • Using previously-installed ansible/ansible v1.3.0

Affected Resource(s)

Please list the resources as a list, for example:

  • ovh_cloud_project_network_private
  • ovh_cloud_project_network_private_subnet

Terraform Configuration Files

# Case NOK:
 resource "ovh_cloud_project_network_private" "test" {
  service_name = "2f23ff001e304c81a88c728cf68c739e"
  name         = "madrid"
  regions      = ["EU-SOUTH-LZ-MAD-A"]
  provider     = ovh.ovh
  vlan_id      = 0 
 }

# Case OK:
resource "openstack_networking_network_v2" "network-mad" {
name = "test_mad"
admin_state_up = "true"
region = "EU-SOUTH-LZ-MAD-A"
}

Debug Output

│ Error: calling /cloud/project/2f23ff001e304c81a88c728cf68c739e/network/private with params projectId: 2f23ff001e304c81a88c728cf68c739e, vlanId:98, name: Private_network_MAD, regions: [EU-SOUTH-LZ-MAD-A]:
│ "OVHcloud API error (status code 400): Client::BadRequest: "Invalid region EU-SOUTH-LZ-MAD-A" (X-OVH-Query-Id: EU.ext-4.677f8595.2300585.24b33c1c8894afd19f753b041caea0fb)"

Expected Behavior

ovh_cloud_project_network_private and ovh_cloud_project_network_private_subnet shall support Local Zones region

Actual Behavior

Seems the Local Zones region are not supported yet on ovh modules

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. create the network.tf file with above example
  2. 'tofu apply'

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • Case issue open with OVH support team, reference CS10627686
@amstuta
Copy link
Contributor

amstuta commented Jan 15, 2025

Hello @jtrebaol,

You are right, the resource ovh_cloud_project_network_private is indeed not able to interact with local zones.
It is due to the fact that this resource relies on the legacy API route POST /cloud/project/{serviceName}/network/private and not on the new one POST /cloud/project/{serviceName}/region/{regionName}/network.

After checking, we have no easy way to update the current resource to handle the local zones, so we will add a new resource ovh_cloud_project_network_private_v2 shortly.

@jtrebaol
Copy link
Author

Thanks @amstuta for your analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants