get Droplet
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
A collection of arguments for invoking getDroplet.
Return
A collection of values returned by getDroplet.
See also
Parameters
The ID of the Droplet
The name of the Droplet.
A tag applied to the Droplet.
Return
A collection of values returned by getDroplet.
See also
Parameters
Builder for com.pulumi.digitalocean.kotlin.inputs.GetDropletPlainArgs.