# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetScalingGroupResult',
    'AwaitableGetScalingGroupResult',
    'get_scaling_group',
    'get_scaling_group_output',
]

@pulumi.output_type
class GetScalingGroupResult:
    """
    A collection of values returned by getScalingGroup.
    """
    def __init__(__self__, active_scaling_configuration_id=None, created_time=None, db_instance_ids=None, default_cooldown=None, desire_instance_number=None, health_check_type=None, id=None, instance_terminate_policy=None, instances_distribution=None, is_enable_scaling_group=None, launch_template_id=None, launch_template_overrides=None, launch_template_version=None, lifecycle_state=None, load_balancer_health_check_grace_period=None, max_instance_number=None, min_instance_number=None, multi_az_policy=None, project_name=None, scaling_group_id=None, scaling_group_name=None, scaling_mode=None, server_group_attributes=None, stopped_instance_count=None, subnet_ids=None, suspended_processes=None, tags=None, total_instance_count=None, updated_time=None, vpc_id=None):
        if active_scaling_configuration_id and not isinstance(active_scaling_configuration_id, str):
            raise TypeError("Expected argument 'active_scaling_configuration_id' to be a str")
        pulumi.set(__self__, "active_scaling_configuration_id", active_scaling_configuration_id)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if db_instance_ids and not isinstance(db_instance_ids, list):
            raise TypeError("Expected argument 'db_instance_ids' to be a list")
        pulumi.set(__self__, "db_instance_ids", db_instance_ids)
        if default_cooldown and not isinstance(default_cooldown, int):
            raise TypeError("Expected argument 'default_cooldown' to be a int")
        pulumi.set(__self__, "default_cooldown", default_cooldown)
        if desire_instance_number and not isinstance(desire_instance_number, int):
            raise TypeError("Expected argument 'desire_instance_number' to be a int")
        pulumi.set(__self__, "desire_instance_number", desire_instance_number)
        if health_check_type and not isinstance(health_check_type, str):
            raise TypeError("Expected argument 'health_check_type' to be a str")
        pulumi.set(__self__, "health_check_type", health_check_type)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance_terminate_policy and not isinstance(instance_terminate_policy, str):
            raise TypeError("Expected argument 'instance_terminate_policy' to be a str")
        pulumi.set(__self__, "instance_terminate_policy", instance_terminate_policy)
        if instances_distribution and not isinstance(instances_distribution, dict):
            raise TypeError("Expected argument 'instances_distribution' to be a dict")
        pulumi.set(__self__, "instances_distribution", instances_distribution)
        if is_enable_scaling_group and not isinstance(is_enable_scaling_group, bool):
            raise TypeError("Expected argument 'is_enable_scaling_group' to be a bool")
        pulumi.set(__self__, "is_enable_scaling_group", is_enable_scaling_group)
        if launch_template_id and not isinstance(launch_template_id, str):
            raise TypeError("Expected argument 'launch_template_id' to be a str")
        pulumi.set(__self__, "launch_template_id", launch_template_id)
        if launch_template_overrides and not isinstance(launch_template_overrides, list):
            raise TypeError("Expected argument 'launch_template_overrides' to be a list")
        pulumi.set(__self__, "launch_template_overrides", launch_template_overrides)
        if launch_template_version and not isinstance(launch_template_version, str):
            raise TypeError("Expected argument 'launch_template_version' to be a str")
        pulumi.set(__self__, "launch_template_version", launch_template_version)
        if lifecycle_state and not isinstance(lifecycle_state, str):
            raise TypeError("Expected argument 'lifecycle_state' to be a str")
        pulumi.set(__self__, "lifecycle_state", lifecycle_state)
        if load_balancer_health_check_grace_period and not isinstance(load_balancer_health_check_grace_period, int):
            raise TypeError("Expected argument 'load_balancer_health_check_grace_period' to be a int")
        pulumi.set(__self__, "load_balancer_health_check_grace_period", load_balancer_health_check_grace_period)
        if max_instance_number and not isinstance(max_instance_number, int):
            raise TypeError("Expected argument 'max_instance_number' to be a int")
        pulumi.set(__self__, "max_instance_number", max_instance_number)
        if min_instance_number and not isinstance(min_instance_number, int):
            raise TypeError("Expected argument 'min_instance_number' to be a int")
        pulumi.set(__self__, "min_instance_number", min_instance_number)
        if multi_az_policy and not isinstance(multi_az_policy, str):
            raise TypeError("Expected argument 'multi_az_policy' to be a str")
        pulumi.set(__self__, "multi_az_policy", multi_az_policy)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if scaling_group_id and not isinstance(scaling_group_id, str):
            raise TypeError("Expected argument 'scaling_group_id' to be a str")
        pulumi.set(__self__, "scaling_group_id", scaling_group_id)
        if scaling_group_name and not isinstance(scaling_group_name, str):
            raise TypeError("Expected argument 'scaling_group_name' to be a str")
        pulumi.set(__self__, "scaling_group_name", scaling_group_name)
        if scaling_mode and not isinstance(scaling_mode, str):
            raise TypeError("Expected argument 'scaling_mode' to be a str")
        pulumi.set(__self__, "scaling_mode", scaling_mode)
        if server_group_attributes and not isinstance(server_group_attributes, list):
            raise TypeError("Expected argument 'server_group_attributes' to be a list")
        pulumi.set(__self__, "server_group_attributes", server_group_attributes)
        if stopped_instance_count and not isinstance(stopped_instance_count, int):
            raise TypeError("Expected argument 'stopped_instance_count' to be a int")
        pulumi.set(__self__, "stopped_instance_count", stopped_instance_count)
        if subnet_ids and not isinstance(subnet_ids, list):
            raise TypeError("Expected argument 'subnet_ids' to be a list")
        pulumi.set(__self__, "subnet_ids", subnet_ids)
        if suspended_processes and not isinstance(suspended_processes, list):
            raise TypeError("Expected argument 'suspended_processes' to be a list")
        pulumi.set(__self__, "suspended_processes", suspended_processes)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if total_instance_count and not isinstance(total_instance_count, int):
            raise TypeError("Expected argument 'total_instance_count' to be a int")
        pulumi.set(__self__, "total_instance_count", total_instance_count)
        if updated_time and not isinstance(updated_time, str):
            raise TypeError("Expected argument 'updated_time' to be a str")
        pulumi.set(__self__, "updated_time", updated_time)
        if vpc_id and not isinstance(vpc_id, str):
            raise TypeError("Expected argument 'vpc_id' to be a str")
        pulumi.set(__self__, "vpc_id", vpc_id)

    @property
    @pulumi.getter(name="activeScalingConfigurationId")
    def active_scaling_configuration_id(self) -> builtins.str:
        """
        伸缩组绑定的伸缩配置的ID。
        """
        return pulumi.get(self, "active_scaling_configuration_id")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        伸缩组创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter(name="dbInstanceIds")
    def db_instance_ids(self) -> Sequence[builtins.str]:
        """
        RDS数据库实例的ID。
        """
        return pulumi.get(self, "db_instance_ids")

    @property
    @pulumi.getter(name="defaultCooldown")
    def default_cooldown(self) -> builtins.int:
        """
        执行一次伸缩活动（添加或移出ECS实例）结束后的冷却时间。冷却时间内，该伸缩组不执行其它的伸缩活动，仅针对云监控报警任务触发的伸缩活动和伸缩规则有效。取值范围：5 ~ 86400，单位：秒。默认值：300。
        """
        return pulumi.get(self, "default_cooldown")

    @property
    @pulumi.getter(name="desireInstanceNumber")
    def desire_instance_number(self) -> builtins.int:
        """
        伸缩组中期望运行的实例个数。1、不小于最小实例数MinInstanceNumber且不大于最大实例数MaxInstanceNumber。2、默认值：-1，表示不开启期望实例数能力。此时，伸缩组创建完成后会立即开始伸缩活动自动添加相应个数的实例。
        """
        return pulumi.get(self, "desire_instance_number")

    @property
    @pulumi.getter(name="healthCheckType")
    def health_check_type(self) -> builtins.str:
        """
        伸缩组的健康检查方式。1、NONE：不做实例健康状态检查。2、ECS（默认）：对伸缩组内的ECS实例做健康检查。
        """
        return pulumi.get(self, "health_check_type")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="instanceTerminatePolicy")
    def instance_terminate_policy(self) -> builtins.str:
        """
        实例移除策略，1、OldestInstance：移出最早加入 （包括自动创建和手动添加）伸缩组的实例。2、NewestInstance：移出最晚加入（包括自动创建和手动添加）伸缩组的实例。3、OldestScalingConfigurationWithOldestInstance（默认）：移出最早与伸缩组绑定的伸缩配置中，最早由伸缩组 自动创建 的实例。4、OldestScalingConfigurationWithNewestInstance：移出最早与伸缩组绑定的伸缩配置中，最晚由伸缩组 自动创建 的实例。
        """
        return pulumi.get(self, "instance_terminate_policy")

    @property
    @pulumi.getter(name="instancesDistribution")
    def instances_distribution(self) -> 'outputs.GetScalingGroupInstancesDistributionResult':
        """
        实例分布策略。
        """
        return pulumi.get(self, "instances_distribution")

    @property
    @pulumi.getter(name="isEnableScalingGroup")
    def is_enable_scaling_group(self) -> builtins.bool:
        """
        是否启用伸缩组。true：启用。false：停止
        """
        return pulumi.get(self, "is_enable_scaling_group")

    @property
    @pulumi.getter(name="launchTemplateId")
    def launch_template_id(self) -> builtins.str:
        """
        实例启动模板ID，配置后表示选择启动模版作为伸缩配置来源。
        """
        return pulumi.get(self, "launch_template_id")

    @property
    @pulumi.getter(name="launchTemplateOverrides")
    def launch_template_overrides(self) -> Sequence['outputs.GetScalingGroupLaunchTemplateOverrideResult']:
        """
        实例启动模版信息。
        """
        return pulumi.get(self, "launch_template_overrides")

    @property
    @pulumi.getter(name="launchTemplateVersion")
    def launch_template_version(self) -> builtins.str:
        """
        实例启动模板的版本。1、模板的某个版本号。2、Default（默认）：始终使用模板默认版本。3、Latest：始终使用模板最新版本。
        """
        return pulumi.get(self, "launch_template_version")

    @property
    @pulumi.getter(name="lifecycleState")
    def lifecycle_state(self) -> builtins.str:
        """
        伸缩组的状态。Active：已启用。InActive：未激活。Deleting：删除中。Locked: 已锁定。CoolingDown: 冷却中。Unknown: 未知状态。
        """
        return pulumi.get(self, "lifecycle_state")

    @property
    @pulumi.getter(name="loadBalancerHealthCheckGracePeriod")
    def load_balancer_health_check_grace_period(self) -> builtins.int:
        """
        伸缩组实例CLB健康状况检查宽限期。
        """
        return pulumi.get(self, "load_balancer_health_check_grace_period")

    @property
    @pulumi.getter(name="maxInstanceNumber")
    def max_instance_number(self) -> builtins.int:
        """
        伸缩组中实例个数的最大值，默认取值0 ～ 100。您可以通过配额中心调整。
        """
        return pulumi.get(self, "max_instance_number")

    @property
    @pulumi.getter(name="minInstanceNumber")
    def min_instance_number(self) -> builtins.int:
        """
        伸缩组中实例个数的最小值，默认取值0 ～ 100。您可以通过配额中心调整。
        """
        return pulumi.get(self, "min_instance_number")

    @property
    @pulumi.getter(name="multiAzPolicy")
    def multi_az_policy(self) -> builtins.str:
        """
        扩缩容策略，如果您选择了多个子网，需配置本参数。1、PRIORITY（默认）：优先级策略。2、BALANCE：均衡分布策略。
        """
        return pulumi.get(self, "multi_az_policy")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        伸缩组所属项目，默认为default。一个资源只能归属于一个项目。只能包含字母、数字、下划线“_”、点“.”和中划线“-”。长度限制在64个字符以内。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="scalingGroupId")
    def scaling_group_id(self) -> builtins.str:
        """
        伸缩组ID。
        """
        return pulumi.get(self, "scaling_group_id")

    @property
    @pulumi.getter(name="scalingGroupName")
    def scaling_group_name(self) -> builtins.str:
        """
        伸缩组名称，同一地域下伸缩组名称唯一。只能以中文、字母开头，只能包含中文、字母、数字、下划线和中划线 。长度限制为1 ~ 128个字符。暂不支持特殊字符。
        """
        return pulumi.get(self, "scaling_group_name")

    @property
    @pulumi.getter(name="scalingMode")
    def scaling_mode(self) -> builtins.str:
        """
        伸缩组的实例回收模式。1、release（默认）：释放模式。2、recycle：停机回收模式。
        """
        return pulumi.get(self, "scaling_mode")

    @property
    @pulumi.getter(name="serverGroupAttributes")
    def server_group_attributes(self) -> Sequence['outputs.GetScalingGroupServerGroupAttributeResult']:
        """
        伸缩组关联的负载均衡信息。
        """
        return pulumi.get(self, "server_group_attributes")

    @property
    @pulumi.getter(name="stoppedInstanceCount")
    def stopped_instance_count(self) -> builtins.int:
        """
        伸缩组内处于停用中状态的实例数量。
        """
        return pulumi.get(self, "stopped_instance_count")

    @property
    @pulumi.getter(name="subnetIds")
    def subnet_ids(self) -> Sequence[builtins.str]:
        """
        伸缩组中实例主网卡的子网ID列表。
        """
        return pulumi.get(self, "subnet_ids")

    @property
    @pulumi.getter(name="suspendedProcesses")
    def suspended_processes(self) -> Sequence[builtins.str]:
        """
        暂停中的流程，无暂停中流程则返回空值。ScaleIn：缩容流程。ScaleOut：扩容流程。HealthCheck：健康检查。AlarmNotification：报警任务。ScheduledAction：定时任务。
        """
        return pulumi.get(self, "suspended_processes")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetScalingGroupTagResult']:
        """
        标签列表。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="totalInstanceCount")
    def total_instance_count(self) -> builtins.int:
        """
        当前伸缩组内实例的个数。
        """
        return pulumi.get(self, "total_instance_count")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.str:
        """
        伸缩组更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> builtins.str:
        """
        伸缩组所属私有网络ID。
        """
        return pulumi.get(self, "vpc_id")


