1. Packages
  2. Vultr
  3. API Docs
  4. Vpc2
Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien

vultr.Vpc2

Explore with Pulumi AI

vultr logo
Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien

    Provides a Vultr VPC 2.0 resource. This can be used to create, read, and delete VPCs 2.0 on your Vultr account.

    Example Usage

    Create a new VPC 2.0 with an automatically generated CIDR block:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@ediri/vultr";
    
    const myVpc2 = new vultr.Vpc2("myVpc2", {
        description: "my vpc2",
        region: "ewr",
    });
    
    import pulumi
    import ediri_vultr as vultr
    
    my_vpc2 = vultr.Vpc2("myVpc2",
        description="my vpc2",
        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.NewVpc2(ctx, "myVpc2", &vultr.Vpc2Args{
    			Description: pulumi.String("my vpc2"),
    			Region:      pulumi.String("ewr"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = ediri.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myVpc2 = new Vultr.Vpc2("myVpc2", new()
        {
            Description = "my vpc2",
            Region = "ewr",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.Vpc2;
    import com.pulumi.vultr.Vpc2Args;
    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 myVpc2 = new Vpc2("myVpc2", Vpc2Args.builder()
                .description("my vpc2")
                .region("ewr")
                .build());
    
        }
    }
    
    resources:
      myVpc2:
        type: vultr:Vpc2
        properties:
          description: my vpc2
          region: ewr
    

    Create a new VPC 2.0 with a specified CIDR block:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@ediri/vultr";
    
    const myVpc2 = new vultr.Vpc2("myVpc2", {
        description: "my private vpc2",
        ipBlock: "10.0.0.0",
        prefixLength: 24,
        region: "ewr",
    });
    
    import pulumi
    import ediri_vultr as vultr
    
    my_vpc2 = vultr.Vpc2("myVpc2",
        description="my private vpc2",
        ip_block="10.0.0.0",
        prefix_length=24,
        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.NewVpc2(ctx, "myVpc2", &vultr.Vpc2Args{
    			Description:  pulumi.String("my private vpc2"),
    			IpBlock:      pulumi.String("10.0.0.0"),
    			PrefixLength: pulumi.Int(24),
    			Region:       pulumi.String("ewr"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = ediri.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myVpc2 = new Vultr.Vpc2("myVpc2", new()
        {
            Description = "my private vpc2",
            IpBlock = "10.0.0.0",
            PrefixLength = 24,
            Region = "ewr",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.Vpc2;
    import com.pulumi.vultr.Vpc2Args;
    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 myVpc2 = new Vpc2("myVpc2", Vpc2Args.builder()
                .description("my private vpc2")
                .ipBlock("10.0.0.0")
                .prefixLength(24)
                .region("ewr")
                .build());
    
        }
    }
    
    resources:
      myVpc2:
        type: vultr:Vpc2
        properties:
          description: my private vpc2
          ipBlock: 10.0.0.0
          prefixLength: 24
          region: ewr
    

    Create Vpc2 Resource

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

    Constructor syntax

    new Vpc2(name: string, args: Vpc2Args, opts?: CustomResourceOptions);
    @overload
    def Vpc2(resource_name: str,
             args: Vpc2Args,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Vpc2(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             region: Optional[str] = None,
             description: Optional[str] = None,
             ip_block: Optional[str] = None,
             ip_type: Optional[str] = None,
             prefix_length: Optional[int] = None)
    func NewVpc2(ctx *Context, name string, args Vpc2Args, opts ...ResourceOption) (*Vpc2, error)
    public Vpc2(string name, Vpc2Args args, CustomResourceOptions? opts = null)
    public Vpc2(String name, Vpc2Args args)
    public Vpc2(String name, Vpc2Args args, CustomResourceOptions options)
    
    type: vultr:Vpc2
    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 Vpc2Args
    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 Vpc2Args
    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 Vpc2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args Vpc2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args Vpc2Args
    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 vpc2Resource = new Vultr.Vpc2("vpc2Resource", new()
    {
        Region = "string",
        Description = "string",
        IpBlock = "string",
        IpType = "string",
        PrefixLength = 0,
    });
    
    example, err := vultr.NewVpc2(ctx, "vpc2Resource", &vultr.Vpc2Args{
    	Region:       pulumi.String("string"),
    	Description:  pulumi.String("string"),
    	IpBlock:      pulumi.String("string"),
    	IpType:       pulumi.String("string"),
    	PrefixLength: pulumi.Int(0),
    })
    
    var vpc2Resource = new Vpc2("vpc2Resource", Vpc2Args.builder()
        .region("string")
        .description("string")
        .ipBlock("string")
        .ipType("string")
        .prefixLength(0)
        .build());
    
    vpc2_resource = vultr.Vpc2("vpc2Resource",
        region="string",
        description="string",
        ip_block="string",
        ip_type="string",
        prefix_length=0)
    
    const vpc2Resource = new vultr.Vpc2("vpc2Resource", {
        region: "string",
        description: "string",
        ipBlock: "string",
        ipType: "string",
        prefixLength: 0,
    });
    
    type: vultr:Vpc2
    properties:
        description: string
        ipBlock: string
        ipType: string
        prefixLength: 0
        region: string
    

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

    Region string
    The region ID that you want the VPC 2.0 to be created in.
    Description string
    The description you want to give your VPC 2.0.
    IpBlock string
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    IpType string
    Accepted values: v4.
    PrefixLength int
    The number of bits for the netmask in CIDR notation. Example: 32
    Region string
    The region ID that you want the VPC 2.0 to be created in.
    Description string
    The description you want to give your VPC 2.0.
    IpBlock string
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    IpType string
    Accepted values: v4.
    PrefixLength int
    The number of bits for the netmask in CIDR notation. Example: 32
    region String
    The region ID that you want the VPC 2.0 to be created in.
    description String
    The description you want to give your VPC 2.0.
    ipBlock String
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ipType String
    Accepted values: v4.
    prefixLength Integer
    The number of bits for the netmask in CIDR notation. Example: 32
    region string
    The region ID that you want the VPC 2.0 to be created in.
    description string
    The description you want to give your VPC 2.0.
    ipBlock string
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ipType string
    Accepted values: v4.
    prefixLength number
    The number of bits for the netmask in CIDR notation. Example: 32
    region str
    The region ID that you want the VPC 2.0 to be created in.
    description str
    The description you want to give your VPC 2.0.
    ip_block str
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ip_type str
    Accepted values: v4.
    prefix_length int
    The number of bits for the netmask in CIDR notation. Example: 32
    region String
    The region ID that you want the VPC 2.0 to be created in.
    description String
    The description you want to give your VPC 2.0.
    ipBlock String
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ipType String
    Accepted values: v4.
    prefixLength 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 Vpc2 resource produces the following output properties:

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

    Look up Existing Vpc2 Resource

    Get an existing Vpc2 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?: Vpc2State, opts?: CustomResourceOptions): Vpc2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            date_created: Optional[str] = None,
            description: Optional[str] = None,
            ip_block: Optional[str] = None,
            ip_type: Optional[str] = None,
            prefix_length: Optional[int] = None,
            region: Optional[str] = None) -> Vpc2
    func GetVpc2(ctx *Context, name string, id IDInput, state *Vpc2State, opts ...ResourceOption) (*Vpc2, error)
    public static Vpc2 Get(string name, Input<string> id, Vpc2State? state, CustomResourceOptions? opts = null)
    public static Vpc2 get(String name, Output<String> id, Vpc2State 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 VPC 2.0 was added to your Vultr account.
    Description string
    The description you want to give your VPC 2.0.
    IpBlock string
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    IpType string
    Accepted values: v4.
    PrefixLength int
    The number of bits for the netmask in CIDR notation. Example: 32
    Region string
    The region ID that you want the VPC 2.0 to be created in.
    DateCreated string
    The date that the VPC 2.0 was added to your Vultr account.
    Description string
    The description you want to give your VPC 2.0.
    IpBlock string
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    IpType string
    Accepted values: v4.
    PrefixLength int
    The number of bits for the netmask in CIDR notation. Example: 32
    Region string
    The region ID that you want the VPC 2.0 to be created in.
    dateCreated String
    The date that the VPC 2.0 was added to your Vultr account.
    description String
    The description you want to give your VPC 2.0.
    ipBlock String
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ipType String
    Accepted values: v4.
    prefixLength Integer
    The number of bits for the netmask in CIDR notation. Example: 32
    region String
    The region ID that you want the VPC 2.0 to be created in.
    dateCreated string
    The date that the VPC 2.0 was added to your Vultr account.
    description string
    The description you want to give your VPC 2.0.
    ipBlock string
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ipType string
    Accepted values: v4.
    prefixLength number
    The number of bits for the netmask in CIDR notation. Example: 32
    region string
    The region ID that you want the VPC 2.0 to be created in.
    date_created str
    The date that the VPC 2.0 was added to your Vultr account.
    description str
    The description you want to give your VPC 2.0.
    ip_block str
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ip_type str
    Accepted values: v4.
    prefix_length int
    The number of bits for the netmask in CIDR notation. Example: 32
    region str
    The region ID that you want the VPC 2.0 to be created in.
    dateCreated String
    The date that the VPC 2.0 was added to your Vultr account.
    description String
    The description you want to give your VPC 2.0.
    ipBlock String
    The IPv4 subnet to be used when attaching instances to this VPC 2.0.
    ipType String
    Accepted values: v4.
    prefixLength Number
    The number of bits for the netmask in CIDR notation. Example: 32
    region String
    The region ID that you want the VPC 2.0 to be created in.

    Import

    VPCs 2.0 can be imported using the VPC 2.0 ID, e.g.

    $ pulumi import vultr:index/vpc2:Vpc2 my_vpc2 0e04f918-575e-41cb-86f6-d729b354a5a1
    

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

    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.21.0 published on Wednesday, Jun 19, 2024 by dirien