![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.digitalocean.kotlin.FloatingIpArgs.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.FloatingIpArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* > **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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
* const foobar = new digitalocean.Droplet("foobar", {
* name: "baz",
* size: digitalocean.DropletSlug.DropletS1VCPU1GB,
* image: "ubuntu-18-04-x64",
* region: digitalocean.Region.SGP1,
* ipv6: true,
* privateNetworking: true,
* });
* const foobarFloatingIp = new digitalocean.FloatingIp("foobar", {
* dropletId: foobar.id,
* region: foobar.region,
* });
* ```
* ```python
* import pulumi
* import pulumi_digitalocean as digitalocean
* foobar = digitalocean.Droplet("foobar",
* name="baz",
* size=digitalocean.DropletSlug.DROPLET_S1_VCPU1_GB,
* image="ubuntu-18-04-x64",
* region=digitalocean.Region.SGP1,
* ipv6=True,
* private_networking=True)
* foobar_floating_ip = digitalocean.FloatingIp("foobar",
* droplet_id=foobar.id,
* region=foobar.region)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using DigitalOcean = Pulumi.DigitalOcean;
* return await Deployment.RunAsync(() =>
* {
* var foobar = new DigitalOcean.Droplet("foobar", new()
* {
* Name = "baz",
* Size = DigitalOcean.DropletSlug.DropletS1VCPU1GB,
* Image = "ubuntu-18-04-x64",
* Region = DigitalOcean.Region.SGP1,
* Ipv6 = true,
* PrivateNetworking = true,
* });
* var foobarFloatingIp = new DigitalOcean.FloatingIp("foobar", new()
* {
* DropletId = foobar.Id,
* Region = foobar.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 {
* foobar, err := digitalocean.NewDroplet(ctx, "foobar", &digitalocean.DropletArgs{
* Name: pulumi.String("baz"),
* Size: pulumi.String(digitalocean.DropletSlugDropletS1VCPU1GB),
* Image: pulumi.String("ubuntu-18-04-x64"),
* Region: pulumi.String(digitalocean.RegionSGP1),
* Ipv6: pulumi.Bool(true),
* PrivateNetworking: pulumi.Bool(true),
* })
* if err != nil {
* return err
* }
* _, err = digitalocean.NewFloatingIp(ctx, "foobar", &digitalocean.FloatingIpArgs{
* DropletId: foobar.ID(),
* Region: foobar.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.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 foobar = new Droplet("foobar", DropletArgs.builder()
* .name("baz")
* .size("s-1vcpu-1gb")
* .image("ubuntu-18-04-x64")
* .region("sgp1")
* .ipv6(true)
* .privateNetworking(true)
* .build());
* var foobarFloatingIp = new FloatingIp("foobarFloatingIp", FloatingIpArgs.builder()
* .dropletId(foobar.id())
* .region(foobar.region())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* foobar:
* type: digitalocean:Droplet
* properties:
* name: baz
* size: s-1vcpu-1gb
* image: ubuntu-18-04-x64
* region: sgp1
* ipv6: true
* privateNetworking: true
* foobarFloatingIp:
* type: digitalocean:FloatingIp
* name: foobar
* properties:
* dropletId: ${foobar.id}
* region: ${foobar.region}
* ```
*
* ## Import
* Floating IPs can be imported using the `ip`, e.g.
* ```sh
* $ pulumi import digitalocean:index/floatingIp:FloatingIp myip 192.168.0.1
* ```
* @property dropletId The ID of Droplet that the Floating IP will be assigned to.
* @property ipAddress The IP Address of the resource
* @property region The region that the Floating IP is reserved to.
*/
public data class FloatingIpArgs(
public val dropletId: Output? = null,
public val ipAddress: Output? = null,
public val region: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.digitalocean.FloatingIpArgs =
com.pulumi.digitalocean.FloatingIpArgs.builder()
.dropletId(dropletId?.applyValue({ args0 -> args0 }))
.ipAddress(ipAddress?.applyValue({ args0 -> args0 }))
.region(region?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [FloatingIpArgs].
*/
@PulumiTagMarker
public class FloatingIpArgsBuilder 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 Floating IP will be assigned to.
*/
@JvmName("tacumdibcsjlflgj")
public suspend fun dropletId(`value`: Output) {
this.dropletId = value
}
/**
* @param value The IP Address of the resource
*/
@JvmName("xbbvpltjakayhvmu")
public suspend fun ipAddress(`value`: Output) {
this.ipAddress = value
}
/**
* @param value The region that the Floating IP is reserved to.
*/
@JvmName("vmnllfbtyqoxjwbk")
public suspend fun region(`value`: Output) {
this.region = value
}
/**
* @param value The ID of Droplet that the Floating IP will be assigned to.
*/
@JvmName("yngxlyeluelfovuc")
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("takpfuvgjugdassl")
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 Floating IP is reserved to.
*/
@JvmName("txyntlfsleyioher")
public suspend fun region(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.region = mapped
}
internal fun build(): FloatingIpArgs = FloatingIpArgs(
dropletId = dropletId,
ipAddress = ipAddress,
region = region,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy