get Application Load Balancers
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.Apply(getApplicationLoadBalancersResult => getApplicationLoadBalancersResult.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
A collection of arguments for invoking getApplicationLoadBalancers.
Return
A collection of values returned by getApplicationLoadBalancers.
Parameters
Service address of the SLBs.
The address ip version. Valid values ipv4 and ipv6.
The address type of the SLB. Valid values internet and intranet.
A list of SLBs IDs.
The internet charge type. Valid values PayByBandwidth and PayByTraffic.
The name of the SLB.
The master zone id of the SLB.
A regex string to filter results by SLB name.
Network type of the SLBs. Valid values: vpc and classic.
File name where to save data source results (after running pulumi preview).
The payment type of SLB. Valid values PayAsYouGo and Subscription.
The Id of resource group which SLB belongs.
The server ID.
The server intranet address.
The slave zone id of the SLB.
SLB current status. Possible values: inactive, active and locked.
A map of tags assigned to the SLB instances. The tags can have a maximum of 5 tag. It must be in the format:
ID of the VPC linked to the SLBs.
ID of the vSwitch linked to the SLBs.
See also
Return
A collection of values returned by getApplicationLoadBalancers.
Parameters
Builder for com.pulumi.alicloud.slb.kotlin.inputs.GetApplicationLoadBalancersPlainArgs.