1. Packages
  2. OVH
  3. API Docs
  4. CloudProject
  5. NetworkPrivate
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

ovh.CloudProject.NetworkPrivate

Explore with Pulumi AI

Creates a private network in a public cloud project.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";

const net = new ovh.cloudproject.NetworkPrivate("net", {
    regions: [
        "GRA1",
        "BHS1",
    ],
    serviceName: "XXXXXX",
});
Copy
import pulumi
import pulumi_ovh as ovh

net = ovh.cloud_project.NetworkPrivate("net",
    regions=[
        "GRA1",
        "BHS1",
    ],
    service_name="XXXXXX")
Copy
package main

import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/cloudproject"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudproject.NewNetworkPrivate(ctx, "net", &cloudproject.NetworkPrivateArgs{
			Regions: pulumi.StringArray{
				pulumi.String("GRA1"),
				pulumi.String("BHS1"),
			},
			ServiceName: pulumi.String("XXXXXX"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var net = new Ovh.CloudProject.NetworkPrivate("net", new()
    {
        Regions = new[]
        {
            "GRA1",
            "BHS1",
        },
        ServiceName = "XXXXXX",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.ovhcloud.pulumi.ovh.CloudProject.NetworkPrivate;
import com.ovhcloud.pulumi.ovh.CloudProject.NetworkPrivateArgs;
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 net = new NetworkPrivate("net", NetworkPrivateArgs.builder()
            .regions(            
                "GRA1",
                "BHS1")
            .serviceName("XXXXXX")
            .build());

    }
}
Copy
resources:
  net:
    type: ovh:CloudProject:NetworkPrivate
    properties:
      regions:
        - GRA1
        - BHS1
      serviceName: XXXXXX
Copy

Create NetworkPrivate Resource

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

Constructor syntax

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

@overload
def NetworkPrivate(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   service_name: Optional[str] = None,
                   name: Optional[str] = None,
                   regions: Optional[Sequence[str]] = None,
                   vlan_id: Optional[int] = None)
func NewNetworkPrivate(ctx *Context, name string, args NetworkPrivateArgs, opts ...ResourceOption) (*NetworkPrivate, error)
public NetworkPrivate(string name, NetworkPrivateArgs args, CustomResourceOptions? opts = null)
public NetworkPrivate(String name, NetworkPrivateArgs args)
public NetworkPrivate(String name, NetworkPrivateArgs args, CustomResourceOptions options)
type: ovh:CloudProject:NetworkPrivate
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. NetworkPrivateArgs
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. NetworkPrivateArgs
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. NetworkPrivateArgs
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. NetworkPrivateArgs
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. NetworkPrivateArgs
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 networkPrivateResource = new Ovh.CloudProject.NetworkPrivate("networkPrivateResource", new()
{
    ServiceName = "string",
    Name = "string",
    Regions = new[]
    {
        "string",
    },
    VlanId = 0,
});
Copy
example, err := cloudproject.NewNetworkPrivate(ctx, "networkPrivateResource", &cloudproject.NetworkPrivateArgs{
	ServiceName: pulumi.String("string"),
	Name:        pulumi.String("string"),
	Regions: pulumi.StringArray{
		pulumi.String("string"),
	},
	VlanId: pulumi.Int(0),
})
Copy
var networkPrivateResource = new NetworkPrivate("networkPrivateResource", NetworkPrivateArgs.builder()
    .serviceName("string")
    .name("string")
    .regions("string")
    .vlanId(0)
    .build());
Copy
network_private_resource = ovh.cloud_project.NetworkPrivate("networkPrivateResource",
    service_name="string",
    name="string",
    regions=["string"],
    vlan_id=0)
Copy
const networkPrivateResource = new ovh.cloudproject.NetworkPrivate("networkPrivateResource", {
    serviceName: "string",
    name: "string",
    regions: ["string"],
    vlanId: 0,
});
Copy
type: ovh:CloudProject:NetworkPrivate
properties:
    name: string
    regions:
        - string
    serviceName: string
    vlanId: 0
Copy

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

ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
Name string
The name of the network.
Regions List<string>
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
VlanId Changes to this property will trigger replacement. int
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
Name string
The name of the network.
Regions []string
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
VlanId Changes to this property will trigger replacement. int
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
name String
The name of the network.
regions List<String>
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
vlanId Changes to this property will trigger replacement. Integer
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
name string
The name of the network.
regions string[]
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
vlanId Changes to this property will trigger replacement. number
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
service_name
This property is required.
Changes to this property will trigger replacement.
str
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
name str
The name of the network.
regions Sequence[str]
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
vlan_id Changes to this property will trigger replacement. int
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
name String
The name of the network.
regions List<String>
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
vlanId Changes to this property will trigger replacement. Number
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RegionsAttributes List<NetworkPrivateRegionsAttribute>
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
RegionsStatuses List<NetworkPrivateRegionsStatus>
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

Status string
the status of the network. should be normally set to 'ACTIVE'.
Type string
the type of the network. Either 'private' or 'public'.
Id string
The provider-assigned unique ID for this managed resource.
RegionsAttributes []NetworkPrivateRegionsAttribute
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
RegionsStatuses []NetworkPrivateRegionsStatus
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

Status string
the status of the network. should be normally set to 'ACTIVE'.
Type string
the type of the network. Either 'private' or 'public'.
id String
The provider-assigned unique ID for this managed resource.
regionsAttributes List<NetworkPrivateRegionsAttribute>
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regionsStatuses List<NetworkPrivateRegionsStatus>
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

status String
the status of the network. should be normally set to 'ACTIVE'.
type String
the type of the network. Either 'private' or 'public'.
id string
The provider-assigned unique ID for this managed resource.
regionsAttributes NetworkPrivateRegionsAttribute[]
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regionsStatuses NetworkPrivateRegionsStatus[]
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

status string
the status of the network. should be normally set to 'ACTIVE'.
type string
the type of the network. Either 'private' or 'public'.
id str
The provider-assigned unique ID for this managed resource.
regions_attributes Sequence[cloudproject.NetworkPrivateRegionsAttribute]
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regions_statuses Sequence[cloudproject.NetworkPrivateRegionsStatus]
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

status str
the status of the network. should be normally set to 'ACTIVE'.
type str
the type of the network. Either 'private' or 'public'.
id String
The provider-assigned unique ID for this managed resource.
regionsAttributes List<Property Map>
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regionsStatuses List<Property Map>
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

status String
the status of the network. should be normally set to 'ACTIVE'.
type String
the type of the network. Either 'private' or 'public'.

Look up Existing NetworkPrivate Resource

Get an existing NetworkPrivate 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?: NetworkPrivateState, opts?: CustomResourceOptions): NetworkPrivate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        regions: Optional[Sequence[str]] = None,
        regions_attributes: Optional[Sequence[_cloudproject.NetworkPrivateRegionsAttributeArgs]] = None,
        regions_statuses: Optional[Sequence[_cloudproject.NetworkPrivateRegionsStatusArgs]] = None,
        service_name: Optional[str] = None,
        status: Optional[str] = None,
        type: Optional[str] = None,
        vlan_id: Optional[int] = None) -> NetworkPrivate
