1. Packages
  2. Gcorelabs Provider
  3. API Docs
  4. Network
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

gcorelabs.Network

Explore with Pulumi AI

Represent network. A network is a software-defined network in a cloud computing infrastructure

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";

const network = new gcore.index.Gcore_network("network", {
    name: "network_example",
    type: "vxlan",
    regionId: 1,
    projectId: 1,
});
Copy
import pulumi
import pulumi_gcore as gcore

network = gcore.index.Gcore_network("network",
    name=network_example,
    type=vxlan,
    region_id=1,
    project_id=1)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gcore.NewGcore_network(ctx, "network", &gcore.Gcore_networkArgs{
			Name:      "network_example",
			Type:      "vxlan",
			RegionId:  1,
			ProjectId: 1,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;

return await Deployment.RunAsync(() => 
{
    var network = new Gcore.Index.Gcore_network("network", new()
    {
        Name = "network_example",
        Type = "vxlan",
        RegionId = 1,
        ProjectId = 1,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.gcore_network;
import com.pulumi.gcore.Gcore_networkArgs;
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) {
        var network = new Gcore_network("network", Gcore_networkArgs.builder()
            .name("network_example")
            .type("vxlan")
            .regionId(1)
            .projectId(1)
            .build());

    }
}
Copy
resources:
  network:
    type: gcore:gcore_network
    properties:
      name: network_example
      type: vxlan
      regionId: 1
      projectId: 1
Copy

Create Network Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);
@overload
def Network(resource_name: str,
            args: Optional[NetworkArgs] = None,
            opts: Optional[ResourceOptions] = None)

@overload
def Network(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            create_router: Optional[bool] = None,
            last_updated: Optional[str] = None,
            metadata_map: Optional[Mapping[str, str]] = None,
            name: Optional[str] = None,
            network_id: Optional[str] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None,
            type: Optional[str] = None)
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: gcorelabs:Network
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args NetworkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args NetworkArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args NetworkArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args NetworkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NetworkArgs
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 networkResource = new Gcorelabs.Network("networkResource", new()
{
    CreateRouter = false,
    LastUpdated = "string",
    MetadataMap = 
    {
        { "string", "string" },
    },
    Name = "string",
    NetworkId = "string",
    ProjectId = 0,
    ProjectName = "string",
    RegionId = 0,
    RegionName = "string",
    Type = "string",
});
Copy
example, err := gcorelabs.NewNetwork(ctx, "networkResource", &gcorelabs.NetworkArgs{
CreateRouter: pulumi.Bool(false),
LastUpdated: pulumi.String("string"),
MetadataMap: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
NetworkId: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
ProjectName: pulumi.String("string"),
RegionId: pulumi.Float64(0),
RegionName: pulumi.String("string"),
Type: pulumi.String("string"),
})
Copy
var networkResource = new Network("networkResource", NetworkArgs.builder()
    .createRouter(false)
    .lastUpdated("string")
    .metadataMap(Map.of("string", "string"))
    .name("string")
    .networkId("string")
    .projectId(0)
    .projectName("string")
    .regionId(0)
    .regionName("string")
    .type("string")
    .build());
Copy
network_resource = gcorelabs.Network("networkResource",
    create_router=False,
    last_updated="string",
    metadata_map={
        "string": "string",
    },
    name="string",
    network_id="string",
    project_id=0,
    project_name="string",
    region_id=0,
    region_name="string",
    type="string")
Copy
const networkResource = new gcorelabs.Network("networkResource", {
    createRouter: false,
    lastUpdated: "string",
    metadataMap: {
        string: "string",
    },
    name: "string",
    networkId: "string",
    projectId: 0,
    projectName: "string",
    regionId: 0,
    regionName: "string",
    type: "string",
});
Copy
type: gcorelabs:Network
properties:
    createRouter: false
    lastUpdated: string
    metadataMap:
        string: string
    name: string
    networkId: string
    projectId: 0
    projectName: string
    regionId: 0
    regionName: string
    type: string
Copy

Network 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 Network resource accepts the following input properties:

CreateRouter bool
Create external router to the network, default true
LastUpdated string
MetadataMap Dictionary<string, string>
Name string
NetworkId string
The ID of this resource.
ProjectId double
ProjectName string
RegionId double
RegionName string
Type string
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
CreateRouter bool
Create external router to the network, default true
LastUpdated string
MetadataMap map[string]string
Name string
NetworkId string
The ID of this resource.
ProjectId float64
ProjectName string
RegionId float64
RegionName string
Type string
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
createRouter Boolean
Create external router to the network, default true
lastUpdated String
metadataMap Map<String,String>
name String
networkId String
The ID of this resource.
projectId Double
projectName String
regionId Double
regionName String
type String
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
createRouter boolean
Create external router to the network, default true
lastUpdated string
metadataMap {[key: string]: string}
name string
networkId string
The ID of this resource.
projectId number
projectName string
regionId number
regionName string
type string
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
create_router bool
Create external router to the network, default true
last_updated str
metadata_map Mapping[str, str]
name str
network_id str
The ID of this resource.
project_id float
project_name str
region_id float
region_name str
type str
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
createRouter Boolean
Create external router to the network, default true
lastUpdated String
metadataMap Map<String>
name String
networkId String
The ID of this resource.
projectId Number
projectName String
regionId Number
regionName String
type String
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'

Outputs

All input properties are implicitly available as output properties. Additionally, the Network resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
MetadataReadOnlies List<NetworkMetadataReadOnly>
Mtu double
Id string
The provider-assigned unique ID for this managed resource.
MetadataReadOnlies []NetworkMetadataReadOnly
Mtu float64
id String
The provider-assigned unique ID for this managed resource.
metadataReadOnlies List<NetworkMetadataReadOnly>
mtu Double
id string
The provider-assigned unique ID for this managed resource.
metadataReadOnlies NetworkMetadataReadOnly[]
mtu number
id str
The provider-assigned unique ID for this managed resource.
metadata_read_onlies Sequence[NetworkMetadataReadOnly]
mtu float
id String
The provider-assigned unique ID for this managed resource.
metadataReadOnlies List<Property Map>
mtu Number

Look up Existing Network Resource

Get an existing Network 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?: NetworkState, opts?: CustomResourceOptions): Network
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_router: Optional[bool] = None,
        last_updated: Optional[str] = None,
        metadata_map: Optional[Mapping[str, str]] = None,
        metadata_read_onlies: Optional[Sequence[NetworkMetadataReadOnlyArgs]] = None,
        mtu: Optional[float] = None,
        name: Optional[str] = None,
        network_id: Optional[str] = None,
        project_id: Optional[float] = None,
        project_name: Optional[str] = None,
        region_id: Optional[float] = None,
        region_name: Optional[str] = None,
        type: Optional[str] = None) -> Network
func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
resources:  _:    type: gcorelabs:Network    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreateRouter bool
Create external router to the network, default true
LastUpdated string
MetadataMap Dictionary<string, string>
MetadataReadOnlies List<NetworkMetadataReadOnly>
Mtu double
Name string
NetworkId string
The ID of this resource.
ProjectId double
ProjectName string
RegionId double
RegionName string
Type string
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
CreateRouter bool
Create external router to the network, default true
LastUpdated string
MetadataMap map[string]string
MetadataReadOnlies []NetworkMetadataReadOnlyArgs
Mtu float64
Name string
NetworkId string
The ID of this resource.
ProjectId float64
ProjectName string
RegionId float64
RegionName string
Type string
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
createRouter Boolean
Create external router to the network, default true
lastUpdated String
metadataMap Map<String,String>
metadataReadOnlies List<NetworkMetadataReadOnly>
mtu Double
name String
networkId String
The ID of this resource.
projectId Double
projectName String
regionId Double
regionName String
type String
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
createRouter boolean
Create external router to the network, default true
lastUpdated string
metadataMap {[key: string]: string}
metadataReadOnlies NetworkMetadataReadOnly[]
mtu number
name string
networkId string
The ID of this resource.
projectId number
projectName string
regionId number
regionName string
type string
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
create_router bool
Create external router to the network, default true
last_updated str
metadata_map Mapping[str, str]
metadata_read_onlies Sequence[NetworkMetadataReadOnlyArgs]
mtu float
name str
network_id str
The ID of this resource.
project_id float
project_name str
region_id float
region_name str
type str
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'
createRouter Boolean
Create external router to the network, default true
lastUpdated String
metadataMap Map<String>
metadataReadOnlies List<Property Map>
mtu Number
name String
networkId String
The ID of this resource.
projectId Number
projectName String
regionId Number
regionName String
type String
'vlan' or 'vxlan' network type is allowed. Default value is 'vxlan'

Supporting Types

NetworkMetadataReadOnly
, NetworkMetadataReadOnlyArgs

Key This property is required. string
ReadOnly This property is required. bool
Value This property is required. string
Key This property is required. string
ReadOnly This property is required. bool
Value This property is required. string
key This property is required. String
readOnly This property is required. Boolean
value This property is required. String
key This property is required. string
readOnly This property is required. boolean
value This property is required. string
key This property is required. str
read_only This property is required. bool
value This property is required. str
key This property is required. String
readOnly This property is required. Boolean
value This property is required. String

Import

import using <project_id>:<region_id>:<network_id> format

$ pulumi import gcorelabs:index/network:Network metwork1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
gcorelabs g-core/terraform-provider-gcorelabs
License
Notes
This Pulumi package is based on the gcorelabs Terraform Provider.