published on Tuesday, Mar 24, 2026 by g-core
published on Tuesday, Mar 24, 2026 by g-core
Subnets define IP address ranges within a network for instance connectivity, with support for DHCP and DNS configuration.
Example Usage
IPv4 subnet with custom DNS and host routes
Creates an IPv4 subnet with DHCP, custom DNS nameservers, and static host routes.
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
// Create an IPv4 subnet with custom DNS and host routes
const subnetIpv4 = new gcore.CloudNetworkSubnet("subnet_ipv4", {
projectId: 1,
regionId: 1,
name: "subnet-ipv4",
cidr: "192.168.10.0/24",
networkId: network.id,
dnsNameservers: [
"8.8.4.4",
"1.1.1.1",
],
enableDhcp: true,
gatewayIp: "192.168.10.1",
ipVersion: 4,
hostRoutes: [
{
destination: "10.0.3.0/24",
nexthop: "10.0.0.13",
},
{
destination: "10.0.4.0/24",
nexthop: "10.0.0.14",
},
],
tags: {
environment: "production",
},
});
import pulumi
import pulumi_gcore as gcore
# Create an IPv4 subnet with custom DNS and host routes
subnet_ipv4 = gcore.CloudNetworkSubnet("subnet_ipv4",
project_id=1,
region_id=1,
name="subnet-ipv4",
cidr="192.168.10.0/24",
network_id=network["id"],
dns_nameservers=[
"8.8.4.4",
"1.1.1.1",
],
enable_dhcp=True,
gateway_ip="192.168.10.1",
ip_version=4,
host_routes=[
{
"destination": "10.0.3.0/24",
"nexthop": "10.0.0.13",
},
{
"destination": "10.0.4.0/24",
"nexthop": "10.0.0.14",
},
],
tags={
"environment": "production",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/v2/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create an IPv4 subnet with custom DNS and host routes
_, err := gcore.NewCloudNetworkSubnet(ctx, "subnet_ipv4", &gcore.CloudNetworkSubnetArgs{
ProjectId: pulumi.Float64(1),
RegionId: pulumi.Float64(1),
Name: pulumi.String("subnet-ipv4"),
Cidr: pulumi.String("192.168.10.0/24"),
NetworkId: pulumi.Any(network.Id),
DnsNameservers: pulumi.StringArray{
pulumi.String("8.8.4.4"),
pulumi.String("1.1.1.1"),
},
EnableDhcp: pulumi.Bool(true),
GatewayIp: pulumi.String("192.168.10.1"),
IpVersion: pulumi.Float64(4),
HostRoutes: gcore.CloudNetworkSubnetHostRouteArray{
&gcore.CloudNetworkSubnetHostRouteArgs{
Destination: pulumi.String("10.0.3.0/24"),
Nexthop: pulumi.String("10.0.0.13"),
},
&gcore.CloudNetworkSubnetHostRouteArgs{
Destination: pulumi.String("10.0.4.0/24"),
Nexthop: pulumi.String("10.0.0.14"),
},
},
Tags: pulumi.StringMap{
"environment": pulumi.String("production"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
// Create an IPv4 subnet with custom DNS and host routes
var subnetIpv4 = new Gcore.CloudNetworkSubnet("subnet_ipv4", new()
{
ProjectId = 1,
RegionId = 1,
Name = "subnet-ipv4",
Cidr = "192.168.10.0/24",
NetworkId = network.Id,
DnsNameservers = new[]
{
"8.8.4.4",
"1.1.1.1",
},
EnableDhcp = true,
GatewayIp = "192.168.10.1",
IpVersion = 4,
HostRoutes = new[]
{
new Gcore.Inputs.CloudNetworkSubnetHostRouteArgs
{
Destination = "10.0.3.0/24",
Nexthop = "10.0.0.13",
},
new Gcore.Inputs.CloudNetworkSubnetHostRouteArgs
{
Destination = "10.0.4.0/24",
Nexthop = "10.0.0.14",
},
},
Tags =
{
{ "environment", "production" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.CloudNetworkSubnet;
import com.pulumi.gcore.CloudNetworkSubnetArgs;
import com.pulumi.gcore.inputs.CloudNetworkSubnetHostRouteArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Create an IPv4 subnet with custom DNS and host routes
var subnetIpv4 = new CloudNetworkSubnet("subnetIpv4", CloudNetworkSubnetArgs.builder()
.projectId(1.0)
.regionId(1.0)
.name("subnet-ipv4")
.cidr("192.168.10.0/24")
.networkId(network.id())
.dnsNameservers(
"8.8.4.4",
"1.1.1.1")
.enableDhcp(true)
.gatewayIp("192.168.10.1")
.ipVersion(4.0)
.hostRoutes(
CloudNetworkSubnetHostRouteArgs.builder()
.destination("10.0.3.0/24")
.nexthop("10.0.0.13")
.build(),
CloudNetworkSubnetHostRouteArgs.builder()
.destination("10.0.4.0/24")
.nexthop("10.0.0.14")
.build())
.tags(Map.of("environment", "production"))
.build());
}
}
resources:
# Create an IPv4 subnet with custom DNS and host routes
subnetIpv4:
type: gcore:CloudNetworkSubnet
name: subnet_ipv4
properties:
projectId: 1
regionId: 1
name: subnet-ipv4
cidr: 192.168.10.0/24
networkId: ${network.id}
dnsNameservers:
- 8.8.4.4
- 1.1.1.1
enableDhcp: true
gatewayIp: 192.168.10.1
ipVersion: 4
hostRoutes:
- destination: 10.0.3.0/24
nexthop: 10.0.0.13
- destination: 10.0.4.0/24
nexthop: 10.0.0.14
tags:
environment: production
IPv6 subnet
Creates a basic IPv6 subnet.
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
// Create an IPv6 subnet
const subnetIpv6 = new gcore.CloudNetworkSubnet("subnet_ipv6", {
projectId: 1,
regionId: 1,
name: "subnet-ipv6",
cidr: "fd00::/8",
networkId: network.id,
ipVersion: 6,
});
import pulumi
import pulumi_gcore as gcore
# Create an IPv6 subnet
subnet_ipv6 = gcore.CloudNetworkSubnet("subnet_ipv6",
project_id=1,
region_id=1,
name="subnet-ipv6",
cidr="fd00::/8",
network_id=network["id"],
ip_version=6)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/v2/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create an IPv6 subnet
_, err := gcore.NewCloudNetworkSubnet(ctx, "subnet_ipv6", &gcore.CloudNetworkSubnetArgs{
ProjectId: pulumi.Float64(1),
RegionId: pulumi.Float64(1),
Name: pulumi.String("subnet-ipv6"),
Cidr: pulumi.String("fd00::/8"),
NetworkId: pulumi.Any(network.Id),
IpVersion: pulumi.Float64(6),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
// Create an IPv6 subnet
var subnetIpv6 = new Gcore.CloudNetworkSubnet("subnet_ipv6", new()
{
ProjectId = 1,
RegionId = 1,
Name = "subnet-ipv6",
Cidr = "fd00::/8",
NetworkId = network.Id,
IpVersion = 6,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.CloudNetworkSubnet;
import com.pulumi.gcore.CloudNetworkSubnetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Create an IPv6 subnet
var subnetIpv6 = new CloudNetworkSubnet("subnetIpv6", CloudNetworkSubnetArgs.builder()
.projectId(1.0)
.regionId(1.0)
.name("subnet-ipv6")
.cidr("fd00::/8")
.networkId(network.id())
.ipVersion(6.0)
.build());
}
}
resources:
# Create an IPv6 subnet
subnetIpv6:
type: gcore:CloudNetworkSubnet
name: subnet_ipv6
properties:
projectId: 1
regionId: 1
name: subnet-ipv6
cidr: fd00::/8
networkId: ${network.id}
ipVersion: 6
Create CloudNetworkSubnet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CloudNetworkSubnet(name: string, args: CloudNetworkSubnetArgs, opts?: CustomResourceOptions);@overload
def CloudNetworkSubnet(resource_name: str,
args: CloudNetworkSubnetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CloudNetworkSubnet(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr: Optional[str] = None,
network_id: Optional[str] = None,
dns_nameservers: Optional[Sequence[str]] = None,
enable_dhcp: Optional[bool] = None,
gateway_ip: Optional[str] = None,
host_routes: Optional[Sequence[CloudNetworkSubnetHostRouteArgs]] = None,
ip_version: Optional[float] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
region_id: Optional[float] = None,
tags: Optional[Mapping[str, str]] = None)func NewCloudNetworkSubnet(ctx *Context, name string, args CloudNetworkSubnetArgs, opts ...ResourceOption) (*CloudNetworkSubnet, error)public CloudNetworkSubnet(string name, CloudNetworkSubnetArgs args, CustomResourceOptions? opts = null)
public CloudNetworkSubnet(String name, CloudNetworkSubnetArgs args)
public CloudNetworkSubnet(String name, CloudNetworkSubnetArgs args, CustomResourceOptions options)
type: gcore:CloudNetworkSubnet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CloudNetworkSubnetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CloudNetworkSubnetArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CloudNetworkSubnetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudNetworkSubnetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CloudNetworkSubnetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var cloudNetworkSubnetResource = new Gcore.CloudNetworkSubnet("cloudNetworkSubnetResource", new()
{
Cidr = "string",
NetworkId = "string",
DnsNameservers = new[]
{
"string",
},
EnableDhcp = false,
GatewayIp = "string",
HostRoutes = new[]
{
new Gcore.Inputs.CloudNetworkSubnetHostRouteArgs
{
Destination = "string",
Nexthop = "string",
},
},
IpVersion = 0,
Name = "string",
ProjectId = 0,
RegionId = 0,
Tags =
{
{ "string", "string" },
},
});
example, err := gcore.NewCloudNetworkSubnet(ctx, "cloudNetworkSubnetResource", &gcore.CloudNetworkSubnetArgs{
Cidr: pulumi.String("string"),
NetworkId: pulumi.String("string"),
DnsNameservers: pulumi.StringArray{
pulumi.String("string"),
},
EnableDhcp: pulumi.Bool(false),
GatewayIp: pulumi.String("string"),
HostRoutes: gcore.CloudNetworkSubnetHostRouteArray{
&gcore.CloudNetworkSubnetHostRouteArgs{
Destination: pulumi.String("string"),
Nexthop: pulumi.String("string"),
},
},
IpVersion: pulumi.Float64(0),
Name: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
RegionId: pulumi.Float64(0),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var cloudNetworkSubnetResource = new CloudNetworkSubnet("cloudNetworkSubnetResource", CloudNetworkSubnetArgs.builder()
.cidr("string")
.networkId("string")
.dnsNameservers("string")
.enableDhcp(false)
.gatewayIp("string")
.hostRoutes(CloudNetworkSubnetHostRouteArgs.builder()
.destination("string")
.nexthop("string")
.build())
.ipVersion(0.0)
.name("string")
.projectId(0.0)
.regionId(0.0)
.tags(Map.of("string", "string"))
.build());
cloud_network_subnet_resource = gcore.CloudNetworkSubnet("cloudNetworkSubnetResource",
cidr="string",
network_id="string",
dns_nameservers=["string"],
enable_dhcp=False,
gateway_ip="string",
host_routes=[{
"destination": "string",
"nexthop": "string",
}],
ip_version=0,
name="string",
project_id=0,
region_id=0,
tags={
"string": "string",
})
const cloudNetworkSubnetResource = new gcore.CloudNetworkSubnet("cloudNetworkSubnetResource", {
cidr: "string",
networkId: "string",
dnsNameservers: ["string"],
enableDhcp: false,
gatewayIp: "string",
hostRoutes: [{
destination: "string",
nexthop: "string",
}],
ipVersion: 0,
name: "string",
projectId: 0,
regionId: 0,
tags: {
string: "string",
},
});
type: gcore:CloudNetworkSubnet
properties:
cidr: string
dnsNameservers:
- string
enableDhcp: false
gatewayIp: string
hostRoutes:
- destination: string
nexthop: string
ipVersion: 0
name: string
networkId: string
projectId: 0
regionId: 0
tags:
string: string
CloudNetworkSubnet Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CloudNetworkSubnet resource accepts the following input properties:
- Cidr string
- CIDR
- Network
Id string - Network ID
- Dns
Nameservers List<string> - List IP addresses of DNS servers to advertise via DHCP.
- Enable
Dhcp bool - True if DHCP should be enabled
- Gateway
Ip string - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- Host
Routes List<CloudNetwork Subnet Host Route> - List of custom static routes to advertise via DHCP.
- Ip
Version double - IP version Available values: 4, 6.
- Name string
- Subnet name
- Project
Id double - Project ID
- Region
Id double - Region ID
- Dictionary<string, string>
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- Cidr string
- CIDR
- Network
Id string - Network ID
- Dns
Nameservers []string - List IP addresses of DNS servers to advertise via DHCP.
- Enable
Dhcp bool - True if DHCP should be enabled
- Gateway
Ip string - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- Host
Routes []CloudNetwork Subnet Host Route Args - List of custom static routes to advertise via DHCP.
- Ip
Version float64 - IP version Available values: 4, 6.
- Name string
- Subnet name
- Project
Id float64 - Project ID
- Region
Id float64 - Region ID
- map[string]string
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- cidr String
- CIDR
- network
Id String - Network ID
- dns
Nameservers List<String> - List IP addresses of DNS servers to advertise via DHCP.
- enable
Dhcp Boolean - True if DHCP should be enabled
- gateway
Ip String - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- host
Routes List<CloudNetwork Subnet Host Route> - List of custom static routes to advertise via DHCP.
- ip
Version Double - IP version Available values: 4, 6.
- name String
- Subnet name
- project
Id Double - Project ID
- region
Id Double - Region ID
- Map<String,String>
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- cidr string
- CIDR
- network
Id string - Network ID
- dns
Nameservers string[] - List IP addresses of DNS servers to advertise via DHCP.
- enable
Dhcp boolean - True if DHCP should be enabled
- gateway
Ip string - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- host
Routes CloudNetwork Subnet Host Route[] - List of custom static routes to advertise via DHCP.
- ip
Version number - IP version Available values: 4, 6.
- name string
- Subnet name
- project
Id number - Project ID
- region
Id number - Region ID
- {[key: string]: string}
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- cidr str
- CIDR
- network_
id str - Network ID
- dns_
nameservers Sequence[str] - List IP addresses of DNS servers to advertise via DHCP.
- enable_
dhcp bool - True if DHCP should be enabled
- gateway_
ip str - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- host_
routes Sequence[CloudNetwork Subnet Host Route Args] - List of custom static routes to advertise via DHCP.
- ip_
version float - IP version Available values: 4, 6.
- name str
- Subnet name
- project_
id float - Project ID
- region_
id float - Region ID
- Mapping[str, str]
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- cidr String
- CIDR
- network
Id String - Network ID
- dns
Nameservers List<String> - List IP addresses of DNS servers to advertise via DHCP.
- enable
Dhcp Boolean - True if DHCP should be enabled
- gateway
Ip String - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- host
Routes List<Property Map> - List of custom static routes to advertise via DHCP.
- ip
Version Number - IP version Available values: 4, 6.
- name String
- Subnet name
- project
Id Number - Project ID
- region
Id Number - Region ID
- Map<String>
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
Outputs
All input properties are implicitly available as output properties. Additionally, the CloudNetworkSubnet resource produces the following output properties:
- Available
Ips double - Number of available ips in subnet
- Created
At string - Datetime when the subnet was created
- Creator
Task stringId - Task that created this entity
- Has
Router bool - Deprecated. Always returns
false. - Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Region name
- Total
Ips double - Total number of ips in subnet
- Updated
At string - Datetime when the subnet was last updated
- Available
Ips float64 - Number of available ips in subnet
- Created
At string - Datetime when the subnet was created
- Creator
Task stringId - Task that created this entity
- Has
Router bool - Deprecated. Always returns
false. - Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- Region name
- Total
Ips float64 - Total number of ips in subnet
- Updated
At string - Datetime when the subnet was last updated
- available
Ips Double - Number of available ips in subnet
- created
At String - Datetime when the subnet was created
- creator
Task StringId - Task that created this entity
- has
Router Boolean - Deprecated. Always returns
false. - id String
- The provider-assigned unique ID for this managed resource.
- region String
- Region name
- total
Ips Double - Total number of ips in subnet
- updated
At String - Datetime when the subnet was last updated
- available
Ips number - Number of available ips in subnet
- created
At string - Datetime when the subnet was created
- creator
Task stringId - Task that created this entity
- has
Router boolean - Deprecated. Always returns
false. - id string
- The provider-assigned unique ID for this managed resource.
- region string
- Region name
- total
Ips number - Total number of ips in subnet
- updated
At string - Datetime when the subnet was last updated
- available_
ips float - Number of available ips in subnet
- created_
at str - Datetime when the subnet was created
- creator_
task_ strid - Task that created this entity
- has_
router bool - Deprecated. Always returns
false. - id str
- The provider-assigned unique ID for this managed resource.
- region str
- Region name
- total_
ips float - Total number of ips in subnet
- updated_
at str - Datetime when the subnet was last updated
- available
Ips Number - Number of available ips in subnet
- created
At String - Datetime when the subnet was created
- creator
Task StringId - Task that created this entity
- has
Router Boolean - Deprecated. Always returns
false. - id String
- The provider-assigned unique ID for this managed resource.
- region String
- Region name
- total
Ips Number - Total number of ips in subnet
- updated
At String - Datetime when the subnet was last updated
Look up Existing CloudNetworkSubnet Resource
Get an existing CloudNetworkSubnet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CloudNetworkSubnetState, opts?: CustomResourceOptions): CloudNetworkSubnet@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
available_ips: Optional[float] = None,
cidr: Optional[str] = None,
created_at: Optional[str] = None,
creator_task_id: Optional[str] = None,
dns_nameservers: Optional[Sequence[str]] = None,
enable_dhcp: Optional[bool] = None,
gateway_ip: Optional[str] = None,
has_router: Optional[bool] = None,
host_routes: Optional[Sequence[CloudNetworkSubnetHostRouteArgs]] = None,
ip_version: Optional[float] = None,
name: Optional[str] = None,
network_id: Optional[str] = None,
project_id: Optional[float] = None,
region: Optional[str] = None,
region_id: Optional[float] = None,
tags: Optional[Mapping[str, str]] = None,
total_ips: Optional[float] = None,
updated_at: Optional[str] = None) -> CloudNetworkSubnetfunc GetCloudNetworkSubnet(ctx *Context, name string, id IDInput, state *CloudNetworkSubnetState, opts ...ResourceOption) (*CloudNetworkSubnet, error)public static CloudNetworkSubnet Get(string name, Input<string> id, CloudNetworkSubnetState? state, CustomResourceOptions? opts = null)public static CloudNetworkSubnet get(String name, Output<String> id, CloudNetworkSubnetState state, CustomResourceOptions options)resources: _: type: gcore:CloudNetworkSubnet get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Available
Ips double - Number of available ips in subnet
- Cidr string
- CIDR
- Created
At string - Datetime when the subnet was created
- Creator
Task stringId - Task that created this entity
- Dns
Nameservers List<string> - List IP addresses of DNS servers to advertise via DHCP.
- Enable
Dhcp bool - True if DHCP should be enabled
- Gateway
Ip string - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- Has
Router bool - Deprecated. Always returns
false. - Host
Routes List<CloudNetwork Subnet Host Route> - List of custom static routes to advertise via DHCP.
- Ip
Version double - IP version Available values: 4, 6.
- Name string
- Subnet name
- Network
Id string - Network ID
- Project
Id double - Project ID
- Region string
- Region name
- Region
Id double - Region ID
- Dictionary<string, string>
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- Total
Ips double - Total number of ips in subnet
- Updated
At string - Datetime when the subnet was last updated
- Available
Ips float64 - Number of available ips in subnet
- Cidr string
- CIDR
- Created
At string - Datetime when the subnet was created
- Creator
Task stringId - Task that created this entity
- Dns
Nameservers []string - List IP addresses of DNS servers to advertise via DHCP.
- Enable
Dhcp bool - True if DHCP should be enabled
- Gateway
Ip string - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- Has
Router bool - Deprecated. Always returns
false. - Host
Routes []CloudNetwork Subnet Host Route Args - List of custom static routes to advertise via DHCP.
- Ip
Version float64 - IP version Available values: 4, 6.
- Name string
- Subnet name
- Network
Id string - Network ID
- Project
Id float64 - Project ID
- Region string
- Region name
- Region
Id float64 - Region ID
- map[string]string
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- Total
Ips float64 - Total number of ips in subnet
- Updated
At string - Datetime when the subnet was last updated
- available
Ips Double - Number of available ips in subnet
- cidr String
- CIDR
- created
At String - Datetime when the subnet was created
- creator
Task StringId - Task that created this entity
- dns
Nameservers List<String> - List IP addresses of DNS servers to advertise via DHCP.
- enable
Dhcp Boolean - True if DHCP should be enabled
- gateway
Ip String - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- has
Router Boolean - Deprecated. Always returns
false. - host
Routes List<CloudNetwork Subnet Host Route> - List of custom static routes to advertise via DHCP.
- ip
Version Double - IP version Available values: 4, 6.
- name String
- Subnet name
- network
Id String - Network ID
- project
Id Double - Project ID
- region String
- Region name
- region
Id Double - Region ID
- Map<String,String>
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- total
Ips Double - Total number of ips in subnet
- updated
At String - Datetime when the subnet was last updated
- available
Ips number - Number of available ips in subnet
- cidr string
- CIDR
- created
At string - Datetime when the subnet was created
- creator
Task stringId - Task that created this entity
- dns
Nameservers string[] - List IP addresses of DNS servers to advertise via DHCP.
- enable
Dhcp boolean - True if DHCP should be enabled
- gateway
Ip string - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- has
Router boolean - Deprecated. Always returns
false. - host
Routes CloudNetwork Subnet Host Route[] - List of custom static routes to advertise via DHCP.
- ip
Version number - IP version Available values: 4, 6.
- name string
- Subnet name
- network
Id string - Network ID
- project
Id number - Project ID
- region string
- Region name
- region
Id number - Region ID
- {[key: string]: string}
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- total
Ips number - Total number of ips in subnet
- updated
At string - Datetime when the subnet was last updated
- available_
ips float - Number of available ips in subnet
- cidr str
- CIDR
- created_
at str - Datetime when the subnet was created
- creator_
task_ strid - Task that created this entity
- dns_
nameservers Sequence[str] - List IP addresses of DNS servers to advertise via DHCP.
- enable_
dhcp bool - True if DHCP should be enabled
- gateway_
ip str - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- has_
router bool - Deprecated. Always returns
false. - host_
routes Sequence[CloudNetwork Subnet Host Route Args] - List of custom static routes to advertise via DHCP.
- ip_
version float - IP version Available values: 4, 6.
- name str
- Subnet name
- network_
id str - Network ID
- project_
id float - Project ID
- region str
- Region name
- region_
id float - Region ID
- Mapping[str, str]
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- total_
ips float - Total number of ips in subnet
- updated_
at str - Datetime when the subnet was last updated
- available
Ips Number - Number of available ips in subnet
- cidr String
- CIDR
- created
At String - Datetime when the subnet was created
- creator
Task StringId - Task that created this entity
- dns
Nameservers List<String> - List IP addresses of DNS servers to advertise via DHCP.
- enable
Dhcp Boolean - True if DHCP should be enabled
- gateway
Ip String - Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
- has
Router Boolean - Deprecated. Always returns
false. - host
Routes List<Property Map> - List of custom static routes to advertise via DHCP.
- ip
Version Number - IP version Available values: 4, 6.
- name String
- Subnet name
- network
Id String - Network ID
- project
Id Number - Project ID
- region String
- Region name
- region
Id Number - Region ID
- Map<String>
- Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
- total
Ips Number - Total number of ips in subnet
- updated
At String - Datetime when the subnet was last updated
Supporting Types
CloudNetworkSubnetHostRoute, CloudNetworkSubnetHostRouteArgs
- Destination string
- CIDR of destination IPv4 subnet.
- Nexthop string
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR.
- Destination string
- CIDR of destination IPv4 subnet.
- Nexthop string
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR.
- destination String
- CIDR of destination IPv4 subnet.
- nexthop String
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR.
- destination string
- CIDR of destination IPv4 subnet.
- nexthop string
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR.
- destination str
- CIDR of destination IPv4 subnet.
- nexthop str
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR.
- destination String
- CIDR of destination IPv4 subnet.
- nexthop String
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR.
Import
$ pulumi import gcore:index/cloudNetworkSubnet:CloudNetworkSubnet example '<project_id>/<region_id>/<subnet_id>'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcoreTerraform Provider.
published on Tuesday, Mar 24, 2026 by g-core
