Class 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,
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class FloatingIpAssignment : CustomResource
Constructors
View SourceFloatingIpAssignment(String, FloatingIpAssignmentArgs, CustomResourceOptions)
Create a FloatingIpAssignment resource with the given unique name, arguments, and options.
Declaration
public FloatingIpAssignment(string name, FloatingIpAssignmentArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| FloatingIpAssignmentArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDropletId
The ID of Droplet that the Floating IP will be assigned to.
Declaration
public Output<int> DropletId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
IpAddress
The Floating IP to assign to the Droplet.
Declaration
public Output<string> IpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, FloatingIpAssignmentState, CustomResourceOptions)
Get an existing FloatingIpAssignment resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static FloatingIpAssignment Get(string name, Input<string> id, FloatingIpAssignmentState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| FloatingIpAssignmentState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| FloatingIpAssignment |