1. Packages
  2. Alicloud Provider
  3. API Docs
  4. ess
  5. getScalingGroups
Alibaba Cloud v3.65.0 published on Monday, Nov 4, 2024 by Pulumi

alicloud.ess.getScalingGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.65.0 published on Monday, Nov 4, 2024 by Pulumi

    This data source provides available scaling group resources.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const scalinggroupsDs = alicloud.ess.getScalingGroups({
        ids: [
            "scaling_group_id1",
            "scaling_group_id2",
        ],
        nameRegex: "scaling_group_name",
    });
    export const firstScalingGroup = scalinggroupsDs.then(scalinggroupsDs => scalinggroupsDs.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    scalinggroups_ds = alicloud.ess.get_scaling_groups(ids=[
            "scaling_group_id1",
            "scaling_group_id2",
        ],
        name_regex="scaling_group_name")
    pulumi.export("firstScalingGroup", scalinggroups_ds.groups[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ess"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		scalinggroupsDs, err := ess.GetScalingGroups(ctx, &ess.GetScalingGroupsArgs{
    			Ids: []string{
    				"scaling_group_id1",
    				"scaling_group_id2",
    			},
    			NameRegex: pulumi.StringRef("scaling_group_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstScalingGroup", scalinggroupsDs.Groups[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var scalinggroupsDs = AliCloud.Ess.GetScalingGroups.Invoke(new()
        {
            Ids = new[]
            {
                "scaling_group_id1",
                "scaling_group_id2",
            },
            NameRegex = "scaling_group_name",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstScalingGroup"] = scalinggroupsDs.Apply(getScalingGroupsResult => getScalingGroupsResult.Groups[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ess.EssFunctions;
    import com.pulumi.alicloud.ess.inputs.GetScalingGroupsArgs;
    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 scalinggroupsDs = EssFunctions.getScalingGroups(GetScalingGroupsArgs.builder()
                .ids(            
                    "scaling_group_id1",
                    "scaling_group_id2")
                .nameRegex("scaling_group_name")
                .build());
    
            ctx.export("firstScalingGroup", scalinggroupsDs.applyValue(getScalingGroupsResult -> getScalingGroupsResult.groups()[0].id()));
        }
    }
    
    variables:
      scalinggroupsDs:
        fn::invoke:
          Function: alicloud:ess:getScalingGroups
          Arguments:
            ids:
              - scaling_group_id1
              - scaling_group_id2
            nameRegex: scaling_group_name
    outputs:
      firstScalingGroup: ${scalinggroupsDs.groups[0].id}
    

    Using getScalingGroups

    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 getScalingGroups(args: GetScalingGroupsArgs, opts?: InvokeOptions): Promise<GetScalingGroupsResult>
    function getScalingGroupsOutput(args: GetScalingGroupsOutputArgs, opts?: InvokeOptions): Output<GetScalingGroupsResult>
    def get_scaling_groups(ids: Optional[Sequence[str]] = None,
                           name_regex: Optional[str] = None,
                           output_file: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetScalingGroupsResult
    def get_scaling_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,
                           opts: Optional[InvokeOptions] = None) -> Output[GetScalingGroupsResult]
    func GetScalingGroups(ctx *Context, args *GetScalingGroupsArgs, opts ...InvokeOption) (*GetScalingGroupsResult, error)
    func GetScalingGroupsOutput(ctx *Context, args *GetScalingGroupsOutputArgs, opts ...InvokeOption) GetScalingGroupsResultOutput

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

    public static class GetScalingGroups 
    {
        public static Task<GetScalingGroupsResult> InvokeAsync(GetScalingGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetScalingGroupsResult> Invoke(GetScalingGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetScalingGroupsResult> getScalingGroups(GetScalingGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ess/getScalingGroups:getScalingGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of scaling group IDs.
    NameRegex string
    A regex string to filter resulting scaling groups by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of scaling group IDs.
    NameRegex string
    A regex string to filter resulting scaling groups by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of scaling group IDs.
    nameRegex String
    A regex string to filter resulting scaling groups by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of scaling group IDs.
    nameRegex string
    A regex string to filter resulting scaling groups by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of scaling group IDs.
    name_regex str
    A regex string to filter resulting scaling groups by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of scaling group IDs.
    nameRegex String
    A regex string to filter resulting scaling groups by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getScalingGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.Ess.Outputs.GetScalingGroupsGroup>
    A list of scaling groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of scaling group ids.
    Names List<string>
    A list of scaling group names.
    NameRegex string
    OutputFile string
    Groups []GetScalingGroupsGroup
    A list of scaling groups. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of scaling group ids.
    Names []string
    A list of scaling group names.
    NameRegex string
    OutputFile string
    groups List<GetScalingGroupsGroup>
    A list of scaling groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of scaling group ids.
    names List<String>
    A list of scaling group names.
    nameRegex String
    outputFile String
    groups GetScalingGroupsGroup[]
    A list of scaling groups. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of scaling group ids.
    names string[]
    A list of scaling group names.
    nameRegex string
    outputFile string
    groups Sequence[GetScalingGroupsGroup]
    A list of scaling groups. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of scaling group ids.
    names Sequence[str]
    A list of scaling group names.
    name_regex str
    output_file str
    groups List<Property Map>
    A list of scaling groups. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of scaling group ids.
    names List<String>
    A list of scaling group names.
    nameRegex String
    outputFile String

    Supporting Types

    GetScalingGroupsGroup

    ActiveCapacity int
    Number of active instances in scaling group.
    ActiveScalingConfiguration string
    Active scaling configuration for scaling group.
    CooldownTime int
    Default cooldown time of scaling group.
    CreationTime string
    Creation time of scaling group.
    DbInstanceIds List<string>
    Db instances id which the ECS instance attached to.
    GroupDeletionProtection bool
    Whether the scaling group deletion protection is enabled.
    HealthCheckType string
    The health check method of the scaling group.
    Id string
    ID of the scaling group.
    LaunchTemplateId string
    Active launch template ID for scaling group.
    LaunchTemplateVersion string
    Version of active launch template.
    LifecycleState string
    Lifecycle state of scaling group.
    LoadBalancerIds List<string>
    Slb instances id which the ECS instance attached to.
    MaxSize int
    The maximum number of ECS instances.
    MinSize int
    The minimum number of ECS instances.
    ModificationTime string
    The modification time.
    Name string
    Name of the scaling group.
    PendingCapacity int
    Number of pending instances in scaling group.
    RegionId string
    Region ID the scaling group belongs to.
    RemovalPolicies List<string>
    Removal policy used to select the ECS instance to remove from the scaling group.
    RemovingCapacity int
    Number of removing instances in scaling group.
    SuspendedProcesses List<string>
    The Process in suspension.
    TotalCapacity int
    Number of instances in scaling group.
    TotalInstanceCount int
    The number of all ECS instances in the scaling group.
    VpcId string
    The ID of the VPC to which the scaling group belongs.
    VswitchId string
    The ID of the vSwitch to which the scaling group belongs.
    VswitchIds List<string>
    Vswitches id in which the ECS instance launched.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    ActiveCapacity int
    Number of active instances in scaling group.
    ActiveScalingConfiguration string
    Active scaling configuration for scaling group.
    CooldownTime int
    Default cooldown time of scaling group.
    CreationTime string
    Creation time of scaling group.
    DbInstanceIds []string
    Db instances id which the ECS instance attached to.
    GroupDeletionProtection bool
    Whether the scaling group deletion protection is enabled.
    HealthCheckType string
    The health check method of the scaling group.
    Id string
    ID of the scaling group.
    LaunchTemplateId string
    Active launch template ID for scaling group.
    LaunchTemplateVersion string
    Version of active launch template.
    LifecycleState string
    Lifecycle state of scaling group.
    LoadBalancerIds []string
    Slb instances id which the ECS instance attached to.
    MaxSize int
    The maximum number of ECS instances.
    MinSize int
    The minimum number of ECS instances.
    ModificationTime string
    The modification time.
    Name string
    Name of the scaling group.
    PendingCapacity int
    Number of pending instances in scaling group.
    RegionId string
    Region ID the scaling group belongs to.
    RemovalPolicies []string
    Removal policy used to select the ECS instance to remove from the scaling group.
    RemovingCapacity int
    Number of removing instances in scaling group.
    SuspendedProcesses []string
    The Process in suspension.
    TotalCapacity int
    Number of instances in scaling group.
    TotalInstanceCount int
    The number of all ECS instances in the scaling group.
    VpcId string
    The ID of the VPC to which the scaling group belongs.
    VswitchId string
    The ID of the vSwitch to which the scaling group belongs.
    VswitchIds []string
    Vswitches id in which the ECS instance launched.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    activeCapacity Integer
    Number of active instances in scaling group.
    activeScalingConfiguration String
    Active scaling configuration for scaling group.
    cooldownTime Integer
    Default cooldown time of scaling group.
    creationTime String
    Creation time of scaling group.
    dbInstanceIds List<String>
    Db instances id which the ECS instance attached to.
    groupDeletionProtection Boolean
    Whether the scaling group deletion protection is enabled.
    healthCheckType String
    The health check method of the scaling group.
    id String
    ID of the scaling group.
    launchTemplateId String
    Active launch template ID for scaling group.
    launchTemplateVersion String
    Version of active launch template.
    lifecycleState String
    Lifecycle state of scaling group.
    loadBalancerIds List<String>
    Slb instances id which the ECS instance attached to.
    maxSize Integer
    The maximum number of ECS instances.
    minSize Integer
    The minimum number of ECS instances.
    modificationTime String
    The modification time.
    name String
    Name of the scaling group.
    pendingCapacity Integer
    Number of pending instances in scaling group.
    regionId String
    Region ID the scaling group belongs to.
    removalPolicies List<String>
    Removal policy used to select the ECS instance to remove from the scaling group.
    removingCapacity Integer
    Number of removing instances in scaling group.
    suspendedProcesses List<String>
    The Process in suspension.
    totalCapacity Integer
    Number of instances in scaling group.
    totalInstanceCount Integer
    The number of all ECS instances in the scaling group.
    vpcId String
    The ID of the VPC to which the scaling group belongs.
    vswitchId String
    The ID of the vSwitch to which the scaling group belongs.
    vswitchIds List<String>
    Vswitches id in which the ECS instance launched.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    activeCapacity number
    Number of active instances in scaling group.
    activeScalingConfiguration string
    Active scaling configuration for scaling group.
    cooldownTime number
    Default cooldown time of scaling group.
    creationTime string
    Creation time of scaling group.
    dbInstanceIds string[]
    Db instances id which the ECS instance attached to.
    groupDeletionProtection boolean
    Whether the scaling group deletion protection is enabled.
    healthCheckType string
    The health check method of the scaling group.
    id string
    ID of the scaling group.
    launchTemplateId string
    Active launch template ID for scaling group.
    launchTemplateVersion string
    Version of active launch template.
    lifecycleState string
    Lifecycle state of scaling group.
    loadBalancerIds string[]
    Slb instances id which the ECS instance attached to.
    maxSize number
    The maximum number of ECS instances.
    minSize number
    The minimum number of ECS instances.
    modificationTime string
    The modification time.
    name string
    Name of the scaling group.
    pendingCapacity number
    Number of pending instances in scaling group.
    regionId string
    Region ID the scaling group belongs to.
    removalPolicies string[]
    Removal policy used to select the ECS instance to remove from the scaling group.
    removingCapacity number
    Number of removing instances in scaling group.
    suspendedProcesses string[]
    The Process in suspension.
    totalCapacity number
    Number of instances in scaling group.
    totalInstanceCount number
    The number of all ECS instances in the scaling group.
    vpcId string
    The ID of the VPC to which the scaling group belongs.
    vswitchId string
    The ID of the vSwitch to which the scaling group belongs.
    vswitchIds string[]
    Vswitches id in which the ECS instance launched.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    active_capacity int
    Number of active instances in scaling group.
    active_scaling_configuration str
    Active scaling configuration for scaling group.
    cooldown_time int
    Default cooldown time of scaling group.
    creation_time str
    Creation time of scaling group.
    db_instance_ids Sequence[str]
    Db instances id which the ECS instance attached to.
    group_deletion_protection bool
    Whether the scaling group deletion protection is enabled.
    health_check_type str
    The health check method of the scaling group.
    id str
    ID of the scaling group.
    launch_template_id str
    Active launch template ID for scaling group.
    launch_template_version str
    Version of active launch template.
    lifecycle_state str
    Lifecycle state of scaling group.
    load_balancer_ids Sequence[str]
    Slb instances id which the ECS instance attached to.
    max_size int
    The maximum number of ECS instances.
    min_size int
    The minimum number of ECS instances.
    modification_time str
    The modification time.
    name str
    Name of the scaling group.
    pending_capacity int
    Number of pending instances in scaling group.
    region_id str
    Region ID the scaling group belongs to.
    removal_policies Sequence[str]
    Removal policy used to select the ECS instance to remove from the scaling group.
    removing_capacity int
    Number of removing instances in scaling group.
    suspended_processes Sequence[str]
    The Process in suspension.
    total_capacity int
    Number of instances in scaling group.
    total_instance_count int
    The number of all ECS instances in the scaling group.
    vpc_id str
    The ID of the VPC to which the scaling group belongs.
    vswitch_id str
    The ID of the vSwitch to which the scaling group belongs.
    vswitch_ids Sequence[str]
    Vswitches id in which the ECS instance launched.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    activeCapacity Number
    Number of active instances in scaling group.
    activeScalingConfiguration String
    Active scaling configuration for scaling group.
    cooldownTime Number
    Default cooldown time of scaling group.
    creationTime String
    Creation time of scaling group.
    dbInstanceIds List<String>
    Db instances id which the ECS instance attached to.
    groupDeletionProtection Boolean
    Whether the scaling group deletion protection is enabled.
    healthCheckType String
    The health check method of the scaling group.
    id String
    ID of the scaling group.
    launchTemplateId String
    Active launch template ID for scaling group.
    launchTemplateVersion String
    Version of active launch template.
    lifecycleState String
    Lifecycle state of scaling group.
    loadBalancerIds List<String>
    Slb instances id which the ECS instance attached to.
    maxSize Number
    The maximum number of ECS instances.
    minSize Number
    The minimum number of ECS instances.
    modificationTime String
    The modification time.
    name String
    Name of the scaling group.
    pendingCapacity Number
    Number of pending instances in scaling group.
    regionId String
    Region ID the scaling group belongs to.
    removalPolicies List<String>
    Removal policy used to select the ECS instance to remove from the scaling group.
    removingCapacity Number
    Number of removing instances in scaling group.
    suspendedProcesses List<String>
    The Process in suspension.
    totalCapacity Number
    Number of instances in scaling group.
    totalInstanceCount Number
    The number of all ECS instances in the scaling group.
    vpcId String
    The ID of the VPC to which the scaling group belongs.
    vswitchId String
    The ID of the vSwitch to which the scaling group belongs.
    vswitchIds List<String>
    Vswitches id in which the ECS instance launched.
    tags Map<String>
    A mapping of tags to assign to the resource.

    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.65.0 published on Monday, Nov 4, 2024 by Pulumi