ReservedIpArgs

data class ReservedIpArgs(val dropletId: Output<Int>? = null, val ipAddress: Output<String>? = null, val region: Output<String>? = null) : ConvertibleToJava<ReservedIpArgs>

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 example = new digitalocean.Droplet("example", {
name: "example",
size: digitalocean.DropletSlug.DropletS1VCPU1GB,
image: "ubuntu-22-04-x64",
region: digitalocean.Region.NYC3,
ipv6: true,
privateNetworking: true,
});
const exampleReservedIp = new digitalocean.ReservedIp("example", {
dropletId: example.id,
region: example.region,
});
import pulumi
import pulumi_digitalocean as digitalocean
example = digitalocean.Droplet("example",
name="example",
size=digitalocean.DropletSlug.DROPLET_S1_VCPU1_GB,
image="ubuntu-22-04-x64",
region=digitalocean.Region.NYC3,
ipv6=True,
private_networking=True)
example_reserved_ip = digitalocean.ReservedIp("example",
droplet_id=example.id,
region=example.region)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var example = new DigitalOcean.Droplet("example", new()
{
Name = "example",
Size = DigitalOcean.DropletSlug.DropletS1VCPU1GB,
Image = "ubuntu-22-04-x64",
Region = DigitalOcean.Region.NYC3,
Ipv6 = true,
PrivateNetworking = true,
});
var exampleReservedIp = new DigitalOcean.ReservedIp("example", new()
{
DropletId = example.Id,
Region = example.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 {
example, err := digitalocean.NewDroplet(ctx, "example", &digitalocean.DropletArgs{
Name: pulumi.String("example"),
Size: pulumi.String(digitalocean.DropletSlugDropletS1VCPU1GB),
Image: pulumi.String("ubuntu-22-04-x64"),
Region: pulumi.String(digitalocean.RegionNYC3),
Ipv6: pulumi.Bool(true),
PrivateNetworking: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = digitalocean.NewReservedIp(ctx, "example", &digitalocean.ReservedIpArgs{
DropletId: example.ID(),
Region: example.Region,
})
if err != nil {
return err
}
return nil
})
}
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 example = new Droplet("example", DropletArgs.builder()
.name("example")
.size("s-1vcpu-1gb")
.image("ubuntu-22-04-x64")
.region("nyc3")
.ipv6(true)
.privateNetworking(true)
.build());
var exampleReservedIp = new ReservedIp("exampleReservedIp", ReservedIpArgs.builder()
.dropletId(example.id())
.region(example.region())
.build());
}
}
resources:
example:
type: digitalocean:Droplet
properties:
name: example
size: s-1vcpu-1gb
image: ubuntu-22-04-x64
region: nyc3
ipv6: true
privateNetworking: true
exampleReservedIp:
type: digitalocean:ReservedIp
name: example
properties:
dropletId: ${example.id}
region: ${example.region}

Import

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

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

Constructors

Link copied to clipboard
constructor(dropletId: Output<Int>? = null, ipAddress: Output<String>? = null, region: Output<String>? = null)

Properties

Link copied to clipboard
val dropletId: Output<Int>? = null

The ID of Droplet that the reserved IP will be assigned to.

Link copied to clipboard
val ipAddress: Output<String>? = null

The IP Address of the resource

Link copied to clipboard
val region: Output<String>? = null

The region that the reserved IP is reserved to.

Functions

Link copied to clipboard
open override fun toJava(): ReservedIpArgs