getLoadBalancer

Get information on a load balancer for use in other resources. This data source provides all of the load balancers properties as configured on your DigitalOcean account. This is useful if the load balancer in question is not managed by the provider or you need to utilize any of the load balancers data. An error is triggered if the provided load balancer name does not exist.

Example Usage

Get the load balancer 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.GetLoadBalancerArgs;
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.getLoadBalancer(GetLoadBalancerArgs.builder()
.name("app")
.build());
ctx.export("lbOutput", example.applyValue(getLoadBalancerResult -> getLoadBalancerResult.ip()));
}
}

Return

A collection of values returned by getLoadBalancer.

Parameters

argument

A collection of arguments for invoking getLoadBalancer.


suspend fun getLoadBalancer(id: String? = null, name: String? = null): GetLoadBalancerResult

Return

A collection of values returned by getLoadBalancer.

See also

Parameters

id

The ID of load balancer.

name

The name of load balancer.


Return

A collection of values returned by getLoadBalancer.

See also

Parameters

argument

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