1. Packages
  2. Vultr
  3. API Docs
  4. ReservedIp
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

vultr.ReservedIp

Explore with Pulumi AI

vultr logo
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

    Provides a Vultr reserved IP resource. This can be used to create, read, modify, and delete reserved IP addresses on your Vultr account.

    Example Usage

    Create a new reserved IP:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@ediri/vultr";
    
    const myReservedIp = new vultr.ReservedIp("myReservedIp", {
        ipType: "v4",
        label: "my-reserved-ip",
        region: "sea",
    });
    
    import pulumi
    import ediri_vultr as vultr
    
    my_reserved_ip = vultr.ReservedIp("myReservedIp",
        ip_type="v4",
        label="my-reserved-ip",
        region="sea")
    
    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.NewReservedIp(ctx, "myReservedIp", &vultr.ReservedIpArgs{
    			IpType: pulumi.String("v4"),
    			Label:  pulumi.String("my-reserved-ip"),
    			Region: pulumi.String("sea"),
    		})
    		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 myReservedIp = new Vultr.ReservedIp("myReservedIp", new()
        {
            IpType = "v4",
            Label = "my-reserved-ip",
            Region = "sea",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.ReservedIp;
    import com.pulumi.vultr.ReservedIpArgs;
    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 myReservedIp = new ReservedIp("myReservedIp", ReservedIpArgs.builder()
                .ipType("v4")
                .label("my-reserved-ip")
                .region("sea")
                .build());
    
        }
    }
    
    resources:
      myReservedIp:
        type: vultr:ReservedIp
        properties:
          ipType: v4
          label: my-reserved-ip
          region: sea
    

    Attach a reserved IP to a instance:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@ediri/vultr";
    
    const myReservedIp = new vultr.ReservedIp("myReservedIp", {
        instanceId: "b9cc6fad-70b1-40ee-ab6a-4d622858962f",
        ipType: "v4",
        label: "my-reserved-ip",
        region: "sea",
    });
    
    import pulumi
    import ediri_vultr as vultr
    
    my_reserved_ip = vultr.ReservedIp("myReservedIp",
        instance_id="b9cc6fad-70b1-40ee-ab6a-4d622858962f",
        ip_type="v4",
        label="my-reserved-ip",
        region="sea")
    
    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.NewReservedIp(ctx, "myReservedIp", &vultr.ReservedIpArgs{
    			InstanceId: pulumi.String("b9cc6fad-70b1-40ee-ab6a-4d622858962f"),
    			IpType:     pulumi.String("v4"),
    			Label:      pulumi.String("my-reserved-ip"),
    			Region:     pulumi.String("sea"),
    		})
    		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 myReservedIp = new Vultr.ReservedIp("myReservedIp", new()
        {
            InstanceId = "b9cc6fad-70b1-40ee-ab6a-4d622858962f",
            IpType = "v4",
            Label = "my-reserved-ip",
            Region = "sea",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.ReservedIp;
    import com.pulumi.vultr.ReservedIpArgs;
    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 myReservedIp = new ReservedIp("myReservedIp", ReservedIpArgs.builder()
                .instanceId("b9cc6fad-70b1-40ee-ab6a-4d622858962f")
                .ipType("v4")
                .label("my-reserved-ip")
                .region("sea")
                .build());
    
        }
    }
    
    resources:
      myReservedIp:
        type: vultr:ReservedIp
        properties:
          instanceId: b9cc6fad-70b1-40ee-ab6a-4d622858962f
          ipType: v4
          label: my-reserved-ip
          region: sea
    

    Create ReservedIp Resource

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

    Constructor syntax

    new ReservedIp(name: string, args: ReservedIpArgs, opts?: CustomResourceOptions);
    @overload
    def ReservedIp(resource_name: str,
                   args: ReservedIpArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ReservedIp(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   ip_type: Optional[str] = None,
                   region: Optional[str] = None,
                   instance_id: Optional[str] = None,
                   label: Optional[str] = None)
    func NewReservedIp(ctx *Context, name string, args ReservedIpArgs, opts ...ResourceOption) (*ReservedIp, error)
    public ReservedIp(string name, ReservedIpArgs args, CustomResourceOptions? opts = null)
    public ReservedIp(String name, ReservedIpArgs args)
    public ReservedIp(String name, ReservedIpArgs args, CustomResourceOptions options)
    
    type: vultr:ReservedIp
    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 ReservedIpArgs
    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 ReservedIpArgs
    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 ReservedIpArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReservedIpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReservedIpArgs
    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 reservedIpResource = new Vultr.ReservedIp("reservedIpResource", new()
    {
        IpType = "string",
        Region = "string",
        InstanceId = "string",
        Label = "string",
    });
    
    example, err := vultr.NewReservedIp(ctx, "reservedIpResource", &vultr.ReservedIpArgs{
    	IpType:     pulumi.String("string"),
    	Region:     pulumi.String("string"),
    	InstanceId: pulumi.String("string"),
    	Label:      pulumi.String("string"),
    })
    
    var reservedIpResource = new ReservedIp("reservedIpResource", ReservedIpArgs.builder()
        .ipType("string")
        .region("string")
        .instanceId("string")
        .label("string")
        .build());
    
    reserved_ip_resource = vultr.ReservedIp("reservedIpResource",
        ip_type="string",
        region="string",
        instance_id="string",
        label="string")
    
    const reservedIpResource = new vultr.ReservedIp("reservedIpResource", {
        ipType: "string",
        region: "string",
        instanceId: "string",
        label: "string",
    });
    
    type: vultr:ReservedIp
    properties:
        instanceId: string
        ipType: string
        label: string
        region: string
    

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

    IpType string
    The type of reserved IP that you want. Either "v4" or "v6".
    Region string
    The region ID that you want the reserved IP to be created in.
    InstanceId string
    The VPS ID you want this reserved IP to be attached to.
    Label string
    The label you want to give your reserved IP.
    IpType string
    The type of reserved IP that you want. Either "v4" or "v6".
    Region string
    The region ID that you want the reserved IP to be created in.
    InstanceId string
    The VPS ID you want this reserved IP to be attached to.
    Label string
    The label you want to give your reserved IP.
    ipType String
    The type of reserved IP that you want. Either "v4" or "v6".
    region String
    The region ID that you want the reserved IP to be created in.
    instanceId String
    The VPS ID you want this reserved IP to be attached to.
    label String
    The label you want to give your reserved IP.
    ipType string
    The type of reserved IP that you want. Either "v4" or "v6".
    region string
    The region ID that you want the reserved IP to be created in.
    instanceId string
    The VPS ID you want this reserved IP to be attached to.
    label string
    The label you want to give your reserved IP.
    ip_type str
    The type of reserved IP that you want. Either "v4" or "v6".
    region str
    The region ID that you want the reserved IP to be created in.
    instance_id str
    The VPS ID you want this reserved IP to be attached to.
    label str
    The label you want to give your reserved IP.
    ipType String
    The type of reserved IP that you want. Either "v4" or "v6".
    region String
    The region ID that you want the reserved IP to be created in.
    instanceId String
    The VPS ID you want this reserved IP to be attached to.
    label String
    The label you want to give your reserved IP.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Subnet string
    The reserved IP's subnet.
    SubnetSize int
    The reserved IP's subnet size.
    Id string
    The provider-assigned unique ID for this managed resource.
    Subnet string
    The reserved IP's subnet.
    SubnetSize int
    The reserved IP's subnet size.
    id String
    The provider-assigned unique ID for this managed resource.
    subnet String
    The reserved IP's subnet.
    subnetSize Integer
    The reserved IP's subnet size.
    id string
    The provider-assigned unique ID for this managed resource.
    subnet string
    The reserved IP's subnet.
    subnetSize number
    The reserved IP's subnet size.
    id str
    The provider-assigned unique ID for this managed resource.
    subnet str
    The reserved IP's subnet.
    subnet_size int
    The reserved IP's subnet size.
    id String
    The provider-assigned unique ID for this managed resource.
    subnet String
    The reserved IP's subnet.
    subnetSize Number
    The reserved IP's subnet size.

    Look up Existing ReservedIp Resource

    Get an existing ReservedIp 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?: ReservedIpState, opts?: CustomResourceOptions): ReservedIp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            ip_type: Optional[str] = None,
            label: Optional[str] = None,
            region: Optional[str] = None,
            subnet: Optional[str] = None,
            subnet_size: Optional[int] = None) -> ReservedIp
    func GetReservedIp(ctx *Context, name string, id IDInput, state *ReservedIpState, opts ...ResourceOption) (*ReservedIp, error)
    public static ReservedIp Get(string name, Input<string> id, ReservedIpState? state, CustomResourceOptions? opts = null)
    public static ReservedIp get(String name, Output<String> id, ReservedIpState 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:
    InstanceId string
    The VPS ID you want this reserved IP to be attached to.
    IpType string
    The type of reserved IP that you want. Either "v4" or "v6".
    Label string
    The label you want to give your reserved IP.
    Region string
    The region ID that you want the reserved IP to be created in.
    Subnet string
    The reserved IP's subnet.
    SubnetSize int
    The reserved IP's subnet size.
    InstanceId string
    The VPS ID you want this reserved IP to be attached to.
    IpType string
    The type of reserved IP that you want. Either "v4" or "v6".
    Label string
    The label you want to give your reserved IP.
    Region string
    The region ID that you want the reserved IP to be created in.
    Subnet string
    The reserved IP's subnet.
    SubnetSize int
    The reserved IP's subnet size.
    instanceId String
    The VPS ID you want this reserved IP to be attached to.
    ipType String
    The type of reserved IP that you want. Either "v4" or "v6".
    label String
    The label you want to give your reserved IP.
    region String
    The region ID that you want the reserved IP to be created in.
    subnet String
    The reserved IP's subnet.
    subnetSize Integer
    The reserved IP's subnet size.
    instanceId string
    The VPS ID you want this reserved IP to be attached to.
    ipType string
    The type of reserved IP that you want. Either "v4" or "v6".
    label string
    The label you want to give your reserved IP.
    region string
    The region ID that you want the reserved IP to be created in.
    subnet string
    The reserved IP's subnet.
    subnetSize number
    The reserved IP's subnet size.
    instance_id str
    The VPS ID you want this reserved IP to be attached to.
    ip_type str
    The type of reserved IP that you want. Either "v4" or "v6".
    label str
    The label you want to give your reserved IP.
    region str
    The region ID that you want the reserved IP to be created in.
    subnet str
    The reserved IP's subnet.
    subnet_size int
    The reserved IP's subnet size.
    instanceId String
    The VPS ID you want this reserved IP to be attached to.
    ipType String
    The type of reserved IP that you want. Either "v4" or "v6".
    label String
    The label you want to give your reserved IP.
    region String
    The region ID that you want the reserved IP to be created in.
    subnet String
    The reserved IP's subnet.
    subnetSize Number
    The reserved IP's subnet size.

    Import

    Reserved IPs can be imported using the reserved IP ID, e.g.

    $ pulumi import vultr:index/reservedIp:ReservedIp my_reserved_ip b9cc6fad-70b1-40ee-ab6a-4d622858962f
    

    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.1 published on Monday, Jul 22, 2024 by dirien