class AwaitableGetScalingGroupResult(GetScalingGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetScalingGroupResult(
            active_scaling_configuration_id=self.active_scaling_configuration_id,
            created_time=self.created_time,
            db_instance_ids=self.db_instance_ids,
            default_cooldown=self.default_cooldown,
            desire_instance_number=self.desire_instance_number,
            health_check_type=self.health_check_type,
            id=self.id,
            instance_terminate_policy=self.instance_terminate_policy,
            instances_distribution=self.instances_distribution,
            is_enable_scaling_group=self.is_enable_scaling_group,
            launch_template_id=self.launch_template_id,
            launch_template_overrides=self.launch_template_overrides,
            launch_template_version=self.launch_template_version,
            lifecycle_state=self.lifecycle_state,
            load_balancer_health_check_grace_period=self.load_balancer_health_check_grace_period,
            max_instance_number=self.max_instance_number,
            min_instance_number=self.min_instance_number,
            multi_az_policy=self.multi_az_policy,
            project_name=self.project_name,
            scaling_group_id=self.scaling_group_id,
            scaling_group_name=self.scaling_group_name,
            scaling_mode=self.scaling_mode,
            server_group_attributes=self.server_group_attributes,
            stopped_instance_count=self.stopped_instance_count,
            subnet_ids=self.subnet_ids,
            suspended_processes=self.suspended_processes,
            tags=self.tags,
            total_instance_count=self.total_instance_count,
            updated_time=self.updated_time,
            vpc_id=self.vpc_id)


def get_scaling_group(id: Optional[builtins.str] = None,
                      opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetScalingGroupResult:
    """
    Data Source schema for Byteplus::AutoScaling::ScalingGroup


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:autoscaling/getScalingGroup:getScalingGroup', __args__, opts=opts, typ=GetScalingGroupResult).value

    return AwaitableGetScalingGroupResult(
        active_scaling_configuration_id=pulumi.get(__ret__, 'active_scaling_configuration_id'),
        created_time=pulumi.get(__ret__, 'created_time'),
        db_instance_ids=pulumi.get(__ret__, 'db_instance_ids'),
        default_cooldown=pulumi.get(__ret__, 'default_cooldown'),
        desire_instance_number=pulumi.get(__ret__, 'desire_instance_number'),
        health_check_type=pulumi.get(__ret__, 'health_check_type'),
        id=pulumi.get(__ret__, 'id'),
        instance_terminate_policy=pulumi.get(__ret__, 'instance_terminate_policy'),
        instances_distribution=pulumi.get(__ret__, 'instances_distribution'),
        is_enable_scaling_group=pulumi.get(__ret__, 'is_enable_scaling_group'),
        launch_template_id=pulumi.get(__ret__, 'launch_template_id'),
        launch_template_overrides=pulumi.get(__ret__, 'launch_template_overrides'),
        launch_template_version=pulumi.get(__ret__, 'launch_template_version'),
        lifecycle_state=pulumi.get(__ret__, 'lifecycle_state'),
        load_balancer_health_check_grace_period=pulumi.get(__ret__, 'load_balancer_health_check_grace_period'),
        max_instance_number=pulumi.get(__ret__, 'max_instance_number'),
        min_instance_number=pulumi.get(__ret__, 'min_instance_number'),
        multi_az_policy=pulumi.get(__ret__, 'multi_az_policy'),
        project_name=pulumi.get(__ret__, 'project_name'),
        scaling_group_id=pulumi.get(__ret__, 'scaling_group_id'),
        scaling_group_name=pulumi.get(__ret__, 'scaling_group_name'),
        scaling_mode=pulumi.get(__ret__, 'scaling_mode'),
        server_group_attributes=pulumi.get(__ret__, 'server_group_attributes'),
        stopped_instance_count=pulumi.get(__ret__, 'stopped_instance_count'),
        subnet_ids=pulumi.get(__ret__, 'subnet_ids'),
        suspended_processes=pulumi.get(__ret__, 'suspended_processes'),
        tags=pulumi.get(__ret__, 'tags'),
        total_instance_count=pulumi.get(__ret__, 'total_instance_count'),
        updated_time=pulumi.get(__ret__, 'updated_time'),
        vpc_id=pulumi.get(__ret__, 'vpc_id'))
def get_scaling_group_output(id: Optional[pulumi.Input[builtins.str]] = None,
                             opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetScalingGroupResult]:
    """
    Data Source schema for Byteplus::AutoScaling::ScalingGroup


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:autoscaling/getScalingGroup:getScalingGroup', __args__, opts=opts, typ=GetScalingGroupResult)
    return __ret__.apply(lambda __response__: GetScalingGroupResult(
        active_scaling_configuration_id=pulumi.get(__response__, 'active_scaling_configuration_id'),
        created_time=pulumi.get(__response__, 'created_time'),
        db_instance_ids=pulumi.get(__response__, 'db_instance_ids'),
        default_cooldown=pulumi.get(__response__, 'default_cooldown'),
        desire_instance_number=pulumi.get(__response__, 'desire_instance_number'),
        health_check_type=pulumi.get(__response__, 'health_check_type'),
        id=pulumi.get(__response__, 'id'),
        instance_terminate_policy=pulumi.get(__response__, 'instance_terminate_policy'),
        instances_distribution=pulumi.get(__response__, 'instances_distribution'),
        is_enable_scaling_group=pulumi.get(__response__, 'is_enable_scaling_group'),
        launch_template_id=pulumi.get(__response__, 'launch_template_id'),
        launch_template_overrides=pulumi.get(__response__, 'launch_template_overrides'),
        launch_template_version=pulumi.get(__response__, 'launch_template_version'),
        lifecycle_state=pulumi.get(__response__, 'lifecycle_state'),
        load_balancer_health_check_grace_period=pulumi.get(__response__, 'load_balancer_health_check_grace_period'),
        max_instance_number=pulumi.get(__response__, 'max_instance_number'),
        min_instance_number=pulumi.get(__response__, 'min_instance_number'),
        multi_az_policy=pulumi.get(__response__, 'multi_az_policy'),
        project_name=pulumi.get(__response__, 'project_name'),
        scaling_group_id=pulumi.get(__response__, 'scaling_group_id'),
        scaling_group_name=pulumi.get(__response__, 'scaling_group_name'),
        scaling_mode=pulumi.get(__response__, 'scaling_mode'),
        server_group_attributes=pulumi.get(__response__, 'server_group_attributes'),
        stopped_instance_count=pulumi.get(__response__, 'stopped_instance_count'),
        subnet_ids=pulumi.get(__response__, 'subnet_ids'),
        suspended_processes=pulumi.get(__response__, 'suspended_processes'),
        tags=pulumi.get(__response__, 'tags'),
        total_instance_count=pulumi.get(__response__, 'total_instance_count'),
        updated_time=pulumi.get(__response__, 'updated_time'),
        vpc_id=pulumi.get(__response__, 'vpc_id')))
