1. Packages
  2. DigitalOcean
  3. API Docs
  4. ReservedIp
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

digitalocean.ReservedIp

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

    Provides a DigitalOcean reserved IP to represent a publicly-accessible static IP addresses that can be mapped to one of your Droplets.

    NOTE: Reserved IPs can be assigned to a Droplet either directly on the digitalocean.ReservedIp resource by setting a droplet_id or using the digitalocean.ReservedIpAssignment resource, but the two cannot be used together.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const exampleDroplet = new digitalocean.Droplet("exampleDroplet", {
        size: "s-1vcpu-1gb",
        image: "ubuntu-22-04-x64",
        region: "nyc3",
        ipv6: true,
        privateNetworking: true,
    });
    const exampleReservedIp = new digitalocean.ReservedIp("exampleReservedIp", {
        dropletId: exampleDroplet.id,
        region: exampleDroplet.region,
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    example_droplet = digitalocean.Droplet("exampleDroplet",
        size="s-1vcpu-1gb",
        image="ubuntu-22-04-x64",
        region="nyc3",
        ipv6=True,
        private_networking=True)
    example_reserved_ip = digitalocean.ReservedIp("exampleReservedIp",
        droplet_id=example_droplet.id,
        region=example_droplet.region)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleDroplet, err := digitalocean.NewDroplet(ctx, "exampleDroplet", &digitalocean.DropletArgs{
    			Size:              pulumi.String("s-1vcpu-1gb"),
    			Image:             pulumi.String("ubuntu-22-04-x64"),
    			Region:            pulumi.String("nyc3"),
    			Ipv6:              pulumi.Bool(true),
    			PrivateNetworking: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewReservedIp(ctx, "exampleReservedIp", &digitalocean.ReservedIpArgs{
    			DropletId: exampleDroplet.ID(),
    			Region:    exampleDroplet.Region,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleDroplet = new DigitalOcean.Droplet("exampleDroplet", new()
        {
            Size = "s-1vcpu-1gb",
            Image = "ubuntu-22-04-x64",
            Region = "nyc3",
            Ipv6 = true,
            PrivateNetworking = true,
        });
    
        var exampleReservedIp = new DigitalOcean.ReservedIp("exampleReservedIp", new()
        {
            DropletId = exampleDroplet.Id,
            Region = exampleDroplet.Region,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.Droplet;
    import com.pulumi.digitalocean.DropletArgs;
    import com.pulumi.digitalocean.ReservedIp;
    import com.pulumi.digitalocean.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 exampleDroplet = new Droplet("exampleDroplet", DropletArgs.builder()        
                .size("s-1vcpu-1gb")
                .image("ubuntu-22-04-x64")
                .region("nyc3")
                .ipv6(true)
                .privateNetworking(true)
                .build());
    
            var exampleReservedIp = new ReservedIp("exampleReservedIp", ReservedIpArgs.builder()        
                .dropletId(exampleDroplet.id())
                .region(exampleDroplet.region())
                .build());
    
        }
    }
    
    resources:
      exampleDroplet:
        type: digitalocean:Droplet
        properties:
          size: s-1vcpu-1gb
          image: ubuntu-22-04-x64
          region: nyc3
          ipv6: true
          privateNetworking: true
      exampleReservedIp:
        type: digitalocean:ReservedIp
        properties:
          dropletId: ${exampleDroplet.id}
          region: ${exampleDroplet.region}
    

    Create ReservedIp Resource

    new ReservedIp(name: string, args: ReservedIpArgs, opts?: CustomResourceOptions);
    @overload
    def ReservedIp(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   droplet_id: Optional[int] = None,
                   ip_address: Optional[str] = None,
                   region: Optional[str] = None)
    @overload
    def ReservedIp(resource_name: str,
                   args: ReservedIpArgs,
                   opts: Optional[ResourceOptions] = 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: digitalocean:ReservedIp
    properties: # The arguments to resource properties.
    options: # 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.
    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.

    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

    The ReservedIp resource accepts the following input properties:

    Region string
    The region that the reserved IP is reserved to.
    DropletId int
    The ID of Droplet that the reserved IP will be assigned to.
    IpAddress string
    The IP Address of the resource
    Region string
    The region that the reserved IP is reserved to.
    DropletId int
    The ID of Droplet that the reserved IP will be assigned to.
    IpAddress string
    The IP Address of the resource
    region String
    The region that the reserved IP is reserved to.
    dropletId Integer
    The ID of Droplet that the reserved IP will be assigned to.
    ipAddress String
    The IP Address of the resource
    region string
    The region that the reserved IP is reserved to.
    dropletId number
    The ID of Droplet that the reserved IP will be assigned to.
    ipAddress string
    The IP Address of the resource
    region str
    The region that the reserved IP is reserved to.
    droplet_id int
    The ID of Droplet that the reserved IP will be assigned to.
    ip_address str
    The IP Address of the resource
    region String
    The region that the reserved IP is reserved to.
    dropletId Number
    The ID of Droplet that the reserved IP will be assigned to.
    ipAddress String
    The IP Address of the resource

    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.
    ReservedIpUrn string
    The uniform resource name of the reserved ip
    Id string
    The provider-assigned unique ID for this managed resource.
    ReservedIpUrn string
    The uniform resource name of the reserved ip
    id String
    The provider-assigned unique ID for this managed resource.
    reservedIpUrn String
    The uniform resource name of the reserved ip
    id string
    The provider-assigned unique ID for this managed resource.
    reservedIpUrn string
    The uniform resource name of the reserved ip
    id str
    The provider-assigned unique ID for this managed resource.
    reserved_ip_urn str
    The uniform resource name of the reserved ip
    id String
    The provider-assigned unique ID for this managed resource.
    reservedIpUrn String
    The uniform resource name of the reserved ip

    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,
            droplet_id: Optional[int] = None,
            ip_address: Optional[str] = None,
            region: Optional[str] = None,
            reserved_ip_urn: Optional[str] = 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:
    DropletId int
    The ID of Droplet that the reserved IP will be assigned to.
    IpAddress string
    The IP Address of the resource
    Region string
    The region that the reserved IP is reserved to.
    ReservedIpUrn string
    The uniform resource name of the reserved ip
    DropletId int
    The ID of Droplet that the reserved IP will be assigned to.
    IpAddress string
    The IP Address of the resource
    Region string
    The region that the reserved IP is reserved to.
    ReservedIpUrn string
    The uniform resource name of the reserved ip
    dropletId Integer
    The ID of Droplet that the reserved IP will be assigned to.
    ipAddress String
    The IP Address of the resource
    region String
    The region that the reserved IP is reserved to.
    reservedIpUrn String
    The uniform resource name of the reserved ip
    dropletId number
    The ID of Droplet that the reserved IP will be assigned to.
    ipAddress string
    The IP Address of the resource
    region string
    The region that the reserved IP is reserved to.
    reservedIpUrn string
    The uniform resource name of the reserved ip
    droplet_id int
    The ID of Droplet that the reserved IP will be assigned to.
    ip_address str
    The IP Address of the resource
    region str
    The region that the reserved IP is reserved to.
    reserved_ip_urn str
    The uniform resource name of the reserved ip
    dropletId Number
    The ID of Droplet that the reserved IP will be assigned to.
    ipAddress String
    The IP Address of the resource
    region String
    The region that the reserved IP is reserved to.
    reservedIpUrn String
    The uniform resource name of the reserved ip

    Import

    Reserved IPs can be imported using the ip, e.g.

    $ pulumi import digitalocean:index/reservedIp:ReservedIp myip 192.168.0.1
    

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi