-
Notifications
You must be signed in to change notification settings - Fork 138
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
Feature Request: private network region_openstackId #197
Comments
Is any workaround available for terraform? I would like to create an ovh_cloud_project_kube resource with a private network, but it requires the openstackId of the network. |
on the ovh_cloud_project_network_private there is a
|
In which version of the provider is the workaround available? From code in https://github.com/ovh/terraform-provider-ovh/blob/master/ovh/resource_cloud_project_network_private.go it seems it is no longer included in schema. and from https://github.com/ovh/terraform-provider-ovh/blob/master/ovh/types_cloud.go its clear that openstackId is not unmarshalled from the response from api:
Adding a Meanwhile, does anyone know of a workaround, is there perhaps a way to use openstack provider to do the private network creation? |
This works fine with a single region, the id '0' matches your region. |
That'd be trickier, but achievable with latest terraform capabilities (for loop, with an if to find the correct element in the list where region=the value you want) AFAIK. Or, alternatively, loop over the regions_attributes attribute:
Would be easier to read with a local region->openstackid map and a |
Here a good workaround: I have found the base here:
But when I try (terraform v1.2.9 and OVH provider v0.21.0) I have this error:
To fix it, I add the function |
If you want to select the first element you can also use the
|
Ot you can simply use tolist() function and the first index:
|
Nice, maybe we could update doc with your tips ? |
Yes, I added the tip and also several examples in the documentation. |
Seems the issue is fixed by the doc update, closing it. |
for private networks resources
ovh_cloud_project_network_private
, the openstackId of the network in a given region is given by the API, but not exposed by the terraform provider.https://eu.api.ovh.com/console/#/cloud/project/%7BserviceName%7D/network/private#GET
regions
is a list of objects, returning region_name/status/openstackId, and ovh_cloud_project_network_private.regions only gives the name of the regionThe text was updated successfully, but these errors were encountered: