published on Monday, Mar 30, 2026 by g-core
published on Monday, Mar 30, 2026 by g-core
Networks provide software-defined networking infrastructure for connecting instances and other cloud resources within a region.
Example Usage
Network with subnet
Creates a private network with a subnet and custom DNS nameservers.
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
// Create a private network
const network = new gcore.CloudNetwork("network", {
projectId: 1,
regionId: 1,
name: "my-network",
type: "vxlan",
tags: {
environment: "production",
},
});
// Create a subnet within the network
const subnet = new gcore.CloudNetworkSubnet("subnet", {
projectId: 1,
regionId: 1,
name: "my-subnet",
cidr: "192.168.10.0/24",
networkId: network.id,
dnsNameservers: [
"8.8.4.4",
"1.1.1.1",
],
});
import pulumi
import pulumi_gcore as gcore
# Create a private network
network = gcore.CloudNetwork("network",
project_id=1,
region_id=1,
name="my-network",
type="vxlan",
tags={
"environment": "production",
})
# Create a subnet within the network
subnet = gcore.CloudNetworkSubnet("subnet",
project_id=1,
region_id=1,
name="my-subnet",
cidr="192.168.10.0/24",
network_id=network.id,
dns_nameservers=[
"8.8.4.4",
"1.1.1.1",
])
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 a private network
network, err := gcore.NewCloudNetwork(ctx, "network", &gcore.CloudNetworkArgs{
ProjectId: pulumi.Float64(1),
RegionId: pulumi.Float64(1),
Name: pulumi.String("my-network"),
Type: pulumi.String("vxlan"),
Tags: pulumi.StringMap{
"environment": pulumi.String("production"),
},
})
if err != nil {
return err
}
// Create a subnet within the network
_, err = gcore.NewCloudNetworkSubnet(ctx, "subnet", &gcore.CloudNetworkSubnetArgs{
ProjectId: pulumi.Float64(1),
RegionId: pulumi.Float64(1),
Name: pulumi.String("my-subnet"),
Cidr: pulumi.String("192.168.10.0/24"),
NetworkId: network.ID(),
DnsNameservers: pulumi.StringArray{
pulumi.String("8.8.4.4"),
pulumi.String("1.1.1.1"),
},
})
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 a private network
var network = new Gcore.CloudNetwork("network", new()
{
ProjectId = 1,
RegionId = 1,
Name = "my-network",
Type = "vxlan",
Tags =
{
{ "environment", "production" },
},
});
// Create a subnet within the network
var subnet = new Gcore.CloudNetworkSubnet("subnet", new()
{
ProjectId = 1,
RegionId = 1,
Name = "my-subnet",
Cidr = "192.168.10.0/24",
NetworkId = network.Id,
DnsNameservers = new[]
{
"8.8.4.4",
"1.1.1.1",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.CloudNetwork;
import com.pulumi.gcore.CloudNetworkArgs;
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 a private network
var network = new CloudNetwork("network", CloudNetworkArgs.builder()
.projectId(1.0)
.regionId(1.0)
.name("my-network")
.type("vxlan")
.tags(Map.of("environment", "production"))
.build());
// Create a subnet within the network
var subnet = new CloudNetworkSubnet("subnet", CloudNetworkSubnetArgs.builder()
.projectId(1.0)
.regionId(1.0)
.name("my-subnet")
.cidr("192.168.10.0/24")
.networkId(network.id())
.dnsNameservers(
"8.8.4.4",
"1.1.1.1")
.build());
}
}
resources:
# Create a private network
network:
type: gcore:CloudNetwork
properties:
projectId: 1
regionId: 1
name: my-network
type: vxlan
tags:
environment: production
# Create a subnet within the network
subnet:
type: gcore:CloudNetworkSubnet
properties:
projectId: 1
regionId: 1
name: my-subnet
cidr: 192.168.10.0/24
networkId: ${network.id}
dnsNameservers:
- 8.8.4.4
- 1.1.1.1
Create CloudNetwork Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CloudNetwork(name: string, args?: CloudNetworkArgs, opts?: CustomResourceOptions);@overload
def CloudNetwork(resource_name: str,
args: Optional[CloudNetworkArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def CloudNetwork(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
region_id: Optional[float] = None,
tags: Optional[Mapping[str, str]] = None,
type: Optional[str] = None)func NewCloudNetwork(ctx *Context, name string, args *CloudNetworkArgs, opts ...ResourceOption) (*CloudNetwork, error)public CloudNetwork(string name, CloudNetworkArgs? args = null, CustomResourceOptions? opts = null)
public CloudNetwork(String name, CloudNetworkArgs args)
public CloudNetwork(String name, CloudNetworkArgs args, CustomResourceOptions options)
type: gcore:CloudNetwork
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 CloudNetworkArgs
- 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 CloudNetworkArgs
- 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 CloudNetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudNetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CloudNetworkArgs
- 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 cloudNetworkResource = new Gcore.Index.CloudNetwork("cloudNetworkResource", new()
{
Name = "string",
ProjectId = 0,
RegionId = 0,
Tags =
{
{ "string", "string" },
},
Type = "string",
});
example, err := gcore.NewCloudNetwork(ctx, "cloudNetworkResource", &gcore.CloudNetworkArgs{
Name: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
RegionId: pulumi.Float64(0),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Type: pulumi.String("string"),
})
var cloudNetworkResource = new CloudNetwork("cloudNetworkResource", CloudNetworkArgs.builder()
.name("string")
.projectId(0.0)
.regionId(0.0)
.tags(Map.of("string", "string"))
.type("string")
.build());
cloud_network_resource = gcore.CloudNetwork("cloudNetworkResource",
name="string",
project_id=0,
region_id=0,
tags={
"string": "string",
},
type="string")
const cloudNetworkResource = new gcore.CloudNetwork("cloudNetworkResource", {
name: "string",
projectId: 0,
regionId: 0,
tags: {
string: "string",
},
type: "string",
});
type: gcore:CloudNetwork
properties:
name: string
projectId: 0
regionId: 0
tags:
string: string
type: string
CloudNetwork 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 CloudNetwork resource accepts the following input properties:
- Name string
- Network 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.
- Type string
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- Name string
- Network 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.
- Type string
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- name String
- Network 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.
- type String
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- name string
- Network 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.
- type string
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- name str
- Network 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.
- type str
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- name String
- Network 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.
- type String
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
Outputs
All input properties are implicitly available as output properties. Additionally, the CloudNetwork resource produces the following output properties:
- Created
At string - Datetime when the network was created
- Creator
Task stringId - Task that created this entity
- Default bool
- True if network has
is_defaultattribute - External bool
- True if the network
router:externalattribute - Id string
- The provider-assigned unique ID for this managed resource.
- Mtu double
- MTU (maximum transmission unit). Default value is 1450
- Port
Security boolEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - Region string
- Region name
- Segmentation
Id double - Id of network segment
- bool
- True when the network is shared with your project by external owner
- Subnets List<string>
- List of subnetworks
- Updated
At string - Datetime when the network was last updated
- Created
At string - Datetime when the network was created
- Creator
Task stringId - Task that created this entity
- Default bool
- True if network has
is_defaultattribute - External bool
- True if the network
router:externalattribute - Id string
- The provider-assigned unique ID for this managed resource.
- Mtu float64
- MTU (maximum transmission unit). Default value is 1450
- Port
Security boolEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - Region string
- Region name
- Segmentation
Id float64 - Id of network segment
- bool
- True when the network is shared with your project by external owner
- Subnets []string
- List of subnetworks
- Updated
At string - Datetime when the network was last updated
- created
At String - Datetime when the network was created
- creator
Task StringId - Task that created this entity
- default_ Boolean
- True if network has
is_defaultattribute - external Boolean
- True if the network
router:externalattribute - id String
- The provider-assigned unique ID for this managed resource.
- mtu Double
- MTU (maximum transmission unit). Default value is 1450
- port
Security BooleanEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - region String
- Region name
- segmentation
Id Double - Id of network segment
- Boolean
- True when the network is shared with your project by external owner
- subnets List<String>
- List of subnetworks
- updated
At String - Datetime when the network was last updated
- created
At string - Datetime when the network was created
- creator
Task stringId - Task that created this entity
- default boolean
- True if network has
is_defaultattribute - external boolean
- True if the network
router:externalattribute - id string
- The provider-assigned unique ID for this managed resource.
- mtu number
- MTU (maximum transmission unit). Default value is 1450
- port
Security booleanEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - region string
- Region name
- segmentation
Id number - Id of network segment
- boolean
- True when the network is shared with your project by external owner
- subnets string[]
- List of subnetworks
- updated
At string - Datetime when the network was last updated
- created_
at str - Datetime when the network was created
- creator_
task_ strid - Task that created this entity
- default bool
- True if network has
is_defaultattribute - external bool
- True if the network
router:externalattribute - id str
- The provider-assigned unique ID for this managed resource.
- mtu float
- MTU (maximum transmission unit). Default value is 1450
- port_
security_ boolenabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - region str
- Region name
- segmentation_
id float - Id of network segment
- bool
- True when the network is shared with your project by external owner
- subnets Sequence[str]
- List of subnetworks
- updated_
at str - Datetime when the network was last updated
- created
At String - Datetime when the network was created
- creator
Task StringId - Task that created this entity
- default Boolean
- True if network has
is_defaultattribute - external Boolean
- True if the network
router:externalattribute - id String
- The provider-assigned unique ID for this managed resource.
- mtu Number
- MTU (maximum transmission unit). Default value is 1450
- port
Security BooleanEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - region String
- Region name
- segmentation
Id Number - Id of network segment
- Boolean
- True when the network is shared with your project by external owner
- subnets List<String>
- List of subnetworks
- updated
At String - Datetime when the network was last updated
Look up Existing CloudNetwork Resource
Get an existing CloudNetwork 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?: CloudNetworkState, opts?: CustomResourceOptions): CloudNetwork@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
creator_task_id: Optional[str] = None,
default: Optional[bool] = None,
external: Optional[bool] = None,
mtu: Optional[float] = None,
name: Optional[str] = None,
port_security_enabled: Optional[bool] = None,
project_id: Optional[float] = None,
region: Optional[str] = None,
region_id: Optional[float] = None,
segmentation_id: Optional[float] = None,
shared: Optional[bool] = None,
subnets: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
type: Optional[str] = None,
updated_at: Optional[str] = None) -> CloudNetworkfunc GetCloudNetwork(ctx *Context, name string, id IDInput, state *CloudNetworkState, opts ...ResourceOption) (*CloudNetwork, error)public static CloudNetwork Get(string name, Input<string> id, CloudNetworkState? state, CustomResourceOptions? opts = null)public static CloudNetwork get(String name, Output<String> id, CloudNetworkState state, CustomResourceOptions options)resources: _: type: gcore:CloudNetwork 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.
- Created
At string - Datetime when the network was created
- Creator
Task stringId - Task that created this entity
- Default bool
- True if network has
is_defaultattribute - External bool
- True if the network
router:externalattribute - Mtu double
- MTU (maximum transmission unit). Default value is 1450
- Name string
- Network name
- Port
Security boolEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - Project
Id double - Project ID
- Region string
- Region name
- Region
Id double - Region ID
- Segmentation
Id double - Id of network segment
- bool
- True when the network is shared with your project by external owner
- Subnets List<string>
- List of subnetworks
- 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.
- Type string
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- Updated
At string - Datetime when the network was last updated
- Created
At string - Datetime when the network was created
- Creator
Task stringId - Task that created this entity
- Default bool
- True if network has
is_defaultattribute - External bool
- True if the network
router:externalattribute - Mtu float64
- MTU (maximum transmission unit). Default value is 1450
- Name string
- Network name
- Port
Security boolEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - Project
Id float64 - Project ID
- Region string
- Region name
- Region
Id float64 - Region ID
- Segmentation
Id float64 - Id of network segment
- bool
- True when the network is shared with your project by external owner
- Subnets []string
- List of subnetworks
- 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.
- Type string
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- Updated
At string - Datetime when the network was last updated
- created
At String - Datetime when the network was created
- creator
Task StringId - Task that created this entity
- default_ Boolean
- True if network has
is_defaultattribute - external Boolean
- True if the network
router:externalattribute - mtu Double
- MTU (maximum transmission unit). Default value is 1450
- name String
- Network name
- port
Security BooleanEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - project
Id Double - Project ID
- region String
- Region name
- region
Id Double - Region ID
- segmentation
Id Double - Id of network segment
- Boolean
- True when the network is shared with your project by external owner
- subnets List<String>
- List of subnetworks
- 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.
- type String
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- updated
At String - Datetime when the network was last updated
- created
At string - Datetime when the network was created
- creator
Task stringId - Task that created this entity
- default boolean
- True if network has
is_defaultattribute - external boolean
- True if the network
router:externalattribute - mtu number
- MTU (maximum transmission unit). Default value is 1450
- name string
- Network name
- port
Security booleanEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - project
Id number - Project ID
- region string
- Region name
- region
Id number - Region ID
- segmentation
Id number - Id of network segment
- boolean
- True when the network is shared with your project by external owner
- subnets string[]
- List of subnetworks
- {[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.
- type string
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- updated
At string - Datetime when the network was last updated
- created_
at str - Datetime when the network was created
- creator_
task_ strid - Task that created this entity
- default bool
- True if network has
is_defaultattribute - external bool
- True if the network
router:externalattribute - mtu float
- MTU (maximum transmission unit). Default value is 1450
- name str
- Network name
- port_
security_ boolenabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - project_
id float - Project ID
- region str
- Region name
- region_
id float - Region ID
- segmentation_
id float - Id of network segment
- bool
- True when the network is shared with your project by external owner
- subnets Sequence[str]
- List of subnetworks
- 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.
- type str
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- updated_
at str - Datetime when the network was last updated
- created
At String - Datetime when the network was created
- creator
Task StringId - Task that created this entity
- default Boolean
- True if network has
is_defaultattribute - external Boolean
- True if the network
router:externalattribute - mtu Number
- MTU (maximum transmission unit). Default value is 1450
- name String
- Network name
- port
Security BooleanEnabled - Indicates
port_security_enabledstatus of all newly created in the network ports. - project
Id Number - Project ID
- region String
- Region name
- region
Id Number - Region ID
- segmentation
Id Number - Id of network segment
- Boolean
- True when the network is shared with your project by external owner
- subnets List<String>
- List of subnetworks
- 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.
- type String
- vlan or vxlan network type is allowed. Default value is vxlan Available values: "vlan", "vxlan".
- updated
At String - Datetime when the network was last updated
Import
$ pulumi import gcore:index/cloudNetwork:CloudNetwork example '<project_id>/<region_id>/<network_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 Monday, Mar 30, 2026 by g-core