func GetNetworkPrivate(ctx *Context, name string, id IDInput, state *NetworkPrivateState, opts ...ResourceOption) (*NetworkPrivate, error)
public static NetworkPrivate Get(string name, Input<string> id, NetworkPrivateState? state, CustomResourceOptions? opts = null)
public static NetworkPrivate get(String name, Output<String> id, NetworkPrivateState state, CustomResourceOptions options)
resources:  _:    type: ovh:CloudProject:NetworkPrivate    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:
Name string
The name of the network.
Regions List<string>
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
RegionsAttributes List<NetworkPrivateRegionsAttribute>
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
RegionsStatuses List<NetworkPrivateRegionsStatus>
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

ServiceName Changes to this property will trigger replacement. string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
Status string
the status of the network. should be normally set to 'ACTIVE'.
Type string
the type of the network. Either 'private' or 'public'.
VlanId Changes to this property will trigger replacement. int
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
Name string
The name of the network.
Regions []string
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
RegionsAttributes []NetworkPrivateRegionsAttributeArgs
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
RegionsStatuses []NetworkPrivateRegionsStatusArgs
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

ServiceName Changes to this property will trigger replacement. string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
Status string
the status of the network. should be normally set to 'ACTIVE'.
Type string
the type of the network. Either 'private' or 'public'.
VlanId Changes to this property will trigger replacement. int
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
name String
The name of the network.
regions List<String>
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
regionsAttributes List<NetworkPrivateRegionsAttribute>
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regionsStatuses List<NetworkPrivateRegionsStatus>
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

