|
| 1 | +--- |
| 2 | +layout: "ovh" |
| 3 | +page_title: "OVH: cloud_network_private_subnet" |
| 4 | +sidebar_current: "docs-ovh-resource-cloud-network-private-subnet" |
| 5 | +description: |- |
| 6 | + Creates a subnet in a private network of a public cloud project. |
| 7 | +--- |
| 8 | + |
| 9 | +# ovh_cloud_network_private_subnet |
| 10 | + |
| 11 | +Creates a subnet in a private network of a public cloud project. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +``` |
| 16 | +resource "ovh_cloud_network_private_subnet" "subnet" { |
| 17 | + project_id = "67890" |
| 18 | + network_id = "0234543" |
| 19 | + region = "GRA1" |
| 20 | + start = "192.168.168.100" |
| 21 | + end = "192.168.168.200" |
| 22 | + network = "192.168.168.0/24" |
| 23 | + dhcp = true |
| 24 | + no_gateway = false |
| 25 | +} |
| 26 | +``` |
| 27 | + |
| 28 | +## Argument Reference |
| 29 | + |
| 30 | +The following arguments are supported: |
| 31 | + |
| 32 | +* `project_id` - (Required) The id of the public cloud project. If omitted, |
| 33 | + the `OVH_PROJECT_ID` environment variable is used. |
| 34 | +Changing this forces a new resource to be created. |
| 35 | + |
| 36 | +* `network_id` - (Required) The id of the network. |
| 37 | + Changing this forces a new resource to be created. |
| 38 | + |
| 39 | +* `dhcp` - (Optional) Enable DHCP. |
| 40 | + Changing this forces a new resource to be created. Defaults to false. |
| 41 | +_ |
| 42 | +* `start` - (Required) First ip for this region. |
| 43 | + Changing this value recreates the subnet. |
| 44 | + |
| 45 | +* `end` - (Required) Last ip for this region. |
| 46 | + Changing this value recreates the subnet. |
| 47 | + |
| 48 | +* `network` - (Required) Global network in CIDR format. |
| 49 | + Changing this value recreates the subnet |
| 50 | + |
| 51 | +* `region` - The region in which the network subnet will be created. |
| 52 | + Ex.: "GRA1". Changing this value recreates the resource. |
| 53 | + |
| 54 | +* `no_gateway` - Set to true if you don't want to set a default gateway IP. |
| 55 | + Changing this value recreates the resource. Defaults to false. |
| 56 | + |
| 57 | +## Attributes Reference |
| 58 | + |
| 59 | +The following attributes are exported: |
| 60 | + |
| 61 | +* `project_id` - See Argument Reference above. |
| 62 | +* `network_id` - See Argument Reference above. |
| 63 | +* `dhcp_id` - See Argument Reference above. |
| 64 | +* `start` - See Argument Reference above. |
| 65 | +* `end` - See Argument Reference above. |
| 66 | +* `network` - See Argument Reference above. |
| 67 | +* `region` - See Argument Reference above. |
| 68 | +* `gateway_ip` - The IP of the gateway |
| 69 | +* `no_gateway` - See Argument Reference above. |
| 70 | +* `cidr` - Ip Block representing the subnet cidr. |
| 71 | +* `ip_pools` - List of ip pools allocated in the subnet. |
| 72 | +* `ip_pools/network` - Global network with cidr. |
| 73 | +* `ip_pools/region` - Region where this subnet is created. |
| 74 | +* `ip_pools/dhcp` - DHCP enabled. |
| 75 | +* `ip_pools/end` - Last ip for this region. |
| 76 | +* `ip_pools/start` - First ip for this region. |
| 77 | + |
0 commit comments