1. Packages
  2. Volcengine
  3. API Docs
  4. alb
  5. getListenerHealths
Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine
volcengine logo
Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine

    Use this data source to query detailed information of alb listener healths

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    
    const example = volcengine.alb.getListenerHealths({
        listenerIds: [
            "lsn-xoetdjk3dzwg54ov5ewpam7c",
            "lsn-bdcxfof3fy808dv40ofappua",
        ],
        onlyUnHealthy: true,
        projectName: "default",
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    example = volcengine.alb.get_listener_healths(listener_ids=[
            "lsn-xoetdjk3dzwg54ov5ewpam7c",
            "lsn-bdcxfof3fy808dv40ofappua",
        ],
        only_un_healthy=True,
        project_name="default")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/alb"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := alb.GetListenerHealths(ctx, &alb.GetListenerHealthsArgs{
    			ListenerIds: []string{
    				"lsn-xoetdjk3dzwg54ov5ewpam7c",
    				"lsn-bdcxfof3fy808dv40ofappua",
    			},
    			OnlyUnHealthy: pulumi.BoolRef(true),
    			ProjectName:   pulumi.StringRef("default"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Volcengine.Alb.GetListenerHealths.Invoke(new()
        {
            ListenerIds = new[]
            {
                "lsn-xoetdjk3dzwg54ov5ewpam7c",
                "lsn-bdcxfof3fy808dv40ofappua",
            },
            OnlyUnHealthy = true,
            ProjectName = "default",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.alb.AlbFunctions;
    import com.pulumi.volcengine.alb.inputs.GetListenerHealthsArgs;
    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 = AlbFunctions.getListenerHealths(GetListenerHealthsArgs.builder()
                .listenerIds(            
                    "lsn-xoetdjk3dzwg54ov5ewpam7c",
                    "lsn-bdcxfof3fy808dv40ofappua")
                .onlyUnHealthy(true)
                .projectName("default")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: volcengine:alb:getListenerHealths
          Arguments:
            listenerIds:
              - lsn-xoetdjk3dzwg54ov5ewpam7c
              - lsn-bdcxfof3fy808dv40ofappua
            onlyUnHealthy: true
            projectName: default
    

    Using getListenerHealths

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getListenerHealths(args: GetListenerHealthsArgs, opts?: InvokeOptions): Promise<GetListenerHealthsResult>
    function getListenerHealthsOutput(args: GetListenerHealthsOutputArgs, opts?: InvokeOptions): Output<GetListenerHealthsResult>
    def get_listener_healths(listener_ids: Optional[Sequence[str]] = None,
                             only_un_healthy: Optional[bool] = None,
                             output_file: Optional[str] = None,
                             project_name: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetListenerHealthsResult
    def get_listener_healths_output(listener_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                             only_un_healthy: Optional[pulumi.Input[bool]] = None,
                             output_file: Optional[pulumi.Input[str]] = None,
                             project_name: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetListenerHealthsResult]
    func GetListenerHealths(ctx *Context, args *GetListenerHealthsArgs, opts ...InvokeOption) (*GetListenerHealthsResult, error)
    func GetListenerHealthsOutput(ctx *Context, args *GetListenerHealthsOutputArgs, opts ...InvokeOption) GetListenerHealthsResultOutput

    > Note: This function is named GetListenerHealths in the Go SDK.

    public static class GetListenerHealths 
    {
        public static Task<GetListenerHealthsResult> InvokeAsync(GetListenerHealthsArgs args, InvokeOptions? opts = null)
        public static Output<GetListenerHealthsResult> Invoke(GetListenerHealthsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetListenerHealthsResult> getListenerHealths(GetListenerHealthsArgs args, InvokeOptions options)
    public static Output<GetListenerHealthsResult> getListenerHealths(GetListenerHealthsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: volcengine:alb/getListenerHealths:getListenerHealths
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ListenerIds List<string>
    A list of Listener IDs.
    OnlyUnHealthy bool
    Whether to return only backend servers with abnormal health check status.
    OutputFile string
    File name where to save data source results.
    ProjectName string
    The project name of the listener.
    ListenerIds []string
    A list of Listener IDs.
    OnlyUnHealthy bool
    Whether to return only backend servers with abnormal health check status.
    OutputFile string
    File name where to save data source results.
    ProjectName string
    The project name of the listener.
    listenerIds List<String>
    A list of Listener IDs.
    onlyUnHealthy Boolean
    Whether to return only backend servers with abnormal health check status.
    outputFile String
    File name where to save data source results.
    projectName String
    The project name of the listener.
    listenerIds string[]
    A list of Listener IDs.
    onlyUnHealthy boolean
    Whether to return only backend servers with abnormal health check status.
    outputFile string
    File name where to save data source results.
    projectName string
    The project name of the listener.
    listener_ids Sequence[str]
    A list of Listener IDs.
    only_un_healthy bool
    Whether to return only backend servers with abnormal health check status.
    output_file str
    File name where to save data source results.
    project_name str
    The project name of the listener.
    listenerIds List<String>
    A list of Listener IDs.
    onlyUnHealthy Boolean
    Whether to return only backend servers with abnormal health check status.
    outputFile String
    File name where to save data source results.
    projectName String
    The project name of the listener.

    getListenerHealths Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ListenerIds List<string>
    Listeners List<GetListenerHealthsListener>
    The collection of listener health query.
    TotalCount int
    The total count of query.
    OnlyUnHealthy bool
    OutputFile string
    ProjectName string
    Id string
    The provider-assigned unique ID for this managed resource.
    ListenerIds []string
    Listeners []GetListenerHealthsListener
    The collection of listener health query.
    TotalCount int
    The total count of query.
    OnlyUnHealthy bool
    OutputFile string
    ProjectName string
    id String
    The provider-assigned unique ID for this managed resource.
    listenerIds List<String>
    listeners List<GetListenerHealthsListener>
    The collection of listener health query.
    totalCount Integer
    The total count of query.
    onlyUnHealthy Boolean
    outputFile String
    projectName String
    id string
    The provider-assigned unique ID for this managed resource.
    listenerIds string[]
    listeners GetListenerHealthsListener[]
    The collection of listener health query.
    totalCount number
    The total count of query.
    onlyUnHealthy boolean
    outputFile string
    projectName string
    id str
    The provider-assigned unique ID for this managed resource.
    listener_ids Sequence[str]
    listeners Sequence[GetListenerHealthsListener]
    The collection of listener health query.
    total_count int
    The total count of query.
    only_un_healthy bool
    output_file str
    project_name str
    id String
    The provider-assigned unique ID for this managed resource.
    listenerIds List<String>
    listeners List<Property Map>
    The collection of listener health query.
    totalCount Number
    The total count of query.
    onlyUnHealthy Boolean
    outputFile String
    projectName String

    Supporting Types

    GetListenerHealthsListener

    BackendServers List<GetListenerHealthsListenerBackendServer>
    The list of backend server health details.
    ListenerId string
    The ID of the listener.
    Status string
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    TotalBackendServerCount int
    The total count of backend servers under the listener.
    UnHealthyCount int
    The count of backend servers with abnormal health check status.
    BackendServers []GetListenerHealthsListenerBackendServer
    The list of backend server health details.
    ListenerId string
    The ID of the listener.
    Status string
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    TotalBackendServerCount int
    The total count of backend servers under the listener.
    UnHealthyCount int
    The count of backend servers with abnormal health check status.
    backendServers List<GetListenerHealthsListenerBackendServer>
    The list of backend server health details.
    listenerId String
    The ID of the listener.
    status String
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    totalBackendServerCount Integer
    The total count of backend servers under the listener.
    unHealthyCount Integer
    The count of backend servers with abnormal health check status.
    backendServers GetListenerHealthsListenerBackendServer[]
    The list of backend server health details.
    listenerId string
    The ID of the listener.
    status string
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    totalBackendServerCount number
    The total count of backend servers under the listener.
    unHealthyCount number
    The count of backend servers with abnormal health check status.
    backend_servers Sequence[GetListenerHealthsListenerBackendServer]
    The list of backend server health details.
    listener_id str
    The ID of the listener.
    status str
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    total_backend_server_count int
    The total count of backend servers under the listener.
    un_healthy_count int
    The count of backend servers with abnormal health check status.
    backendServers List<Property Map>
    The list of backend server health details.
    listenerId String
    The ID of the listener.
    status String
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    totalBackendServerCount Number
    The total count of backend servers under the listener.
    unHealthyCount Number
    The count of backend servers with abnormal health check status.

    GetListenerHealthsListenerBackendServer

    InstanceId string
    The ID of the ECS instance or ENI.
    Ip string
    The IP address of the backend server.
    Port int
    The port of the backend server.
    RuleNumber int
    The number of forwarding rules associated with the backend server.
    ServerGroupId string
    The ID of the backend server group.
    ServerGroupName string
    The name of the backend server group.
    ServerId string
    The ID of the backend server.
    Status string
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    Type string
    The type of backend server. Value: ecs, eni.
    InstanceId string
    The ID of the ECS instance or ENI.
    Ip string
    The IP address of the backend server.
    Port int
    The port of the backend server.
    RuleNumber int
    The number of forwarding rules associated with the backend server.
    ServerGroupId string
    The ID of the backend server group.
    ServerGroupName string
    The name of the backend server group.
    ServerId string
    The ID of the backend server.
    Status string
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    Type string
    The type of backend server. Value: ecs, eni.
    instanceId String
    The ID of the ECS instance or ENI.
    ip String
    The IP address of the backend server.
    port Integer
    The port of the backend server.
    ruleNumber Integer
    The number of forwarding rules associated with the backend server.
    serverGroupId String
    The ID of the backend server group.
    serverGroupName String
    The name of the backend server group.
    serverId String
    The ID of the backend server.
    status String
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    type String
    The type of backend server. Value: ecs, eni.
    instanceId string
    The ID of the ECS instance or ENI.
    ip string
    The IP address of the backend server.
    port number
    The port of the backend server.
    ruleNumber number
    The number of forwarding rules associated with the backend server.
    serverGroupId string
    The ID of the backend server group.
    serverGroupName string
    The name of the backend server group.
    serverId string
    The ID of the backend server.
    status string
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    type string
    The type of backend server. Value: ecs, eni.
    instance_id str
    The ID of the ECS instance or ENI.
    ip str
    The IP address of the backend server.
    port int
    The port of the backend server.
    rule_number int
    The number of forwarding rules associated with the backend server.
    server_group_id str
    The ID of the backend server group.
    server_group_name str
    The name of the backend server group.
    server_id str
    The ID of the backend server.
    status str
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    type str
    The type of backend server. Value: ecs, eni.
    instanceId String
    The ID of the ECS instance or ENI.
    ip String
    The IP address of the backend server.
    port Number
    The port of the backend server.
    ruleNumber Number
    The number of forwarding rules associated with the backend server.
    serverGroupId String
    The ID of the backend server group.
    serverGroupName String
    The name of the backend server group.
    serverId String
    The ID of the backend server.
    status String
    The status of the listener. Value: Active, Error, NoTarget, Disabled.
    type String
    The type of backend server. Value: ecs, eni.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate