getBackendServers

This data source provides the server load balancer backend servers related to a server load balancer..

NOTE: Available in 1.53.0+

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const sampleDs = alicloud.slb.getBackendServers({
loadBalancerId: sampleSlb.id,
});
export const firstSlbBackendServerId = sampleDs.then(sampleDs => sampleDs.backendServers?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
sample_ds = alicloud.slb.get_backend_servers(load_balancer_id=sample_slb["id"])
pulumi.export("firstSlbBackendServerId", sample_ds.backend_servers[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var sampleDs = AliCloud.Slb.GetBackendServers.Invoke(new()
{
LoadBalancerId = sampleSlb.Id,
});
return new Dictionary<string, object?>
{
["firstSlbBackendServerId"] = sampleDs&#46;Apply(getBackendServersResult => getBackendServersResult&#46;BackendServers[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 {
sampleDs, err := slb.GetBackendServers(ctx, &slb.GetBackendServersArgs{
LoadBalancerId: sampleSlb.Id,
}, nil)
if err != nil {
return err
}
ctx.Export("firstSlbBackendServerId", sampleDs.BackendServers[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.GetBackendServersArgs;
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 sampleDs = SlbFunctions.getBackendServers(GetBackendServersArgs.builder()
.loadBalancerId(sampleSlb.id())
.build());
ctx.export("firstSlbBackendServerId", sampleDs.applyValue(getBackendServersResult -> getBackendServersResult.backendServers()[0].id()));
}
}
variables:
sampleDs:
fn::invoke:
function: alicloud:slb:getBackendServers
arguments:
loadBalancerId: ${sampleSlb.id}
outputs:
firstSlbBackendServerId: ${sampleDs.backendServers[0].id}

Return

A collection of values returned by getBackendServers.

Parameters

argument

A collection of arguments for invoking getBackendServers.


suspend fun getBackendServers(ids: List<String>? = null, loadBalancerId: String, outputFile: String? = null): GetBackendServersResult

Return

A collection of values returned by getBackendServers.

Parameters

ids

List of attached ECS instance IDs.

loadBalancerId

ID of the SLB with attachments.

outputFile

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

See also


Return

A collection of values returned by getBackendServers.

Parameters

argument

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

See also