1. Packages
  2. Civo Provider
  3. API Docs
  4. Network
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

civo.Network

Explore with Pulumi AI

Provides a Civo network resource. This can be used to create, modify, and delete networks.

Example Usage

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

const customNet = new civo.Network("customNet", {label: "test_network"});
Copy
import pulumi
import pulumi_civo as civo

custom_net = civo.Network("customNet", label="test_network")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/civo/civo"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := civo.NewNetwork(ctx, "customNet", &civo.NetworkArgs{
			Label: pulumi.String("test_network"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;

return await Deployment.RunAsync(() => 
{
    var customNet = new Civo.Network("customNet", new()
    {
        Label = "test_network",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.Network;
import com.pulumi.civo.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 customNet = new Network("customNet", NetworkArgs.builder()
            .label("test_network")
            .build());

    }
}
Copy
resources:
  customNet:
    type: civo:Network
    properties:
      label: test_network
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: NetworkArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Network(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            label: Optional[str] = None,
            cidr_v4: Optional[str] = None,
            nameservers_v4s: Optional[Sequence[str]] = None,
            network_id: Optional[str] = None,
            region: Optional[str] = None,
            timeouts: Optional[NetworkTimeoutsArgs] = None,
            vlan_allocation_pool_v4_end: Optional[str] = None,
            vlan_allocation_pool_v4_start: Optional[str] = None,
            vlan_cidr_v4: Optional[str] = None,
            vlan_gateway_ip_v4: Optional[str] = None,
            vlan_id: Optional[float] = None,
            vlan_physical_interface: Optional[str] = None)
func NewNetwork(ctx *Context, name string, args NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs args, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: civo: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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 Civo.Network("networkResource", new()
{
    Label = "string",
    CidrV4 = "string",
    NameserversV4s = new[]
    {
        "string",
    },
    NetworkId = "string",
    Region = "string",
    Timeouts = new Civo.Inputs.NetworkTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
    VlanAllocationPoolV4End = "string",
    VlanAllocationPoolV4Start = "string",
    VlanCidrV4 = "string",
    VlanGatewayIpV4 = "string",
    VlanId = 0,
    VlanPhysicalInterface = "string",
});
Copy
example, err := civo.NewNetwork(ctx, "networkResource", &civo.NetworkArgs{
Label: pulumi.String("string"),
CidrV4: pulumi.String("string"),
NameserversV4s: pulumi.StringArray{
pulumi.String("string"),
},
NetworkId: pulumi.String("string"),
Region: pulumi.String("string"),
Timeouts: &.NetworkTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
VlanAllocationPoolV4End: pulumi.String("string"),
VlanAllocationPoolV4Start: pulumi.String("string"),
VlanCidrV4: pulumi.String("string"),
VlanGatewayIpV4: pulumi.String("string"),
VlanId: pulumi.Float64(0),
VlanPhysicalInterface: pulumi.String("string"),
})
Copy
var networkResource = new Network("networkResource", NetworkArgs.builder()
    .label("string")
    .cidrV4("string")
    .nameserversV4s("string")
    .networkId("string")
    .region("string")
    .timeouts(NetworkTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .vlanAllocationPoolV4End("string")
    .vlanAllocationPoolV4Start("string")
    .vlanCidrV4("string")
    .vlanGatewayIpV4("string")
    .vlanId(0)
    .vlanPhysicalInterface("string")
    .build());
Copy
network_resource = civo.Network("networkResource",
    label="string",
    cidr_v4="string",
    nameservers_v4s=["string"],
    network_id="string",
    region="string",
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    },
    vlan_allocation_pool_v4_end="string",
    vlan_allocation_pool_v4_start="string",
    vlan_cidr_v4="string",
    vlan_gateway_ip_v4="string",
    vlan_id=0,
    vlan_physical_interface="string")
Copy
const networkResource = new civo.Network("networkResource", {
    label: "string",
    cidrV4: "string",
    nameserversV4s: ["string"],
    networkId: "string",
    region: "string",
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
    vlanAllocationPoolV4End: "string",
    vlanAllocationPoolV4Start: "string",
    vlanCidrV4: "string",
    vlanGatewayIpV4: "string",
    vlanId: 0,
    vlanPhysicalInterface: "string",
});
Copy
type: civo:Network
properties:
    cidrV4: string
    label: string
    nameserversV4s:
        - string
    networkId: string
    region: string
    timeouts:
        create: string
        delete: string
        update: string
    vlanAllocationPoolV4End: string
    vlanAllocationPoolV4Start: string
    vlanCidrV4: string
    vlanGatewayIpV4: string
    vlanId: 0
    vlanPhysicalInterface: 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:

Label This property is required. string
Name for the network
CidrV4 string
The CIDR block for the network
NameserversV4s List<string>
List of nameservers for the network
NetworkId string
The ID of this resource.
Region string
The region of the network
Timeouts NetworkTimeouts
VlanAllocationPoolV4End string
End of the IPv4 allocation pool for VLAN
VlanAllocationPoolV4Start string
Start of the IPv4 allocation pool for VLAN
VlanCidrV4 string
CIDR for VLAN IPv4
VlanGatewayIpV4 string
Gateway IP for VLAN IPv4
VlanId double
VLAN ID for the network
VlanPhysicalInterface string
Physical interface for VLAN
Label This property is required. string
Name for the network
CidrV4 string
The CIDR block for the network
NameserversV4s []string
List of nameservers for the network
NetworkId string
The ID of this resource.
Region string
The region of the network
Timeouts NetworkTimeoutsArgs
VlanAllocationPoolV4End string
End of the IPv4 allocation pool for VLAN
VlanAllocationPoolV4Start string
Start of the IPv4 allocation pool for VLAN
VlanCidrV4 string
CIDR for VLAN IPv4
VlanGatewayIpV4 string
Gateway IP for VLAN IPv4
VlanId float64
VLAN ID for the network
VlanPhysicalInterface string
Physical interface for VLAN
label This property is required. String
Name for the network
cidrV4 String
The CIDR block for the network
nameserversV4s List<String>
List of nameservers for the network
networkId String
The ID of this resource.
region String
The region of the network
timeouts NetworkTimeouts
vlanAllocationPoolV4End String
End of the IPv4 allocation pool for VLAN
vlanAllocationPoolV4Start String
Start of the IPv4 allocation pool for VLAN
vlanCidrV4 String
CIDR for VLAN IPv4
vlanGatewayIpV4 String
Gateway IP for VLAN IPv4
vlanId Double
VLAN ID for the network
vlanPhysicalInterface String
Physical interface for VLAN
label This property is required. string
Name for the network
cidrV4 string
The CIDR block for the network
nameserversV4s string[]
List of nameservers for the network
networkId string
The ID of this resource.
region string
The region of the network
timeouts NetworkTimeouts
vlanAllocationPoolV4End string
End of the IPv4 allocation pool for VLAN
vlanAllocationPoolV4Start string
Start of the IPv4 allocation pool for VLAN
vlanCidrV4 string
CIDR for VLAN IPv4
vlanGatewayIpV4 string
Gateway IP for VLAN IPv4
vlanId number
VLAN ID for the network
vlanPhysicalInterface string
Physical interface for VLAN
label This property is required. str
Name for the network
cidr_v4 str
The CIDR block for the network
nameservers_v4s Sequence[str]
List of nameservers for the network
network_id str
The ID of this resource.
region str
The region of the network
timeouts NetworkTimeoutsArgs
vlan_allocation_pool_v4_end str
End of the IPv4 allocation pool for VLAN
vlan_allocation_pool_v4_start str
Start of the IPv4 allocation pool for VLAN
vlan_cidr_v4 str
CIDR for VLAN IPv4
vlan_gateway_ip_v4 str
Gateway IP for VLAN IPv4
vlan_id float
VLAN ID for the network
vlan_physical_interface str
Physical interface for VLAN
label This property is required. String
Name for the network
cidrV4 String
The CIDR block for the network
nameserversV4s List<String>
List of nameservers for the network
networkId String
The ID of this resource.
region String
The region of the network
timeouts Property Map
vlanAllocationPoolV4End String
End of the IPv4 allocation pool for VLAN
vlanAllocationPoolV4Start String
Start of the IPv4 allocation pool for VLAN
vlanCidrV4 String
CIDR for VLAN IPv4
vlanGatewayIpV4 String
Gateway IP for VLAN IPv4
vlanId Number
VLAN ID for the network
vlanPhysicalInterface String
Physical interface for VLAN

Outputs

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

Default bool
If the network is default, this will be true
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the network
Default bool
If the network is default, this will be true
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the network
default_ Boolean
If the network is default, this will be true
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the network
default boolean
If the network is default, this will be true
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the network
default bool
If the network is default, this will be true
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the network
default Boolean
If the network is default, this will be true
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the network

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,
        cidr_v4: Optional[str] = None,
        default: Optional[bool] = None,
        label: Optional[str] = None,
        name: Optional[str] = None,
        nameservers_v4s: Optional[Sequence[str]] = None,
        network_id: Optional[str] = None,
        region: Optional[str] = None,
        timeouts: Optional[NetworkTimeoutsArgs] = None,
        vlan_allocation_pool_v4_end: Optional[str] = None,
        vlan_allocation_pool_v4_start: Optional[str] = None,
        vlan_cidr_v4: Optional[str] = None,
        vlan_gateway_ip_v4: Optional[str] = None,
        vlan_id: Optional[float] = None,
        vlan_physical_interface: 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: civo: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:
CidrV4 string
The CIDR block for the network
Default bool
If the network is default, this will be true
Label string
Name for the network
Name string
The name of the network
NameserversV4s List<string>
List of nameservers for the network
NetworkId string
The ID of this resource.
Region string
The region of the network
Timeouts NetworkTimeouts
VlanAllocationPoolV4End string
End of the IPv4 allocation pool for VLAN
VlanAllocationPoolV4Start string
Start of the IPv4 allocation pool for VLAN
VlanCidrV4 string
CIDR for VLAN IPv4
VlanGatewayIpV4 string
Gateway IP for VLAN IPv4
VlanId double
VLAN ID for the network
VlanPhysicalInterface string
Physical interface for VLAN
CidrV4 string
The CIDR block for the network
Default bool
If the network is default, this will be true
Label string
Name for the network
Name string
The name of the network
NameserversV4s []string
List of nameservers for the network
NetworkId string
The ID of this resource.
Region string
The region of the network
Timeouts NetworkTimeoutsArgs
VlanAllocationPoolV4End string
End of the IPv4 allocation pool for VLAN
VlanAllocationPoolV4Start string
Start of the IPv4 allocation pool for VLAN
VlanCidrV4 string
CIDR for VLAN IPv4
VlanGatewayIpV4 string
Gateway IP for VLAN IPv4
VlanId float64
VLAN ID for the network
VlanPhysicalInterface string
Physical interface for VLAN
cidrV4 String
The CIDR block for the network
default_ Boolean
If the network is default, this will be true
label String
Name for the network
name String
The name of the network
nameserversV4s List<String>
List of nameservers for the network
networkId String
The ID of this resource.
region String
The region of the network
timeouts NetworkTimeouts
vlanAllocationPoolV4End String
End of the IPv4 allocation pool for VLAN
vlanAllocationPoolV4Start String
Start of the IPv4 allocation pool for VLAN
vlanCidrV4 String
CIDR for VLAN IPv4
vlanGatewayIpV4 String
Gateway IP for VLAN IPv4
vlanId Double
VLAN ID for the network
vlanPhysicalInterface String
Physical interface for VLAN
cidrV4 string
The CIDR block for the network
default boolean
If the network is default, this will be true
label string
Name for the network
name string
The name of the network
nameserversV4s string[]
List of nameservers for the network
networkId string
The ID of this resource.
region string
The region of the network
timeouts NetworkTimeouts
vlanAllocationPoolV4End string
End of the IPv4 allocation pool for VLAN
vlanAllocationPoolV4Start string
Start of the IPv4 allocation pool for VLAN
vlanCidrV4 string
CIDR for VLAN IPv4
vlanGatewayIpV4 string
Gateway IP for VLAN IPv4
vlanId number
VLAN ID for the network
vlanPhysicalInterface string
Physical interface for VLAN
cidr_v4 str
The CIDR block for the network
default bool
If the network is default, this will be true
label str
Name for the network
name str
The name of the network
nameservers_v4s Sequence[str]
List of nameservers for the network
network_id str
The ID of this resource.
region str
The region of the network
timeouts NetworkTimeoutsArgs
vlan_allocation_pool_v4_end str
End of the IPv4 allocation pool for VLAN
vlan_allocation_pool_v4_start str
Start of the IPv4 allocation pool for VLAN
vlan_cidr_v4 str
CIDR for VLAN IPv4
vlan_gateway_ip_v4 str
Gateway IP for VLAN IPv4
vlan_id float
VLAN ID for the network
vlan_physical_interface str
Physical interface for VLAN
cidrV4 String
The CIDR block for the network
default Boolean
If the network is default, this will be true
label String
Name for the network
name String
The name of the network
nameserversV4s List<String>
List of nameservers for the network
networkId String
The ID of this resource.
region String
The region of the network
timeouts Property Map
vlanAllocationPoolV4End String
End of the IPv4 allocation pool for VLAN
vlanAllocationPoolV4Start String
Start of the IPv4 allocation pool for VLAN
vlanCidrV4 String
CIDR for VLAN IPv4
vlanGatewayIpV4 String
Gateway IP for VLAN IPv4
vlanId Number
VLAN ID for the network
vlanPhysicalInterface String
Physical interface for VLAN

Supporting Types

NetworkTimeouts
, NetworkTimeoutsArgs

Create string
Delete string
Update string
Create string
Delete string
Update string
create String
delete String
update String
create string
delete string
update string
create str
delete str
update str
create String
delete String
update String

Import

using ID

$ pulumi import civo:index/network:Network custom_net b8ecd2ab-2267-4a5e-8692-cbf1d32583e3
Copy

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

Package Details

Repository
Civo civo/terraform-provider-civo
License
Notes
This Pulumi package is based on the civo Terraform Provider.