terraform-provider-opennebula icon indicating copy to clipboard operation
terraform-provider-opennebula copied to clipboard

Missing Data Source for opennebula_virtual_network_address_range

Open shurkys opened this issue 9 months ago • 0 comments

Description

Currently, there is no Data Source available to retrieve information about IP address ranges dynamically allocated for networks created through the opennebula_service resource in Terraform. This creates difficulties when there is a need to obtain a list of IP addresses allocated from a specific range.

New or affected resources and data sources

New Data Source: opennebula_virtual_network_address_range

Potential terraform configuration

resource "opennebula_service" "example" {
  # Your configuration code for creating the service
}

data "opennebula_virtual_network" "example" {
  id = opennebula_service.example.networks.example_network
}

# Example usage of the proposed data source
data "opennebula_virtual_network_address_range" "example_range" {
  virtual_network_id = opennebula_virtual_network.example.id
}

# Output example
output "network_address_range_held_ips" {
  value = data.opennebula_virtual_network_address_range.example_range.held_ips
}
output "network_address_range_ip4" {
  value = data.opennebula_virtual_network_address_range.example_range.ip4
}
output "network_address_range_size" {
  value = data.opennebula_virtual_network_address_range.example_range.size
}

References

No response

shurkys avatar May 01 '24 10:05 shurkys