arvancloud_iaas_network (Resource)
Manages an IaaS private network (network + subnet) in a specific availability zone.
Example Usage
resource "arvancloud_iaas_network" "example" {
name = "my-private-network"
availability_zone = "ir-central1-a"
cidr = "192.168.1.0/24"
subnet_gateway = "192.168.1.1"
enable_gateway = true
enable_dhcp = true
dhcp_range = "192.168.1.50-192.168.1.100,192.168.1.150-192.168.1.200"
dns_servers = "8.8.8.8,8.8.4.4"
}
output "network_id" {
value = arvancloud_iaas_network.example.id
}
output "subnet_id" {
value = arvancloud_iaas_network.example.subnet_id
}
output "status" {
value = arvancloud_iaas_network.example.status
}
output "region" {
value = arvancloud_iaas_network.example.region
}
output "gateway_ip" {
value = arvancloud_iaas_network.example.gateway_ip
}
Schema
Required
availability_zone(String) Availability zone where the network will be created (e.g.ir-central1-a).cidr(String) CIDR block for the subnet (e.g.192.168.1.0/24). The CIDR can not be changed after creation.dhcp_range(String) DHCP allocation range for the subnet (e.g.192.168.1.10,192.168.1.100). If this is empty, the dhcp will be considered as disabled.dns_servers(String) DNS servers for the subnet as a comma-separated string (e.g.8.8.8.8,8.8.4.4).enable_dhcp(Boolean) Whether to enable DHCP for the subnet.enable_gateway(Boolean) Whether to enable a gateway for the subnet.name(String) Name of the network.
Optional
subnet_gateway(String) Gateway IP address for the subnet. Defaults to the first usable IP in the CIDR if not set.
Read-Only
created_at(String) Timestamp when the network was created.id(String) Unique identifier of the network assigned by the API.ip_version(String) IP version of the primary subnet (e.g.4or6).region(String) Region where the network is located (e.g.ir-central1).shared(Boolean) Whether the network is shared across projects.status(String) Current status of the network (e.g.ACTIVE).subnet_id(String) Unique identifier of the primary subnet.updated_at(String) Timestamp when the network was last updated.
Import
Import is supported using the following syntax:
terraform import arvancloud_iaas_network.example ir-central1-a:d1e6194a-25e1-47c7-87c6-22609184d2d3