1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. nlb
  5. getServerGroups
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.nlb.getServerGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Nlb Server Groups of the current Alibaba Cloud user.

    NOTE: Available in v1.186.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.nlb.getServerGroups({});
    export const nlbServerGroupId1 = ids.then(ids => ids.groups?.[0]?.id);
    const nameRegex = alicloud.nlb.getServerGroups({
        nameRegex: "^my-ServerGroup",
    });
    export const nlbServerGroupId2 = nameRegex.then(nameRegex => nameRegex.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.nlb.get_server_groups()
    pulumi.export("nlbServerGroupId1", ids.groups[0].id)
    name_regex = alicloud.nlb.get_server_groups(name_regex="^my-ServerGroup")
    pulumi.export("nlbServerGroupId2", name_regex.groups[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nlb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := nlb.GetServerGroups(ctx, &nlb.GetServerGroupsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("nlbServerGroupId1", ids.Groups[0].Id)
    		nameRegex, err := nlb.GetServerGroups(ctx, &nlb.GetServerGroupsArgs{
    			NameRegex: pulumi.StringRef("^my-ServerGroup"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("nlbServerGroupId2", nameRegex.Groups[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Nlb.GetServerGroups.Invoke();
    
        var nameRegex = AliCloud.Nlb.GetServerGroups.Invoke(new()
        {
            NameRegex = "^my-ServerGroup",
        });
    
        return new Dictionary<string, object?>
        {
            ["nlbServerGroupId1"] = ids.Apply(getServerGroupsResult => getServerGroupsResult.Groups[0]?.Id),
            ["nlbServerGroupId2"] = nameRegex.Apply(getServerGroupsResult => getServerGroupsResult.Groups[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.nlb.NlbFunctions;
    import com.pulumi.alicloud.nlb.inputs.GetServerGroupsArgs;
    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 ids = NlbFunctions.getServerGroups();
    
            ctx.export("nlbServerGroupId1", ids.applyValue(getServerGroupsResult -> getServerGroupsResult.groups()[0].id()));
            final var nameRegex = NlbFunctions.getServerGroups(GetServerGroupsArgs.builder()
                .nameRegex("^my-ServerGroup")
                .build());
    
            ctx.export("nlbServerGroupId2", nameRegex.applyValue(getServerGroupsResult -> getServerGroupsResult.groups()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:nlb:getServerGroups
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:nlb:getServerGroups
          Arguments:
            nameRegex: ^my-ServerGroup
    outputs:
      nlbServerGroupId1: ${ids.groups[0].id}
      nlbServerGroupId2: ${nameRegex.groups[0].id}
    

    Using getServerGroups

    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 getServerGroups(args: GetServerGroupsArgs, opts?: InvokeOptions): Promise<GetServerGroupsResult>
    function getServerGroupsOutput(args: GetServerGroupsOutputArgs, opts?: InvokeOptions): Output<GetServerGroupsResult>
    def get_server_groups(ids: Optional[Sequence[str]] = None,
                          name_regex: Optional[str] = None,
                          output_file: Optional[str] = None,
                          resource_group_id: Optional[str] = None,
                          server_group_names: Optional[Sequence[str]] = None,
                          server_group_type: Optional[str] = None,
                          status: Optional[str] = None,
                          tags: Optional[Mapping[str, str]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetServerGroupsResult
    def get_server_groups_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          name_regex: Optional[pulumi.Input[str]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          resource_group_id: Optional[pulumi.Input[str]] = None,
                          server_group_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          server_group_type: Optional[pulumi.Input[str]] = None,
                          status: Optional[pulumi.Input[str]] = None,
                          tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetServerGroupsResult]
    func GetServerGroups(ctx *Context, args *GetServerGroupsArgs, opts ...InvokeOption) (*GetServerGroupsResult, error)
    func GetServerGroupsOutput(ctx *Context, args *GetServerGroupsOutputArgs, opts ...InvokeOption) GetServerGroupsResultOutput

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

    public static class GetServerGroups 
    {
        public static Task<GetServerGroupsResult> InvokeAsync(GetServerGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetServerGroupsResult> Invoke(GetServerGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerGroupsResult> getServerGroups(GetServerGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:nlb/getServerGroups:getServerGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Server Group IDs.
    NameRegex string
    A regex string to filter results by Server Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of the resource group to which the security group belongs.
    ServerGroupNames List<string>
    The names of the server groups to be queried.
    ServerGroupType string
    The type of the server group. Valid values: Instance, Ip.
    Status string
    The status of the resource. Valid values: Available, Configuring, Creating.
    Tags Dictionary<string, string>
    Ids []string
    A list of Server Group IDs.
    NameRegex string
    A regex string to filter results by Server Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of the resource group to which the security group belongs.
    ServerGroupNames []string
    The names of the server groups to be queried.
    ServerGroupType string
    The type of the server group. Valid values: Instance, Ip.
    Status string
    The status of the resource. Valid values: Available, Configuring, Creating.
    Tags map[string]string
    ids List<String>
    A list of Server Group IDs.
    nameRegex String
    A regex string to filter results by Server Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of the resource group to which the security group belongs.
    serverGroupNames List<String>
    The names of the server groups to be queried.
    serverGroupType String
    The type of the server group. Valid values: Instance, Ip.
    status String
    The status of the resource. Valid values: Available, Configuring, Creating.
    tags Map<String,String>
    ids string[]
    A list of Server Group IDs.
    nameRegex string
    A regex string to filter results by Server Group name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    resourceGroupId string
    The ID of the resource group to which the security group belongs.
    serverGroupNames string[]
    The names of the server groups to be queried.
    serverGroupType string
    The type of the server group. Valid values: Instance, Ip.
    status string
    The status of the resource. Valid values: Available, Configuring, Creating.
    tags {[key: string]: string}
    ids Sequence[str]
    A list of Server Group IDs.
    name_regex str
    A regex string to filter results by Server Group name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    resource_group_id str
    The ID of the resource group to which the security group belongs.
    server_group_names Sequence[str]
    The names of the server groups to be queried.
    server_group_type str
    The type of the server group. Valid values: Instance, Ip.
    status str
    The status of the resource. Valid values: Available, Configuring, Creating.
    tags Mapping[str, str]
    ids List<String>
    A list of Server Group IDs.
    nameRegex String
    A regex string to filter results by Server Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of the resource group to which the security group belongs.
    serverGroupNames List<String>
    The names of the server groups to be queried.
    serverGroupType String
    The type of the server group. Valid values: Instance, Ip.
    status String
    The status of the resource. Valid values: Available, Configuring, Creating.
    tags Map<String>

    getServerGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.Nlb.Outputs.GetServerGroupsGroup>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    NameRegex string
    OutputFile string
    ResourceGroupId string
    ServerGroupNames List<string>
    ServerGroupType string
    Status string
    Tags Dictionary<string, string>
    Groups []GetServerGroupsGroup
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    NameRegex string
    OutputFile string
    ResourceGroupId string
    ServerGroupNames []string
    ServerGroupType string
    Status string
    Tags map[string]string
    groups List<GetServerGroupsGroup>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    resourceGroupId String
    serverGroupNames List<String>
    serverGroupType String
    status String
    tags Map<String,String>
    groups GetServerGroupsGroup[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    nameRegex string
    outputFile string
    resourceGroupId string
    serverGroupNames string[]
    serverGroupType string
    status string
    tags {[key: string]: string}
    groups Sequence[GetServerGroupsGroup]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    name_regex str
    output_file str
    resource_group_id str
    server_group_names Sequence[str]
    server_group_type str
    status str
    tags Mapping[str, str]
    groups List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    resourceGroupId String
    serverGroupNames List<String>
    serverGroupType String
    status String
    tags Map<String>

    Supporting Types

    GetServerGroupsGroup

    AddressIpVersion string
    The protocol version.
    ConnectionDrain bool
    Indicates whether connection draining is enabled.
    ConnectionDrainTimeout int
    The timeout period of connection draining. Unit: seconds.
    HealthChecks List<Pulumi.AliCloud.Nlb.Inputs.GetServerGroupsGroupHealthCheck>
    The configurations of health checks.
    Id string
    The ID of the Server Group.
    PreserveClientIpEnabled bool
    Indicates whether client address retention is enabled.
    Protocol string
    The protocol used to forward requests to the backend servers.
    RelatedLoadBalancerIds List<string>
    The NLB instance.
    ResourceGroupId string
    The ID of the resource group to which the security group belongs.
    Scheduler string
    The routing algorithm.
    ServerCount int
    The number of server groups associated with the NLB instance.
    ServerGroupName string
    The name of the server group.
    ServerGroupType string
    The type of the server group.
    Status string
    The status of the server group.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    VpcId string
    The ID of the VPC to which the server group belongs.
    AddressIpVersion string
    The protocol version.
    ConnectionDrain bool
    Indicates whether connection draining is enabled.
    ConnectionDrainTimeout int
    The timeout period of connection draining. Unit: seconds.
    HealthChecks []GetServerGroupsGroupHealthCheck
    The configurations of health checks.
    Id string
    The ID of the Server Group.
    PreserveClientIpEnabled bool
    Indicates whether client address retention is enabled.
    Protocol string
    The protocol used to forward requests to the backend servers.
    RelatedLoadBalancerIds []string
    The NLB instance.
    ResourceGroupId string
    The ID of the resource group to which the security group belongs.
    Scheduler string
    The routing algorithm.
    ServerCount int
    The number of server groups associated with the NLB instance.
    ServerGroupName string
    The name of the server group.
    ServerGroupType string
    The type of the server group.
    Status string
    The status of the server group.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    VpcId string
    The ID of the VPC to which the server group belongs.
    addressIpVersion String
    The protocol version.
    connectionDrain Boolean
    Indicates whether connection draining is enabled.
    connectionDrainTimeout Integer
    The timeout period of connection draining. Unit: seconds.
    healthChecks List<GetServerGroupsGroupHealthCheck>
    The configurations of health checks.
    id String
    The ID of the Server Group.
    preserveClientIpEnabled Boolean
    Indicates whether client address retention is enabled.
    protocol String
    The protocol used to forward requests to the backend servers.
    relatedLoadBalancerIds List<String>
    The NLB instance.
    resourceGroupId String
    The ID of the resource group to which the security group belongs.
    scheduler String
    The routing algorithm.
    serverCount Integer
    The number of server groups associated with the NLB instance.
    serverGroupName String
    The name of the server group.
    serverGroupType String
    The type of the server group.
    status String
    The status of the server group.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    vpcId String
    The ID of the VPC to which the server group belongs.
    addressIpVersion string
    The protocol version.
    connectionDrain boolean
    Indicates whether connection draining is enabled.
    connectionDrainTimeout number
    The timeout period of connection draining. Unit: seconds.
    healthChecks GetServerGroupsGroupHealthCheck[]
    The configurations of health checks.
    id string
    The ID of the Server Group.
    preserveClientIpEnabled boolean
    Indicates whether client address retention is enabled.
    protocol string
    The protocol used to forward requests to the backend servers.
    relatedLoadBalancerIds string[]
    The NLB instance.
    resourceGroupId string
    The ID of the resource group to which the security group belongs.
    scheduler string
    The routing algorithm.
    serverCount number
    The number of server groups associated with the NLB instance.
    serverGroupName string
    The name of the server group.
    serverGroupType string
    The type of the server group.
    status string
    The status of the server group.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    vpcId string
    The ID of the VPC to which the server group belongs.
    address_ip_version str
    The protocol version.
    connection_drain bool
    Indicates whether connection draining is enabled.
    connection_drain_timeout int
    The timeout period of connection draining. Unit: seconds.
    health_checks Sequence[GetServerGroupsGroupHealthCheck]
    The configurations of health checks.
    id str
    The ID of the Server Group.
    preserve_client_ip_enabled bool
    Indicates whether client address retention is enabled.
    protocol str
    The protocol used to forward requests to the backend servers.
    related_load_balancer_ids Sequence[str]
    The NLB instance.
    resource_group_id str
    The ID of the resource group to which the security group belongs.
    scheduler str
    The routing algorithm.
    server_count int
    The number of server groups associated with the NLB instance.
    server_group_name str
    The name of the server group.
    server_group_type str
    The type of the server group.
    status str
    The status of the server group.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    vpc_id str
    The ID of the VPC to which the server group belongs.
    addressIpVersion String
    The protocol version.
    connectionDrain Boolean
    Indicates whether connection draining is enabled.
    connectionDrainTimeout Number
    The timeout period of connection draining. Unit: seconds.
    healthChecks List<Property Map>
    The configurations of health checks.
    id String
    The ID of the Server Group.
    preserveClientIpEnabled Boolean
    Indicates whether client address retention is enabled.
    protocol String
    The protocol used to forward requests to the backend servers.
    relatedLoadBalancerIds List<String>
    The NLB instance.
    resourceGroupId String
    The ID of the resource group to which the security group belongs.
    scheduler String
    The routing algorithm.
    serverCount Number
    The number of server groups associated with the NLB instance.
    serverGroupName String
    The name of the server group.
    serverGroupType String
    The type of the server group.
    status String
    The status of the server group.
    tags Map<String>
    A mapping of tags to assign to the resource.
    vpcId String
    The ID of the VPC to which the server group belongs.

    GetServerGroupsGroupHealthCheck

    HealthCheckConnectPort int
    The backend port that is used for health checks.
    HealthCheckConnectTimeout int
    The maximum timeout period of a health check response.
    HealthCheckDomain string
    The domain name that is used for health checks.
    HealthCheckEnabled bool
    Specifies whether to enable health checks.
    HealthCheckHttpCodes List<string>
    The HTTP status codes returned for health checks.
    HealthCheckInterval int
    The interval between two consecutive health checks.
    HealthCheckType string
    The protocol that is used for health checks.
    HealthCheckUrl string
    The path to which health check requests are sent.
    HealthyThreshold int
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
    HttpCheckMethod string
    The HTTP method that is used for health checks.
    UnhealthyThreshold int
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.
    HealthCheckConnectPort int
    The backend port that is used for health checks.
    HealthCheckConnectTimeout int
    The maximum timeout period of a health check response.
    HealthCheckDomain string
    The domain name that is used for health checks.
    HealthCheckEnabled bool
    Specifies whether to enable health checks.
    HealthCheckHttpCodes []string
    The HTTP status codes returned for health checks.
    HealthCheckInterval int
    The interval between two consecutive health checks.
    HealthCheckType string
    The protocol that is used for health checks.
    HealthCheckUrl string
    The path to which health check requests are sent.
    HealthyThreshold int
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
    HttpCheckMethod string
    The HTTP method that is used for health checks.
    UnhealthyThreshold int
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.
    healthCheckConnectPort Integer
    The backend port that is used for health checks.
    healthCheckConnectTimeout Integer
    The maximum timeout period of a health check response.
    healthCheckDomain String
    The domain name that is used for health checks.
    healthCheckEnabled Boolean
    Specifies whether to enable health checks.
    healthCheckHttpCodes List<String>
    The HTTP status codes returned for health checks.
    healthCheckInterval Integer
    The interval between two consecutive health checks.
    healthCheckType String
    The protocol that is used for health checks.
    healthCheckUrl String
    The path to which health check requests are sent.
    healthyThreshold Integer
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
    httpCheckMethod String
    The HTTP method that is used for health checks.
    unhealthyThreshold Integer
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.
    healthCheckConnectPort number
    The backend port that is used for health checks.
    healthCheckConnectTimeout number
    The maximum timeout period of a health check response.
    healthCheckDomain string
    The domain name that is used for health checks.
    healthCheckEnabled boolean
    Specifies whether to enable health checks.
    healthCheckHttpCodes string[]
    The HTTP status codes returned for health checks.
    healthCheckInterval number
    The interval between two consecutive health checks.
    healthCheckType string
    The protocol that is used for health checks.
    healthCheckUrl string
    The path to which health check requests are sent.
    healthyThreshold number
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
    httpCheckMethod string
    The HTTP method that is used for health checks.
    unhealthyThreshold number
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.
    health_check_connect_port int
    The backend port that is used for health checks.
    health_check_connect_timeout int
    The maximum timeout period of a health check response.
    health_check_domain str
    The domain name that is used for health checks.
    health_check_enabled bool
    Specifies whether to enable health checks.
    health_check_http_codes Sequence[str]
    The HTTP status codes returned for health checks.
    health_check_interval int
    The interval between two consecutive health checks.
    health_check_type str
    The protocol that is used for health checks.
    health_check_url str
    The path to which health check requests are sent.
    healthy_threshold int
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
    http_check_method str
    The HTTP method that is used for health checks.
    unhealthy_threshold int
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.
    healthCheckConnectPort Number
    The backend port that is used for health checks.
    healthCheckConnectTimeout Number
    The maximum timeout period of a health check response.
    healthCheckDomain String
    The domain name that is used for health checks.
    healthCheckEnabled Boolean
    Specifies whether to enable health checks.
    healthCheckHttpCodes List<String>
    The HTTP status codes returned for health checks.
    healthCheckInterval Number
    The interval between two consecutive health checks.
    healthCheckType String
    The protocol that is used for health checks.
    healthCheckUrl String
    The path to which health check requests are sent.
    healthyThreshold Number
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy.
    httpCheckMethod String
    The HTTP method that is used for health checks.
    unhealthyThreshold Number
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi