Civo v2.4.6 published on Wednesday, Nov 6, 2024 by Pulumi
civo.getLoadBalancer
Explore with Pulumi AI
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 Civo account.
An error will be raised if the provided load balancer name does not exist in your Civo account.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
// TODO
const my-lb = civo.getLoadBalancer({
name: "lb-name",
region: "LON1",
});
export const civoLoadbalancerOutput = my_lb.then(my_lb => my_lb.publicIp);
import pulumi
import pulumi_civo as civo
# TODO
my_lb = civo.get_load_balancer(name="lb-name",
region="LON1")
pulumi.export("civoLoadbalancerOutput", my_lb.public_ip)
package main
import (
"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// TODO
my_lb, err := civo.GetLoadBalancer(ctx, &civo.GetLoadBalancerArgs{
Name: pulumi.StringRef("lb-name"),
Region: pulumi.StringRef("LON1"),
}, nil)
if err != nil {
return err
}
ctx.Export("civoLoadbalancerOutput", my_lb.PublicIp)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() =>
{
// TODO
var my_lb = Civo.GetLoadBalancer.Invoke(new()
{
Name = "lb-name",
Region = "LON1",
});
return new Dictionary<string, object?>
{
["civoLoadbalancerOutput"] = my_lb.Apply(my_lb => my_lb.Apply(getLoadBalancerResult => getLoadBalancerResult.PublicIp)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.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) {
// TODO
final var my-lb = CivoFunctions.getLoadBalancer(GetLoadBalancerArgs.builder()
.name("lb-name")
.region("LON1")
.build());
ctx.export("civoLoadbalancerOutput", my_lb.publicIp());
}
}
variables:
# TODO
my-lb:
fn::invoke:
Function: civo:getLoadBalancer
Arguments:
name: lb-name
region: LON1
outputs:
civoLoadbalancerOutput: ${["my-lb"].publicIp}
Using getLoadBalancer
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getLoadBalancer(args: GetLoadBalancerArgs, opts?: InvokeOptions): Promise<GetLoadBalancerResult>
function getLoadBalancerOutput(args: GetLoadBalancerOutputArgs, opts?: InvokeOptions): Output<GetLoadBalancerResult>
def get_load_balancer(id: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetLoadBalancerResult
def get_load_balancer_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetLoadBalancerResult]
func GetLoadBalancer(ctx *Context, args *GetLoadBalancerArgs, opts ...InvokeOption) (*GetLoadBalancerResult, error)
func GetLoadBalancerOutput(ctx *Context, args *GetLoadBalancerOutputArgs, opts ...InvokeOption) GetLoadBalancerResultOutput
> Note: This function is named GetLoadBalancer
in the Go SDK.
public static class GetLoadBalancer
{
public static Task<GetLoadBalancerResult> InvokeAsync(GetLoadBalancerArgs args, InvokeOptions? opts = null)
public static Output<GetLoadBalancerResult> Invoke(GetLoadBalancerInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLoadBalancerResult> getLoadBalancer(GetLoadBalancerArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: civo:index/getLoadBalancer:getLoadBalancer
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- Name string
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- Region string
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- Id string
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- Name string
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- Region string
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- id String
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name String
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region String
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- id string
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name string
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region string
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- id str
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name str
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region str
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- id String
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name String
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region String
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
getLoadBalancer Result
The following output properties are available:
- Algorithm string
- The algorithm used by the load balancer
- Backends
List<Get
Load Balancer Backend> - Cluster
Id string - The cluster id of the load balancer
- Enable
Proxy stringProtocol - The enabled proxy protocol of the load balancer
- External
Traffic stringPolicy - The external traffic policy of the load balancer
- Firewall
Id string - The firewall id of the load balancer
- Private
Ip string - The private ip of the load balancer
- Public
Ip string - The public ip of the load balancer
- Session
Affinity string - The session affinity of the load balancer
- Session
Affinity intConfig Timeout - The session affinity config timeout of the load balancer
- State string
- The state of the load balancer
- Id string
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- Name string
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- Region string
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- Algorithm string
- The algorithm used by the load balancer
- Backends
[]Get
Load Balancer Backend - Cluster
Id string - The cluster id of the load balancer
- Enable
Proxy stringProtocol - The enabled proxy protocol of the load balancer
- External
Traffic stringPolicy - The external traffic policy of the load balancer
- Firewall
Id string - The firewall id of the load balancer
- Private
Ip string - The private ip of the load balancer
- Public
Ip string - The public ip of the load balancer
- Session
Affinity string - The session affinity of the load balancer
- Session
Affinity intConfig Timeout - The session affinity config timeout of the load balancer
- State string
- The state of the load balancer
- Id string
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- Name string
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- Region string
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- algorithm String
- The algorithm used by the load balancer
- backends
List<Get
Load Balancer Backend> - cluster
Id String - The cluster id of the load balancer
- enable
Proxy StringProtocol - The enabled proxy protocol of the load balancer
- external
Traffic StringPolicy - The external traffic policy of the load balancer
- firewall
Id String - The firewall id of the load balancer
- private
Ip String - The private ip of the load balancer
- public
Ip String - The public ip of the load balancer
- session
Affinity String - The session affinity of the load balancer
- session
Affinity IntegerConfig Timeout - The session affinity config timeout of the load balancer
- state String
- The state of the load balancer
- id String
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name String
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region String
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- algorithm string
- The algorithm used by the load balancer
- backends
Get
Load Balancer Backend[] - cluster
Id string - The cluster id of the load balancer
- enable
Proxy stringProtocol - The enabled proxy protocol of the load balancer
- external
Traffic stringPolicy - The external traffic policy of the load balancer
- firewall
Id string - The firewall id of the load balancer
- private
Ip string - The private ip of the load balancer
- public
Ip string - The public ip of the load balancer
- session
Affinity string - The session affinity of the load balancer
- session
Affinity numberConfig Timeout - The session affinity config timeout of the load balancer
- state string
- The state of the load balancer
- id string
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name string
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region string
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- algorithm str
- The algorithm used by the load balancer
- backends
Sequence[Get
Load Balancer Backend] - cluster_
id str - The cluster id of the load balancer
- enable_
proxy_ strprotocol - The enabled proxy protocol of the load balancer
- external_
traffic_ strpolicy - The external traffic policy of the load balancer
- firewall_
id str - The firewall id of the load balancer
- private_
ip str - The private ip of the load balancer
- public_
ip str - The public ip of the load balancer
- session_
affinity str - The session affinity of the load balancer
- session_
affinity_ intconfig_ timeout - The session affinity config timeout of the load balancer
- state str
- The state of the load balancer
- id str
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name str
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region str
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
- algorithm String
- The algorithm used by the load balancer
- backends List<Property Map>
- cluster
Id String - The cluster id of the load balancer
- enable
Proxy StringProtocol - The enabled proxy protocol of the load balancer
- external
Traffic StringPolicy - The external traffic policy of the load balancer
- firewall
Id String - The firewall id of the load balancer
- private
Ip String - The private ip of the load balancer
- public
Ip String - The public ip of the load balancer
- session
Affinity String - The session affinity of the load balancer
- session
Affinity NumberConfig Timeout - The session affinity config timeout of the load balancer
- state String
- The state of the load balancer
- id String
- The id of the load balancer to retrieve (You can find this id from service annotations 'kubernetes.civo.com/loadbalancer-id')
- name String
- The name of the load balancer (You can find this name from service annotations 'kubernetes.civo.com/loadbalancer-name')
- region String
- The region of the load balancer, if you declare this field, the datasource will use this value instead of the one defined in the provider
Supporting Types
GetLoadBalancerBackend
- Health
Check intPort - The health check port of the backend
- Ip string
- The ip of the backend
- Protocol string
- The protocol of the backend
- Source
Port int - The source port of the backend
- Target
Port int - The target port of the backend
- Health
Check intPort - The health check port of the backend
- Ip string
- The ip of the backend
- Protocol string
- The protocol of the backend
- Source
Port int - The source port of the backend
- Target
Port int - The target port of the backend
- health
Check IntegerPort - The health check port of the backend
- ip String
- The ip of the backend
- protocol String
- The protocol of the backend
- source
Port Integer - The source port of the backend
- target
Port Integer - The target port of the backend
- health
Check numberPort - The health check port of the backend
- ip string
- The ip of the backend
- protocol string
- The protocol of the backend
- source
Port number - The source port of the backend
- target
Port number - The target port of the backend
- health_
check_ intport - The health check port of the backend
- ip str
- The ip of the backend
- protocol str
- The protocol of the backend
- source_
port int - The source port of the backend
- target_
port int - The target port of the backend
- health
Check NumberPort - The health check port of the backend
- ip String
- The ip of the backend
- protocol String
- The protocol of the backend
- source
Port Number - The source port of the backend
- target
Port Number - The target port of the backend
Package Details
- Repository
- Civo pulumi/pulumi-civo
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
civo
Terraform Provider.