serviceName Changes to this property will trigger replacement. String
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
status String
the status of the network. should be normally set to 'ACTIVE'.
type String
the type of the network. Either 'private' or 'public'.
vlanId Changes to this property will trigger replacement. Integer
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
name string
The name of the network.
regions string[]
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
regionsAttributes NetworkPrivateRegionsAttribute[]
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regionsStatuses NetworkPrivateRegionsStatus[]
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

serviceName Changes to this property will trigger replacement. string
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
status string
the status of the network. should be normally set to 'ACTIVE'.
type string
the type of the network. Either 'private' or 'public'.
vlanId Changes to this property will trigger replacement. number
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
name str
The name of the network.
regions Sequence[str]
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
regions_attributes Sequence[cloudproject.NetworkPrivateRegionsAttributeArgs]
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regions_statuses Sequence[cloudproject.NetworkPrivateRegionsStatusArgs]
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

service_name Changes to this property will trigger replacement. str
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
status str
the status of the network. should be normally set to 'ACTIVE'.
type str
the type of the network. Either 'private' or 'public'.
vlan_id Changes to this property will trigger replacement. int
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.
name String
The name of the network.
regions List<String>
an array of valid OVHcloud public cloud region ID in which the network will be available. Ex.: "GRA1". Defaults to all public cloud regions.
regionsAttributes List<Property Map>
A map representing information about the region.

  • regions_attributes/region - The id of the region.
  • regions_attributes/status - The status of the network in the region.
  • regions_attributes/openstackid - The private network id in the region.
regionsStatuses List<Property Map>
(Deprecated) A map representing the status of the network per region.

  • regions_status/region - (Deprecated) The id of the region.
  • regions_status/status - (Deprecated) The status of the network in the region.

Deprecated: use the regions_attributes field instead

serviceName Changes to this property will trigger replacement. String
The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
status String
the status of the network. should be normally set to 'ACTIVE'.
type String
the type of the network. Either 'private' or 'public'.
vlanId Changes to this property will trigger replacement. Number
a vlan id to associate with the network. Changing this value recreates the resource. Defaults to 0.

Supporting Types

NetworkPrivateRegionsAttribute
, NetworkPrivateRegionsAttributeArgs

Status This property is required. string
the status of the network. should be normally set to 'ACTIVE'.
Openstackid string
Region string
Status This property is required. string
the status of the network. should be normally set to 'ACTIVE'.
Openstackid string
Region string
status This property is required. String
the status of the network. should be normally set to 'ACTIVE'.
openstackid String
region String
status This property is required. string
the status of the network. should be normally set to 'ACTIVE'.
openstackid string
region string
status This property is required. str
the status of the network. should be normally set to 'ACTIVE'.
openstackid str
region str
status This property is required. String
the status of the network. should be normally set to 'ACTIVE'.
openstackid String
region String

NetworkPrivateRegionsStatus
, NetworkPrivateRegionsStatusArgs

Status This property is required. string
the status of the network. should be normally set to 'ACTIVE'.
Region string
Status This property is required. string
the status of the network. should be normally set to 'ACTIVE'.
Region string
status This property is required. String
the status of the network. should be normally set to 'ACTIVE'.
region String
status This property is required. string
the status of the network. should be normally set to 'ACTIVE'.
region string
status This property is required. str
the status of the network. should be normally set to 'ACTIVE'.
region str
status This property is required. String
the status of the network. should be normally set to 'ACTIVE'.
region String

Import

Private network in a public cloud project can be imported using the service_name and the network_id as pn-xxxx format, separated by “/” E.g.,

bash

$ pulumi import ovh:CloudProject/networkPrivate:NetworkPrivate mynet service_name/network_id
Copy

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

Package Details

Repository
ovh ovh/pulumi-ovh
License
Apache-2.0
Notes
This Pulumi package is based on the ovh Terraform Provider.