getApplicationLoadBalancers

This data source provides the server load balancers of the current Alibaba Cloud user.

NOTE: Available in 1.123.1+

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.slb.getApplicationLoadBalancers({
nameRegex: "sample_slb",
tags: {
tagKey1: "tagValue1",
tagKey2: "tagValue2",
},
});
export const firstSlbId = example.then(example => example.balancers?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.slb.get_application_load_balancers(name_regex="sample_slb",
tags={
"tagKey1": "tagValue1",
"tagKey2": "tagValue2",
})
pulumi.export("firstSlbId", example.balancers[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.Slb.GetApplicationLoadBalancers.Invoke(new()
{
NameRegex = "sample_slb",
Tags =
{
{ "tagKey1", "tagValue1" },
{ "tagKey2", "tagValue2" },
},
});
return new Dictionary<string, object?>
{
["firstSlbId"] = example&#46;Apply(getApplicationLoadBalancersResult => getApplicationLoadBalancersResult&#46;Balancers[0]?.Id),
};
});
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 {
example, err := slb.GetApplicationLoadBalancers(ctx, &slb.GetApplicationLoadBalancersArgs{
NameRegex: pulumi.StringRef("sample_slb"),
Tags: map[string]interface{}{
"tagKey1": "tagValue1",
"tagKey2": "tagValue2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("firstSlbId", example.Balancers[0].Id)
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.GetApplicationLoadBalancersArgs;
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 = SlbFunctions.getApplicationLoadBalancers(GetApplicationLoadBalancersArgs.builder()
.nameRegex("sample_slb")
.tags(Map.ofEntries(
Map.entry("tagKey1", "tagValue1"),
Map.entry("tagKey2", "tagValue2")
))
.build());
ctx.export("firstSlbId", example.applyValue(getApplicationLoadBalancersResult -> getApplicationLoadBalancersResult.balancers()[0].id()));
}
}
variables:
example:
fn::invoke:
function: alicloud:slb:getApplicationLoadBalancers
arguments:
nameRegex: sample_slb
tags:
tagKey1: tagValue1
tagKey2: tagValue2
outputs:
firstSlbId: ${example.balancers[0].id}

Return

A collection of values returned by getApplicationLoadBalancers.

Parameters

argument

A collection of arguments for invoking getApplicationLoadBalancers.


suspend fun getApplicationLoadBalancers(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, String>? = null, vpcId: String? = null, vswitchId: String? = null): GetApplicationLoadBalancersResult

Return

A collection of values returned by getApplicationLoadBalancers.

Parameters

address

Service address of the SLBs.

addressIpVersion

The address ip version. Valid values ipv4 and ipv6.

addressType

The address type of the SLB. Valid values internet and intranet.

enableDetails
ids

A list of SLBs IDs.

internetChargeType

The internet charge type. Valid values PayByBandwidth and PayByTraffic.

loadBalancerName

The name of the SLB.

masterZoneId

The master zone id of the SLB.

nameRegex

A regex string to filter results by SLB name.

networkType

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

outputFile

File name where to save data source results (after running pulumi preview).

pageNumber
pageSize
paymentType

The payment type of SLB. Valid values PayAsYouGo and Subscription.

resourceGroupId

The Id of resource group which SLB belongs.

serverId

The server ID.

serverIntranetAddress

The server intranet address.

slaveZoneId

The slave zone id of the SLB.

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:

vpcId

ID of the VPC linked to the SLBs.

vswitchId

ID of the vSwitch linked to the SLBs.

See also


Return

A collection of values returned by getApplicationLoadBalancers.

Parameters

argument

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

See also