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

digitalocean.FloatingIp

Explore with Pulumi AI

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

    Deprecated: DigitalOcean Floating IPs have been renamed reserved IPs. This resource will be removed in a future release. Please use digitalocean.ReservedIp instead.

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

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const foobarDroplet = new digitalocean.Droplet("foobarDroplet", {
        size: "s-1vcpu-1gb",
        image: "ubuntu-18-04-x64",
        region: "sgp1",
        ipv6: true,
        privateNetworking: true,
    });
    const foobarFloatingIp = new digitalocean.FloatingIp("foobarFloatingIp", {
        dropletId: foobarDroplet.id,
        region: foobarDroplet.region,
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    foobar_droplet = digitalocean.Droplet("foobarDroplet",
        size="s-1vcpu-1gb",
        image="ubuntu-18-04-x64",
        region="sgp1",
        ipv6=True,
        private_networking=True)
    foobar_floating_ip = digitalocean.FloatingIp("foobarFloatingIp",
        droplet_id=foobar_droplet.id,
        region=foobar_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 {
    		foobarDroplet, err := digitalocean.NewDroplet(ctx, "foobarDroplet", &digitalocean.DropletArgs{
    			Size:              pulumi.String("s-1vcpu-1gb"),
    			Image:             pulumi.String("ubuntu-18-04-x64"),
    			Region:            pulumi.String("sgp1"),
    			Ipv6:              pulumi.Bool(true),
    			PrivateNetworking: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewFloatingIp(ctx, "foobarFloatingIp", &digitalocean.FloatingIpArgs{
    			DropletId: foobarDroplet.ID(),
    			Region:    foobarDroplet.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 foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new()
        {
            Size = "s-1vcpu-1gb",
            Image = "ubuntu-18-04-x64",
            Region = "sgp1",
            Ipv6 = true,
            PrivateNetworking = true,
        });
    
        var foobarFloatingIp = new DigitalOcean.FloatingIp("foobarFloatingIp", new()
        {
            DropletId = foobarDroplet.Id,
            Region = foobarDroplet.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.FloatingIp;
    import com.pulumi.digitalocean.FloatingIpArgs;
    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 foobarDroplet = new Droplet("foobarDroplet", DropletArgs.builder()        
                .size("s-1vcpu-1gb")
                .image("ubuntu-18-04-x64")
                .region("sgp1")
                .ipv6(true)
                .privateNetworking(true)
                .build());
    
            var foobarFloatingIp = new FloatingIp("foobarFloatingIp", FloatingIpArgs.builder()        
                .dropletId(foobarDroplet.id())
                .region(foobarDroplet.region())
                .build());
    
        }
    }
    
    resources:
      foobarDroplet:
        type: digitalocean:Droplet
        properties:
          size: s-1vcpu-1gb
          image: ubuntu-18-04-x64
          region: sgp1
          ipv6: true
          privateNetworking: true
      foobarFloatingIp:
        type: digitalocean:FloatingIp
        properties:
          dropletId: ${foobarDroplet.id}
          region: ${foobarDroplet.region}
    

    Create FloatingIp Resource

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

    Constructor syntax

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

    Example

    The following reference example uses placeholder values for all input properties.

    var floatingIpResource = new DigitalOcean.FloatingIp("floatingIpResource", new()
    {
        Region = "string",
        DropletId = 0,
        IpAddress = "string",
    });
    
    example, err := digitalocean.NewFloatingIp(ctx, "floatingIpResource", &digitalocean.FloatingIpArgs{
    	Region:    pulumi.String("string"),
    	DropletId: pulumi.Int(0),
    	IpAddress: pulumi.String("string"),
    })
    
    var floatingIpResource = new FloatingIp("floatingIpResource", FloatingIpArgs.builder()        
        .region("string")
        .dropletId(0)
        .ipAddress("string")
        .build());
    
    floating_ip_resource = digitalocean.FloatingIp("floatingIpResource",
        region="string",
        droplet_id=0,
        ip_address="string")
    
    const floatingIpResource = new digitalocean.FloatingIp("floatingIpResource", {
        region: "string",
        dropletId: 0,
        ipAddress: "string",
    });
    
    type: digitalocean:FloatingIp
    properties:
        dropletId: 0
        ipAddress: string
        region: string
    

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

    Region string
    The region that the Floating IP is reserved to.
    DropletId int
    The ID of Droplet that the Floating IP will be assigned to.
    IpAddress string
    The IP Address of the resource
    Region string
    The region that the Floating IP is reserved to.
    DropletId int
    The ID of Droplet that the Floating IP will be assigned to.
    IpAddress string
    The IP Address of the resource
    region String
    The region that the Floating IP is reserved to.
    dropletId Integer
    The ID of Droplet that the Floating IP will be assigned to.
    ipAddress String
    The IP Address of the resource
    region string
    The region that the Floating IP is reserved to.
    dropletId number
    The ID of Droplet that the Floating IP will be assigned to.
    ipAddress string
    The IP Address of the resource
    region str
    The region that the Floating IP is reserved to.
    droplet_id int
    The ID of Droplet that the Floating IP will be assigned to.
    ip_address str
    The IP Address of the resource
    region String
    The region that the Floating IP is reserved to.
    dropletId Number
    The ID of Droplet that the Floating 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 FloatingIp resource produces the following output properties:

    FloatingIpUrn string
    The uniform resource name of the floating ip
    Id string
    The provider-assigned unique ID for this managed resource.
    FloatingIpUrn string
    The uniform resource name of the floating ip
    Id string
    The provider-assigned unique ID for this managed resource.
    floatingIpUrn String
    The uniform resource name of the floating ip
    id String
    The provider-assigned unique ID for this managed resource.
    floatingIpUrn string
    The uniform resource name of the floating ip
    id string
    The provider-assigned unique ID for this managed resource.
    floating_ip_urn str
    The uniform resource name of the floating ip
    id str
    The provider-assigned unique ID for this managed resource.
    floatingIpUrn String
    The uniform resource name of the floating ip
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing FloatingIp Resource

    Get an existing FloatingIp 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?: FloatingIpState, opts?: CustomResourceOptions): FloatingIp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            droplet_id: Optional[int] = None,
            floating_ip_urn: Optional[str] = None,
            ip_address: Optional[str] = None,
            region: Optional[str] = None) -> FloatingIp
    func GetFloatingIp(ctx *Context, name string, id IDInput, state *FloatingIpState, opts ...ResourceOption) (*FloatingIp, error)
    public static FloatingIp Get(string name, Input<string> id, FloatingIpState? state, CustomResourceOptions? opts = null)
    public static FloatingIp get(String name, Output<String> id, FloatingIpState 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 Floating IP will be assigned to.
    FloatingIpUrn string
    The uniform resource name of the floating ip
    IpAddress string
    The IP Address of the resource
    Region string
    The region that the Floating IP is reserved to.
    DropletId int
    The ID of Droplet that the Floating IP will be assigned to.
    FloatingIpUrn string
    The uniform resource name of the floating ip
    IpAddress string
    The IP Address of the resource
    Region string
    The region that the Floating IP is reserved to.
    dropletId Integer
    The ID of Droplet that the Floating IP will be assigned to.
    floatingIpUrn String
    The uniform resource name of the floating ip
    ipAddress String
    The IP Address of the resource
    region String
    The region that the Floating IP is reserved to.
    dropletId number
    The ID of Droplet that the Floating IP will be assigned to.
    floatingIpUrn string
    The uniform resource name of the floating ip
    ipAddress string
    The IP Address of the resource
    region string
    The region that the Floating IP is reserved to.
    droplet_id int
    The ID of Droplet that the Floating IP will be assigned to.
    floating_ip_urn str
    The uniform resource name of the floating ip
    ip_address str
    The IP Address of the resource
    region str
    The region that the Floating IP is reserved to.
    dropletId Number
    The ID of Droplet that the Floating IP will be assigned to.
    floatingIpUrn String
    The uniform resource name of the floating ip
    ipAddress String
    The IP Address of the resource
    region String
    The region that the Floating IP is reserved to.

    Import

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

    $ pulumi import digitalocean:index/floatingIp:FloatingIp myip 192.168.0.1
    

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

    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