1. Packages
  2. Vultr
  3. API Docs
  4. PrivateNetwork
Vultr v2.19.0 published on Friday, Jan 5, 2024 by dirien

vultr.PrivateNetwork

Explore with Pulumi AI

vultr logo
Vultr v2.19.0 published on Friday, Jan 5, 2024 by dirien

    Deprecated: Use vultr.Vpc instead

    Provides a Vultr private network resource. This can be used to create, read, and delete private networks on your Vultr account.

    Example Usage

    Create a new private network with an automatically generated CIDR block

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = ediri.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myNetwork = new Vultr.PrivateNetwork("myNetwork", new()
        {
            Description = "my private network",
            Region = "ewr",
        });
    
    });
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.NewPrivateNetwork(ctx, "myNetwork", &vultr.PrivateNetworkArgs{
    			Description: pulumi.String("my private network"),
    			Region:      pulumi.String("ewr"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.PrivateNetwork;
    import com.pulumi.vultr.PrivateNetworkArgs;
    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 myNetwork = new PrivateNetwork("myNetwork", PrivateNetworkArgs.builder()        
                .description("my private network")
                .region("ewr")
                .build());
    
        }
    }
    
    import pulumi
    import ediri_vultr as vultr
    
    my_network = vultr.PrivateNetwork("myNetwork",
        description="my private network",
        region="ewr")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@ediri/vultr";
    
    const myNetwork = new vultr.PrivateNetwork("myNetwork", {
        description: "my private network",
        region: "ewr",
    });
    
    resources:
      myNetwork:
        type: vultr:PrivateNetwork
        properties:
          description: my private network
          region: ewr
    

    Create a new private network with a specified CIDR block

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = ediri.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myNetwork = new Vultr.PrivateNetwork("myNetwork", new()
        {
            Description = "my private network",
            Region = "ewr",
            V4Subnet = "10.0.0.0",
            V4SubnetMask = 24,
        });
    
    });
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.NewPrivateNetwork(ctx, "myNetwork", &vultr.PrivateNetworkArgs{
    			Description:  pulumi.String("my private network"),
    			Region:       pulumi.String("ewr"),
    			V4Subnet:     pulumi.String("10.0.0.0"),
    			V4SubnetMask: pulumi.Int(24),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.PrivateNetwork;
    import com.pulumi.vultr.PrivateNetworkArgs;
    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 myNetwork = new PrivateNetwork("myNetwork", PrivateNetworkArgs.builder()        
                .description("my private network")
                .region("ewr")
                .v4Subnet("10.0.0.0")
                .v4SubnetMask(24)
                .build());
    
        }
    }
    
    import pulumi
    import ediri_vultr as vultr
    
    my_network = vultr.PrivateNetwork("myNetwork",
        description="my private network",
        region="ewr",
        v4_subnet="10.0.0.0",
        v4_subnet_mask=24)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@ediri/vultr";
    
    const myNetwork = new vultr.PrivateNetwork("myNetwork", {
        description: "my private network",
        region: "ewr",
        v4Subnet: "10.0.0.0",
        v4SubnetMask: 24,
    });
    
    resources:
      myNetwork:
        type: vultr:PrivateNetwork
        properties:
          description: my private network
          region: ewr
          v4Subnet: 10.0.0.0
          v4SubnetMask: 24
    

    Create PrivateNetwork Resource

    new PrivateNetwork(name: string, args: PrivateNetworkArgs, opts?: CustomResourceOptions);
    @overload
    def PrivateNetwork(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       description: Optional[str] = None,
                       region: Optional[str] = None,
                       v4_subnet: Optional[str] = None,
                       v4_subnet_mask: Optional[int] = None)
    @overload
    def PrivateNetwork(resource_name: str,
                       args: PrivateNetworkArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewPrivateNetwork(ctx *Context, name string, args PrivateNetworkArgs, opts ...ResourceOption) (*PrivateNetwork, error)
    public PrivateNetwork(string name, PrivateNetworkArgs args, CustomResourceOptions? opts = null)
    public PrivateNetwork(String name, PrivateNetworkArgs args)
    public PrivateNetwork(String name, PrivateNetworkArgs args, CustomResourceOptions options)
    
    type: vultr:PrivateNetwork
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args PrivateNetworkArgs
    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 PrivateNetworkArgs
    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 PrivateNetworkArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PrivateNetworkArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PrivateNetworkArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    PrivateNetwork Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The PrivateNetwork resource accepts the following input properties:

    Region string
    The region ID that you want the network to be created in.
    Description string
    The description you want to give your network.
    V4Subnet string
    The IPv4 subnet to be used when attaching instances to this network.
    V4SubnetMask int
    The number of bits for the netmask in CIDR notation. Example: 32
    Region string
    The region ID that you want the network to be created in.
    Description string
    The description you want to give your network.
    V4Subnet string
    The IPv4 subnet to be used when attaching instances to this network.
    V4SubnetMask int
    The number of bits for the netmask in CIDR notation. Example: 32
    region String
    The region ID that you want the network to be created in.
    description String
    The description you want to give your network.
    v4Subnet String
    The IPv4 subnet to be used when attaching instances to this network.
    v4SubnetMask Integer
    The number of bits for the netmask in CIDR notation. Example: 32
    region string
    The region ID that you want the network to be created in.
    description string
    The description you want to give your network.
    v4Subnet string
    The IPv4 subnet to be used when attaching instances to this network.
    v4SubnetMask number
    The number of bits for the netmask in CIDR notation. Example: 32
    region str
    The region ID that you want the network to be created in.
    description str
    The description you want to give your network.
    v4_subnet str
    The IPv4 subnet to be used when attaching instances to this network.
    v4_subnet_mask int
    The number of bits for the netmask in CIDR notation. Example: 32
    region String
    The region ID that you want the network to be created in.
    description String
    The description you want to give your network.
    v4Subnet String
    The IPv4 subnet to be used when attaching instances to this network.
    v4SubnetMask Number
    The number of bits for the netmask in CIDR notation. Example: 32

    Outputs

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

    DateCreated string
    The date that the network was added to your Vultr account.
    Id string
    The provider-assigned unique ID for this managed resource.
    DateCreated string
    The date that the network was added to your Vultr account.
    Id string
    The provider-assigned unique ID for this managed resource.
    dateCreated String
    The date that the network was added to your Vultr account.
    id String
    The provider-assigned unique ID for this managed resource.
    dateCreated string
    The date that the network was added to your Vultr account.
    id string
    The provider-assigned unique ID for this managed resource.
    date_created str
    The date that the network was added to your Vultr account.
    id str
    The provider-assigned unique ID for this managed resource.
    dateCreated String
    The date that the network was added to your Vultr account.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PrivateNetwork Resource

    Get an existing PrivateNetwork 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?: PrivateNetworkState, opts?: CustomResourceOptions): PrivateNetwork
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            date_created: Optional[str] = None,
            description: Optional[str] = None,
            region: Optional[str] = None,
            v4_subnet: Optional[str] = None,
            v4_subnet_mask: Optional[int] = None) -> PrivateNetwork
    func GetPrivateNetwork(ctx *Context, name string, id IDInput, state *PrivateNetworkState, opts ...ResourceOption) (*PrivateNetwork, error)
    public static PrivateNetwork Get(string name, Input<string> id, PrivateNetworkState? state, CustomResourceOptions? opts = null)
    public static PrivateNetwork get(String name, Output<String> id, PrivateNetworkState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    DateCreated string
    The date that the network was added to your Vultr account.
    Description string
    The description you want to give your network.
    Region string
    The region ID that you want the network to be created in.
    V4Subnet string
    The IPv4 subnet to be used when attaching instances to this network.
    V4SubnetMask int
    The number of bits for the netmask in CIDR notation. Example: 32
    DateCreated string
    The date that the network was added to your Vultr account.
    Description string
    The description you want to give your network.
    Region string
    The region ID that you want the network to be created in.
    V4Subnet string
    The IPv4 subnet to be used when attaching instances to this network.
    V4SubnetMask int
    The number of bits for the netmask in CIDR notation. Example: 32
    dateCreated String
    The date that the network was added to your Vultr account.
    description String
    The description you want to give your network.
    region String
    The region ID that you want the network to be created in.
    v4Subnet String
    The IPv4 subnet to be used when attaching instances to this network.
    v4SubnetMask Integer
    The number of bits for the netmask in CIDR notation. Example: 32
    dateCreated string
    The date that the network was added to your Vultr account.
    description string
    The description you want to give your network.
    region string
    The region ID that you want the network to be created in.
    v4Subnet string
    The IPv4 subnet to be used when attaching instances to this network.
    v4SubnetMask number
    The number of bits for the netmask in CIDR notation. Example: 32
    date_created str
    The date that the network was added to your Vultr account.
    description str
    The description you want to give your network.
    region str
    The region ID that you want the network to be created in.
    v4_subnet str
    The IPv4 subnet to be used when attaching instances to this network.
    v4_subnet_mask int
    The number of bits for the netmask in CIDR notation. Example: 32
    dateCreated String
    The date that the network was added to your Vultr account.
    description String
    The description you want to give your network.
    region String
    The region ID that you want the network to be created in.
    v4Subnet String
    The IPv4 subnet to be used when attaching instances to this network.
    v4SubnetMask Number
    The number of bits for the netmask in CIDR notation. Example: 32

    Import

    Networks can be imported using the network ID, e.g.

     $ pulumi import vultr:index/privateNetwork:PrivateNetwork my_network 0e04f918-575e-41cb-86f6-d729b354a5a1
    

    Package Details

    Repository
    vultr dirien/pulumi-vultr
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vultr Terraform Provider.
    vultr logo
    Vultr v2.19.0 published on Friday, Jan 5, 2024 by dirien