1. Packages
  2. Gcore Provider
  3. API Docs
  4. CloudNetworkSubnet
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 2026 by g-core
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 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.Index.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
    NetworkId string
    Network ID
    DnsNameservers List<string>
    List IP addresses of DNS servers to advertise via DHCP.
    EnableDhcp bool
    True if DHCP should be enabled
    GatewayIp 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).
    HostRoutes List<CloudNetworkSubnetHostRoute>
    List of custom static routes to advertise via DHCP.
    IpVersion double
    IP version Available values: 4, 6.
    Name string
    Subnet name
    ProjectId double
    Project ID
    RegionId double
    Region ID
    Tags 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
    NetworkId string
    Network ID
    DnsNameservers []string
    List IP addresses of DNS servers to advertise via DHCP.
    EnableDhcp bool
    True if DHCP should be enabled
    GatewayIp 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).
    HostRoutes []CloudNetworkSubnetHostRouteArgs
    List of custom static routes to advertise via DHCP.
    IpVersion float64
    IP version Available values: 4, 6.
    Name string
    Subnet name
    ProjectId float64
    Project ID
    RegionId float64
    Region ID
    Tags 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
    networkId String
    Network ID
    dnsNameservers List<String>
    List IP addresses of DNS servers to advertise via DHCP.
    enableDhcp Boolean
    True if DHCP should be enabled
    gatewayIp 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).
    hostRoutes List<CloudNetworkSubnetHostRoute>
    List of custom static routes to advertise via DHCP.
    ipVersion Double
    IP version Available values: 4, 6.
    name String
    Subnet name
    projectId Double
    Project ID
    regionId Double
    Region ID
    tags 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
    networkId string
    Network ID
    dnsNameservers string[]
    List IP addresses of DNS servers to advertise via DHCP.
    enableDhcp boolean
    True if DHCP should be enabled
    gatewayIp 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).
    hostRoutes CloudNetworkSubnetHostRoute[]
    List of custom static routes to advertise via DHCP.
    ipVersion number
    IP version Available values: 4, 6.
    name string
    Subnet name
    projectId number
    Project ID
    regionId number
    Region ID
    tags {[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[CloudNetworkSubnetHostRouteArgs]
    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
    tags 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
    networkId String
    Network ID
    dnsNameservers List<String>
    List IP addresses of DNS servers to advertise via DHCP.
    enableDhcp Boolean
    True if DHCP should be enabled
    gatewayIp 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).
    hostRoutes List<Property Map>
    List of custom static routes to advertise via DHCP.
    ipVersion Number
    IP version Available values: 4, 6.
    name String
    Subnet name
    projectId Number
    Project ID
    regionId Number
    Region ID
    tags 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:

    AvailableIps double
    Number of available ips in subnet
    CreatedAt string
    Datetime when the subnet was created
    CreatorTaskId string
    Task that created this entity
    HasRouter bool
    Deprecated. Always returns false.

    Deprecated: Deprecated

    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Region name
    TotalIps double
    Total number of ips in subnet
    UpdatedAt string
    Datetime when the subnet was last updated
    AvailableIps float64
    Number of available ips in subnet
    CreatedAt string
    Datetime when the subnet was created
    CreatorTaskId string
    Task that created this entity
    HasRouter bool
    Deprecated. Always returns false.

    Deprecated: Deprecated

    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Region name
    TotalIps float64
    Total number of ips in subnet
    UpdatedAt string
    Datetime when the subnet was last updated
    availableIps Double
    Number of available ips in subnet
    createdAt String
    Datetime when the subnet was created
    creatorTaskId String
    Task that created this entity
    hasRouter Boolean
    Deprecated. Always returns false.

    Deprecated: Deprecated

    id String
    The provider-assigned unique ID for this managed resource.
    region String
    Region name
    totalIps Double
    Total number of ips in subnet
    updatedAt String
    Datetime when the subnet was last updated
    availableIps number
    Number of available ips in subnet
    createdAt string
    Datetime when the subnet was created
    creatorTaskId string
    Task that created this entity
    hasRouter boolean
    Deprecated. Always returns false.

    Deprecated: Deprecated

    id string
    The provider-assigned unique ID for this managed resource.
    region string
    Region name
    totalIps number
    Total number of ips in subnet
    updatedAt 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_id str
    Task that created this entity
    has_router bool
    Deprecated. Always returns false.

    Deprecated: Deprecated

    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
    availableIps Number
    Number of available ips in subnet
    createdAt String
    Datetime when the subnet was created
    creatorTaskId String
    Task that created this entity
    hasRouter Boolean
    Deprecated. Always returns false.

    Deprecated: Deprecated

    id String
    The provider-assigned unique ID for this managed resource.
    region String
    Region name
    totalIps Number
    Total number of ips in subnet
    updatedAt 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) -> CloudNetworkSubnet
    func 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.
    The following state arguments are supported:
    AvailableIps double
    Number of available ips in subnet
    Cidr string
    CIDR
    CreatedAt string
    Datetime when the subnet was created
    CreatorTaskId string
    Task that created this entity
    DnsNameservers List<string>
    List IP addresses of DNS servers to advertise via DHCP.
    EnableDhcp bool
    True if DHCP should be enabled
    GatewayIp 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).
    HasRouter bool
    Deprecated. Always returns false.

    Deprecated: Deprecated

    HostRoutes List<CloudNetworkSubnetHostRoute>
    List of custom static routes to advertise via DHCP.
    IpVersion double
    IP version Available values: 4, 6.
    Name string
    Subnet name
    NetworkId string
    Network ID
    ProjectId double
    Project ID
    Region string
    Region name
    RegionId double
    Region ID
    Tags 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.
    TotalIps double
    Total number of ips in subnet
    UpdatedAt string
    Datetime when the subnet was last updated
    AvailableIps float64
    Number of available ips in subnet
    Cidr string
    CIDR
    CreatedAt string
    Datetime when the subnet was created
    CreatorTaskId string
    Task that created this entity
    DnsNameservers []string
    List IP addresses of DNS servers to advertise via DHCP.
    EnableDhcp bool
    True if DHCP should be enabled
    GatewayIp 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).
    HasRouter bool
    Deprecated. Always returns false.

    Deprecated: Deprecated

    HostRoutes []CloudNetworkSubnetHostRouteArgs
    List of custom static routes to advertise via DHCP.
    IpVersion float64
    IP version Available values: 4, 6.
    Name string
    Subnet name
    NetworkId string
    Network ID
    ProjectId float64
    Project ID
    Region string
    Region name
    RegionId float64
    Region ID
    Tags 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.
    TotalIps float64
    Total number of ips in subnet
    UpdatedAt string
    Datetime when the subnet was last updated
    availableIps Double
    Number of available ips in subnet
    cidr String
    CIDR
    createdAt String
    Datetime when the subnet was created
    creatorTaskId String
    Task that created this entity
    dnsNameservers List<String>
    List IP addresses of DNS servers to advertise via DHCP.
    enableDhcp Boolean
    True if DHCP should be enabled
    gatewayIp 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).
    hasRouter Boolean
    Deprecated. Always returns false.

    Deprecated: Deprecated

    hostRoutes List<CloudNetworkSubnetHostRoute>
    List of custom static routes to advertise via DHCP.
    ipVersion Double
    IP version Available values: 4, 6.
    name String
    Subnet name
    networkId String
    Network ID
    projectId Double
    Project ID
    region String
    Region name
    regionId Double
    Region ID
    tags 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.
    totalIps Double
    Total number of ips in subnet
    updatedAt String
    Datetime when the subnet was last updated
    availableIps number
    Number of available ips in subnet
    cidr string
    CIDR
    createdAt string
    Datetime when the subnet was created
    creatorTaskId string
    Task that created this entity
    dnsNameservers string[]
    List IP addresses of DNS servers to advertise via DHCP.
    enableDhcp boolean
    True if DHCP should be enabled
    gatewayIp 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).
    hasRouter boolean
    Deprecated. Always returns false.

    Deprecated: Deprecated

    hostRoutes CloudNetworkSubnetHostRoute[]
    List of custom static routes to advertise via DHCP.
    ipVersion number
    IP version Available values: 4, 6.
    name string
    Subnet name
    networkId string
    Network ID
    projectId number
    Project ID
    region string
    Region name
    regionId number
    Region ID
    tags {[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.
    totalIps number
    Total number of ips in subnet
    updatedAt 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_id str
    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.

    Deprecated: Deprecated

    host_routes Sequence[CloudNetworkSubnetHostRouteArgs]
    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
    tags 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
    availableIps Number
    Number of available ips in subnet
    cidr String
    CIDR
    createdAt String
    Datetime when the subnet was created
    creatorTaskId String
    Task that created this entity
    dnsNameservers List<String>
    List IP addresses of DNS servers to advertise via DHCP.
    enableDhcp Boolean
    True if DHCP should be enabled
    gatewayIp 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).
    hasRouter Boolean
    Deprecated. Always returns false.

    Deprecated: Deprecated

    hostRoutes List<Property Map>
    List of custom static routes to advertise via DHCP.
    ipVersion Number
    IP version Available values: 4, 6.
    name String
    Subnet name
    networkId String
    Network ID
    projectId Number
    Project ID
    region String
    Region name
    regionId Number
    Region ID
    tags 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.
    totalIps Number
    Total number of ips in subnet
    updatedAt String
    Datetime when the subnet was last updated

    Supporting Types

    CloudNetworkSubnetHostRoute, CloudNetworkSubnetHostRouteArgs

    Destination string
    CIDR of destination IPv4 or IPv6 subnet.
    Nexthop string
    IPv4 or IPv6 address to forward traffic to if it's destination IP matches 'destination' CIDR.
    Destination string
    CIDR of destination IPv4 or IPv6 subnet.
    Nexthop string
    IPv4 or IPv6 address to forward traffic to if it's destination IP matches 'destination' CIDR.
    destination String
    CIDR of destination IPv4 or IPv6 subnet.
    nexthop String
    IPv4 or IPv6 address to forward traffic to if it's destination IP matches 'destination' CIDR.
    destination string
    CIDR of destination IPv4 or IPv6 subnet.
    nexthop string
    IPv4 or IPv6 address to forward traffic to if it's destination IP matches 'destination' CIDR.
    destination str
    CIDR of destination IPv4 or IPv6 subnet.
    nexthop str
    IPv4 or IPv6 address to forward traffic to if it's destination IP matches 'destination' CIDR.
    destination String
    CIDR of destination IPv4 or IPv6 subnet.
    nexthop String
    IPv4 or IPv6 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 gcore Terraform Provider.
    Viewing docs for gcore 2.0.0-alpha.3
    published on Monday, Mar 30, 2026 by g-core
      Try Pulumi Cloud free. Your team will thank you.