get Load Balancers
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.slb.LoadBalancer;
import com.pulumi.alicloud.slb.SlbFunctions;
import com.pulumi.alicloud.slb.inputs.GetLoadBalancersArgs;
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 default_ = new LoadBalancer("default");
final var slbsDs = SlbFunctions.getLoadBalancers(GetLoadBalancersArgs.builder()
.nameRegex("sample_slb")
.build());
ctx.export("firstSlbId", slbsDs.applyValue(getLoadBalancersResult -> getLoadBalancersResult.slbs()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getLoadBalancers.
Parameters
argument
A collection of arguments for invoking getLoadBalancers.
suspend fun getLoadBalancers(address: String? = null, addressIpVersion: String? = null, addressType: String? = null, enableDetails: Boolean? = null, ids: List<String>? = null, internetChargeType: String? = null, loadBalancerName: String? = null, masterZoneId: String? = null, nameRegex: String? = null, networkType: String? = null, outputFile: String? = null, pageNumber: Int? = null, pageSize: Int? = null, paymentType: String? = null, resourceGroupId: String? = null, serverId: String? = null, serverIntranetAddress: String? = null, slaveZoneId: String? = null, status: String? = null, tags: Map<String, Any>? = null, vpcId: String? = null, vswitchId: String? = null): GetLoadBalancersResult
Return
A collection of values returned by getLoadBalancers.
See also
Parameters
address
Service address of the SLBs.
address Ip Version
address Type
enable Details
ids
A list of SLBs IDs.
internet Charge Type
load Balancer Name
master Zone Id
name Regex
A regex string to filter results by SLB name.
network Type
Network type of the SLBs. Valid values: vpc
and classic
.
output File
page Number
page Size
payment Type
resource Group Id
The Id of resource group which SLB belongs.
server Id
server Intranet Address
slave Zone Id
status
SLB current status. Possible values: inactive
, active
and locked
.
tags
A map of tags assigned to the SLB instances. The tags
can have a maximum of 5 tag. It must be in the format:
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const taggedInstances = alicloud.slb.getLoadBalancers({
tags: {
tagKey1: "tagValue1",
tagKey2: "tagValue2",
},
});
Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
tagged_instances = alicloud.slb.get_load_balancers(tags={
"tagKey1": "tagValue1",
"tagKey2": "tagValue2",
})
Content copied to clipboard
using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var taggedInstances = AliCloud.Slb.GetLoadBalancers.Invoke(new()
{
Tags =
{
{ "tagKey1", "tagValue1" },
{ "tagKey2", "tagValue2" },
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/slb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := slb.GetLoadBalancers(ctx, &slb.GetLoadBalancersArgs{
Tags: map[string]interface{}{
"tagKey1": "tagValue1",
"tagKey2": "tagValue2",
},
}, nil)
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.slb.SlbFunctions;
import com.pulumi.alicloud.slb.inputs.GetLoadBalancersArgs;
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 taggedInstances = SlbFunctions.getLoadBalancers(GetLoadBalancersArgs.builder()
.tags(Map.ofEntries(
Map.entry("tagKey1", "tagValue1"),
Map.entry("tagKey2", "tagValue2")
))
.build());
}
}
Content copied to clipboard
variables:
taggedInstances:
fn::invoke:
Function: alicloud:slb:getLoadBalancers
Arguments:
tags:
tagKey1: tagValue1
tagKey2: tagValue2
Content copied to clipboard
vpc Id
ID of the VPC linked to the SLBs.
vswitch Id
ID of the VSwitch linked to the SLBs.
suspend fun getLoadBalancers(argument: suspend GetLoadBalancersPlainArgsBuilder.() -> Unit): GetLoadBalancersResult
Return
A collection of values returned by getLoadBalancers.
See also
Parameters
argument
Builder for com.pulumi.alicloud.slb.kotlin.inputs.GetLoadBalancersPlainArgs.