getDroplet

Get information on a Droplet for use in other resources. This data source provides all of the Droplet's properties as configured on your DigitalOcean account. This is useful if the Droplet in question is not managed by this provider or you need to utilize any of the Droplet's data. Note: This data source returns a single Droplet. When specifying a tag, an error is triggered if more than one Droplet is found.

Example Usage

Get the Droplet by name:

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetDropletArgs;
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) {
final var example = DigitaloceanFunctions.getDroplet(GetDropletArgs.builder()
.name("web")
.build());
ctx.export("dropletOutput", example.applyValue(getDropletResult -> getDropletResult.ipv4Address()));
}
}

Return

A collection of values returned by getDroplet.

Parameters

argument

A collection of arguments for invoking getDroplet.


suspend fun getDroplet(id: Int? = null, name: String? = null, tag: String? = null): GetDropletResult

Return

A collection of values returned by getDroplet.

See also

Parameters

id

The ID of the Droplet

name

The name of the Droplet.

tag

A tag applied to the Droplet.


suspend fun getDroplet(argument: suspend GetDropletPlainArgsBuilder.() -> Unit): GetDropletResult

Return

A collection of values returned by getDroplet.

See also

Parameters

argument

Builder for com.pulumi.digitalocean.kotlin.inputs.GetDropletPlainArgs.