getLoadBalancers

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()));
}
}

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.

addressIpVersion
addressType
enableDetails
ids

A list of SLBs IDs.

internetChargeType
loadBalancerName
masterZoneId
nameRegex

A regex string to filter results by SLB name.

networkType

Network type of the SLBs. Valid values: vpc and classic.

outputFile
pageNumber
pageSize
paymentType
resourceGroupId

The Id of resource group which SLB belongs.

serverId
serverIntranetAddress
slaveZoneId
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",
},
});
import pulumi
import pulumi_alicloud as alicloud
tagged_instances = alicloud.slb.get_load_balancers(tags={
"tagKey1": "tagValue1",
"tagKey2": "tagValue2",
})
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" },
},
});
});
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
})
}
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());
}
}
variables:
taggedInstances:
fn::invoke:
Function: alicloud:slb:getLoadBalancers
Arguments:
tags:
tagKey1: tagValue1
tagKey2: tagValue2
vpcId

ID of the VPC linked to the SLBs.

vswitchId

ID of the VSwitch linked to the SLBs.


Return

A collection of values returned by getLoadBalancers.

See also

Parameters

argument

Builder for com.pulumi.alicloud.slb.kotlin.inputs.GetLoadBalancersPlainArgs.