# 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__ = [
    'GetScalingLifecycleHookResult',
    'AwaitableGetScalingLifecycleHookResult',
    'get_scaling_lifecycle_hook',
    'get_scaling_lifecycle_hook_output',
]

@pulumi.output_type
class GetScalingLifecycleHookResult:
    """
    A collection of values returned by getScalingLifecycleHook.
    """
    def __init__(__self__, id=None, lifecycle_command=None, lifecycle_hook_id=None, lifecycle_hook_name=None, lifecycle_hook_policy=None, lifecycle_hook_timeout=None, lifecycle_hook_type=None, scaling_group_id=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if lifecycle_command and not isinstance(lifecycle_command, dict):
            raise TypeError("Expected argument 'lifecycle_command' to be a dict")
        pulumi.set(__self__, "lifecycle_command", lifecycle_command)
        if lifecycle_hook_id and not isinstance(lifecycle_hook_id, str):
            raise TypeError("Expected argument 'lifecycle_hook_id' to be a str")
        pulumi.set(__self__, "lifecycle_hook_id", lifecycle_hook_id)
        if lifecycle_hook_name and not isinstance(lifecycle_hook_name, str):
            raise TypeError("Expected argument 'lifecycle_hook_name' to be a str")
        pulumi.set(__self__, "lifecycle_hook_name", lifecycle_hook_name)
        if lifecycle_hook_policy and not isinstance(lifecycle_hook_policy, str):
            raise TypeError("Expected argument 'lifecycle_hook_policy' to be a str")
        pulumi.set(__self__, "lifecycle_hook_policy", lifecycle_hook_policy)
        if lifecycle_hook_timeout and not isinstance(lifecycle_hook_timeout, int):
            raise TypeError("Expected argument 'lifecycle_hook_timeout' to be a int")
        pulumi.set(__self__, "lifecycle_hook_timeout", lifecycle_hook_timeout)
        if lifecycle_hook_type and not isinstance(lifecycle_hook_type, str):
            raise TypeError("Expected argument 'lifecycle_hook_type' to be a str")
        pulumi.set(__self__, "lifecycle_hook_type", lifecycle_hook_type)
        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)

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

    @property
    @pulumi.getter(name="lifecycleCommand")
    def lifecycle_command(self) -> 'outputs.GetScalingLifecycleHookLifecycleCommandResult':
        """
        云助手相关命令信息。
        """
        return pulumi.get(self, "lifecycle_command")

    @property
    @pulumi.getter(name="lifecycleHookId")
    def lifecycle_hook_id(self) -> builtins.str:
        """
        生命周期挂钩ID。
        """
        return pulumi.get(self, "lifecycle_hook_id")

    @property
    @pulumi.getter(name="lifecycleHookName")
    def lifecycle_hook_name(self) -> builtins.str:
        """
        生命周期挂钩名称，创建后不可修改。取值：不能以数字、中划线、下划线开头。只能包含中文、字母、数字、下划线和中划线。长度限制在1 ~ 128个字符之间。
        """
        return pulumi.get(self, "lifecycle_hook_name")

    @property
    @pulumi.getter(name="lifecycleHookPolicy")
    def lifecycle_hook_policy(self) -> builtins.str:
        """
        实例挂起状态结束后执行的策略。取值：CONTINUE：继续执行。REJECT：中止后续操作。ROLLBACK：针对弹性收缩活动，会拒绝释放ECS实例，进行回滚；针对弹性扩张活动，效果同REJECT一样。
        """
        return pulumi.get(self, "lifecycle_hook_policy")

    @property
    @pulumi.getter(name="lifecycleHookTimeout")
    def lifecycle_hook_timeout(self) -> builtins.int:
        """
        ECS实例保持挂起状态的时间，超时后，自动结束挂起状态，根据执行策略继续执行扩缩容行为。 请您评估自定义操作的处理时间后，设置合适的超时时间。取值：30 ～ 21600（6小时），单位 s，且必须为整数。
        """
        return pulumi.get(self, "lifecycle_hook_timeout")

    @property
    @pulumi.getter(name="lifecycleHookType")
    def lifecycle_hook_type(self) -> builtins.str:
        """
        伸缩活动的类型，发生指定类型的伸缩活动时，生命周期挂钩会被触发并挂起ECS实例。取值：SCALE*IN：弹性收缩活动。SCALE*OUT：弹性扩张活动。
        """
        return pulumi.get(self, "lifecycle_hook_type")

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


class AwaitableGetScalingLifecycleHookResult(GetScalingLifecycleHookResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetScalingLifecycleHookResult(
            id=self.id,
            lifecycle_command=self.lifecycle_command,
            lifecycle_hook_id=self.lifecycle_hook_id,
            lifecycle_hook_name=self.lifecycle_hook_name,
            lifecycle_hook_policy=self.lifecycle_hook_policy,
            lifecycle_hook_timeout=self.lifecycle_hook_timeout,
            lifecycle_hook_type=self.lifecycle_hook_type,
            scaling_group_id=self.scaling_group_id)


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


    :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/getScalingLifecycleHook:getScalingLifecycleHook', __args__, opts=opts, typ=GetScalingLifecycleHookResult).value

    return AwaitableGetScalingLifecycleHookResult(
        id=pulumi.get(__ret__, 'id'),
        lifecycle_command=pulumi.get(__ret__, 'lifecycle_command'),
        lifecycle_hook_id=pulumi.get(__ret__, 'lifecycle_hook_id'),
        lifecycle_hook_name=pulumi.get(__ret__, 'lifecycle_hook_name'),
        lifecycle_hook_policy=pulumi.get(__ret__, 'lifecycle_hook_policy'),
        lifecycle_hook_timeout=pulumi.get(__ret__, 'lifecycle_hook_timeout'),
        lifecycle_hook_type=pulumi.get(__ret__, 'lifecycle_hook_type'),
        scaling_group_id=pulumi.get(__ret__, 'scaling_group_id'))
def get_scaling_lifecycle_hook_output(id: Optional[pulumi.Input[builtins.str]] = None,
                                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetScalingLifecycleHookResult]:
    """
    Data Source schema for Byteplus::AutoScaling::ScalingLifecycleHook


    :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/getScalingLifecycleHook:getScalingLifecycleHook', __args__, opts=opts, typ=GetScalingLifecycleHookResult)
    return __ret__.apply(lambda __response__: GetScalingLifecycleHookResult(
        id=pulumi.get(__response__, 'id'),
        lifecycle_command=pulumi.get(__response__, 'lifecycle_command'),
        lifecycle_hook_id=pulumi.get(__response__, 'lifecycle_hook_id'),
        lifecycle_hook_name=pulumi.get(__response__, 'lifecycle_hook_name'),
        lifecycle_hook_policy=pulumi.get(__response__, 'lifecycle_hook_policy'),
        lifecycle_hook_timeout=pulumi.get(__response__, 'lifecycle_hook_timeout'),
        lifecycle_hook_type=pulumi.get(__response__, 'lifecycle_hook_type'),
        scaling_group_id=pulumi.get(__response__, 'scaling_group_id')))
