FloatingIpAssignment
Provides a resource for assigning an existing DigitalOcean Floating IP to a Droplet. This makes it easy to provision floating IP addresses that are not tied to the lifecycle of your Droplet.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobarFloatingIp = new DigitalOcean.FloatingIp("foobarFloatingIp", new DigitalOcean.FloatingIpArgs
{
Region = "sgp1",
});
var foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "ubuntu-18-04-x64",
Region = "sgp1",
Ipv6 = true,
PrivateNetworking = true,
});
var foobarFloatingIpAssignment = new DigitalOcean.FloatingIpAssignment("foobarFloatingIpAssignment", new DigitalOcean.FloatingIpAssignmentArgs
{
IpAddress = foobarFloatingIp.IpAddress,
DropletId = foobarDroplet.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
foobar_floating_ip = digitalocean.FloatingIp("foobarFloatingIp", region="sgp1")
foobar_droplet = digitalocean.Droplet("foobarDroplet",
size="s-1vcpu-1gb",
image="ubuntu-18-04-x64",
region="sgp1",
ipv6=True,
private_networking=True)
foobar_floating_ip_assignment = digitalocean.FloatingIpAssignment("foobarFloatingIpAssignment",
ip_address=foobar_floating_ip.ip_address,
droplet_id=foobar_droplet.id)import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const foobarFloatingIp = new digitalocean.FloatingIp("foobarFloatingIp", {region: "sgp1"});
const foobarDroplet = new digitalocean.Droplet("foobarDroplet", {
size: "s-1vcpu-1gb",
image: "ubuntu-18-04-x64",
region: "sgp1",
ipv6: true,
privateNetworking: true,
});
const foobarFloatingIpAssignment = new digitalocean.FloatingIpAssignment("foobarFloatingIpAssignment", {
ipAddress: foobarFloatingIp.ipAddress,
dropletId: foobarDroplet.id,
});Create a FloatingIpAssignment Resource
new FloatingIpAssignment(name: string, args: FloatingIpAssignmentArgs, opts?: CustomResourceOptions);def FloatingIpAssignment(resource_name, opts=None, droplet_id=None, ip_address=None, __props__=None);func NewFloatingIpAssignment(ctx *Context, name string, args FloatingIpAssignmentArgs, opts ...ResourceOption) (*FloatingIpAssignment, error)public FloatingIpAssignment(string name, FloatingIpAssignmentArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args FloatingIpAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FloatingIpAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FloatingIpAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
FloatingIpAssignment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The FloatingIpAssignment resource accepts the following input properties:
- droplet_
id float The ID of Droplet that the Floating IP will be assigned to.
- ip_
address str The Floating IP to assign to the Droplet.
Outputs
All input properties are implicitly available as output properties. Additionally, the FloatingIpAssignment resource produces the following output properties:
Look up an Existing FloatingIpAssignment Resource
Get an existing FloatingIpAssignment 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?: FloatingIpAssignmentState, opts?: CustomResourceOptions): FloatingIpAssignmentstatic get(resource_name, id, opts=None, droplet_id=None, ip_address=None, __props__=None);func GetFloatingIpAssignment(ctx *Context, name string, id IDInput, state *FloatingIpAssignmentState, opts ...ResourceOption) (*FloatingIpAssignment, error)public static FloatingIpAssignment Get(string name, Input<string> id, FloatingIpAssignmentState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- droplet_
id float The ID of Droplet that the Floating IP will be assigned to.
- ip_
address str The Floating IP to assign to the Droplet.
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.