![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.digitalocean.kotlin.ReservedIpArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-digitalocean-kotlin Show documentation
Show all versions of pulumi-digitalocean-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.digitalocean.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.ReservedIpArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* 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
*
* ```typescript
* 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,
* });
* ```
* ```python
* 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)
* ```
* ```csharp
* 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,
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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.
* ```sh
* $ pulumi import digitalocean:index/reservedIp:ReservedIp myip 192.168.0.1
* ```
* @property dropletId The ID of Droplet that the reserved IP will be assigned to.
* @property ipAddress The IP Address of the resource
* @property region The region that the reserved IP is reserved to.
*/
public data class ReservedIpArgs(
public val dropletId: Output? = null,
public val ipAddress: Output? = null,
public val region: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.digitalocean.ReservedIpArgs =
com.pulumi.digitalocean.ReservedIpArgs.builder()
.dropletId(dropletId?.applyValue({ args0 -> args0 }))
.ipAddress(ipAddress?.applyValue({ args0 -> args0 }))
.region(region?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ReservedIpArgs].
*/
@PulumiTagMarker
public class ReservedIpArgsBuilder internal constructor() {
private var dropletId: Output? = null
private var ipAddress: Output? = null
private var region: Output? = null
/**
* @param value The ID of Droplet that the reserved IP will be assigned to.
*/
@JvmName("imceundirlfoamgg")
public suspend fun dropletId(`value`: Output) {
this.dropletId = value
}
/**
* @param value The IP Address of the resource
*/
@JvmName("nhxlfcacuqbpfexj")
public suspend fun ipAddress(`value`: Output) {
this.ipAddress = value
}
/**
* @param value The region that the reserved IP is reserved to.
*/
@JvmName("yvepyfrrappwvxbt")
public suspend fun region(`value`: Output) {
this.region = value
}
/**
* @param value The ID of Droplet that the reserved IP will be assigned to.
*/
@JvmName("lcbdqimwwykoonqr")
public suspend fun dropletId(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.dropletId = mapped
}
/**
* @param value The IP Address of the resource
*/
@JvmName("cnilrhjjijyeawad")
public suspend fun ipAddress(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipAddress = mapped
}
/**
* @param value The region that the reserved IP is reserved to.
*/
@JvmName("xcouidvuovqnisvs")
public suspend fun region(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.region = mapped
}
internal fun build(): ReservedIpArgs = ReservedIpArgs(
dropletId = dropletId,
ipAddress = ipAddress,
region = region,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy