# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class ScheduledTask(pulumi.CustomResource):
    description: pulumi.Output[str]
    """
    Description of the scheduled task, which is 2-200 characters (English or Chinese) long.
    """
    launch_expiration_time: pulumi.Output[float]
    """
    The time period during which a failed scheduled task is retried. Unit: seconds. Valid values: 0 to 21600. Default value: 600
    """
    launch_time: pulumi.Output[str]
    """
    The time at which the scheduled task is triggered. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. 
    The time must be in UTC. You cannot enter a time point later than 90 days from the date of scheduled task creation.
    If the `recurrence_type` parameter is specified, the task is executed repeatedly at the time specified by LaunchTime.
    Otherwise, the task is only executed once at the date and time specified by LaunchTime.
    """
    recurrence_end_time: pulumi.Output[str]
    """
    Specifies the end time after which the scheduled task is no longer repeated. 
    Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.
    The time must be in UTC. You cannot enter a time point later than 365 days from the date of scheduled task creation.
    """
    recurrence_type: pulumi.Output[str]
    """
    Specifies the recurrence type of the scheduled task. 
    If set, both `recurrence_value` and `recurrence_end_time` must be set. Valid values:
    - Daily: The scheduled task is executed once every specified number of days.
    - Weekly: The scheduled task is executed on each specified day of a week.
    - Monthly: The scheduled task is executed on each specified day of a month.
    - Cron: (Available in 1.60.0+) The scheduled task is executed based on the specified cron expression.
    """
    recurrence_value: pulumi.Output[str]
    """
    Specifies how often a scheduled task recurs. The valid value depends on `recurrence_type`
    - Daily: You can enter one value. Valid values: 1 to 31.
    - Weekly: You can enter multiple values and separate them with commas (,). For example, the values 0 to 6 correspond to the days of the week in sequence from Sunday to Saturday.
    - Monthly: You can enter two values in A-B format. Valid values of A and B: 1 to 31. The value of B must be greater than or equal to the value of A.
    - Cron: You can enter a cron expression which is written in UTC and consists of five fields: minute, hour, day of month (date), month, and day of week. The expression can contain wildcard characters including commas (,), question marks (?), hyphens (-), asterisks (*), number signs (#), forward slashes (/), and the L and W letters.
    """
    scheduled_action: pulumi.Output[str]
    """
    The operation to be performed when a scheduled task is triggered. Enter the unique identifier of a scaling rule.
    """
    scheduled_task_name: pulumi.Output[str]
    """
    Display name of the scheduled task, which must be 2-40 characters (English or Chinese) long.
    """
    task_enabled: pulumi.Output[bool]
    """
    Specifies whether to start the scheduled task. Default to true.
    """
    def __init__(__self__, resource_name, opts=None, description=None, launch_expiration_time=None, launch_time=None, recurrence_end_time=None, recurrence_type=None, recurrence_value=None, scheduled_action=None, scheduled_task_name=None, task_enabled=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a ScheduledTask resource with the given unique name, props, and options.
        
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] description: Description of the scheduled task, which is 2-200 characters (English or Chinese) long.
        :param pulumi.Input[float] launch_expiration_time: The time period during which a failed scheduled task is retried. Unit: seconds. Valid values: 0 to 21600. Default value: 600
        :param pulumi.Input[str] launch_time: The time at which the scheduled task is triggered. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. 
               The time must be in UTC. You cannot enter a time point later than 90 days from the date of scheduled task creation.
               If the `recurrence_type` parameter is specified, the task is executed repeatedly at the time specified by LaunchTime.
               Otherwise, the task is only executed once at the date and time specified by LaunchTime.
        :param pulumi.Input[str] recurrence_end_time: Specifies the end time after which the scheduled task is no longer repeated. 
               Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.
               The time must be in UTC. You cannot enter a time point later than 365 days from the date of scheduled task creation.
        :param pulumi.Input[str] recurrence_type: Specifies the recurrence type of the scheduled task. 
               If set, both `recurrence_value` and `recurrence_end_time` must be set. Valid values:
               - Daily: The scheduled task is executed once every specified number of days.
               - Weekly: The scheduled task is executed on each specified day of a week.
               - Monthly: The scheduled task is executed on each specified day of a month.
               - Cron: (Available in 1.60.0+) The scheduled task is executed based on the specified cron expression.
        :param pulumi.Input[str] recurrence_value: Specifies how often a scheduled task recurs. The valid value depends on `recurrence_type`
               - Daily: You can enter one value. Valid values: 1 to 31.
               - Weekly: You can enter multiple values and separate them with commas (,). For example, the values 0 to 6 correspond to the days of the week in sequence from Sunday to Saturday.
               - Monthly: You can enter two values in A-B format. Valid values of A and B: 1 to 31. The value of B must be greater than or equal to the value of A.
               - Cron: You can enter a cron expression which is written in UTC and consists of five fields: minute, hour, day of month (date), month, and day of week. The expression can contain wildcard characters including commas (,), question marks (?), hyphens (-), asterisks (*), number signs (#), forward slashes (/), and the L and W letters.
        :param pulumi.Input[str] scheduled_action: The operation to be performed when a scheduled task is triggered. Enter the unique identifier of a scaling rule.
        :param pulumi.Input[str] scheduled_task_name: Display name of the scheduled task, which must be 2-40 characters (English or Chinese) long.
        :param pulumi.Input[bool] task_enabled: Specifies whether to start the scheduled task. Default to true.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/ess_scheduled_task.html.markdown.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['description'] = description
            __props__['launch_expiration_time'] = launch_expiration_time
            if launch_time is None:
                raise TypeError("Missing required property 'launch_time'")
            __props__['launch_time'] = launch_time
            __props__['recurrence_end_time'] = recurrence_end_time
            __props__['recurrence_type'] = recurrence_type
            __props__['recurrence_value'] = recurrence_value
            if scheduled_action is None:
                raise TypeError("Missing required property 'scheduled_action'")
            __props__['scheduled_action'] = scheduled_action
            __props__['scheduled_task_name'] = scheduled_task_name
            __props__['task_enabled'] = task_enabled
        super(ScheduledTask, __self__).__init__(
            'alicloud:ess/scheduledTask:ScheduledTask',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, description=None, launch_expiration_time=None, launch_time=None, recurrence_end_time=None, recurrence_type=None, recurrence_value=None, scheduled_action=None, scheduled_task_name=None, task_enabled=None):
        """
        Get an existing ScheduledTask resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.
        
        :param str resource_name: The unique name of the resulting resource.
        :param str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] description: Description of the scheduled task, which is 2-200 characters (English or Chinese) long.
        :param pulumi.Input[float] launch_expiration_time: The time period during which a failed scheduled task is retried. Unit: seconds. Valid values: 0 to 21600. Default value: 600
        :param pulumi.Input[str] launch_time: The time at which the scheduled task is triggered. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. 
               The time must be in UTC. You cannot enter a time point later than 90 days from the date of scheduled task creation.
               If the `recurrence_type` parameter is specified, the task is executed repeatedly at the time specified by LaunchTime.
               Otherwise, the task is only executed once at the date and time specified by LaunchTime.
        :param pulumi.Input[str] recurrence_end_time: Specifies the end time after which the scheduled task is no longer repeated. 
               Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.
               The time must be in UTC. You cannot enter a time point later than 365 days from the date of scheduled task creation.
        :param pulumi.Input[str] recurrence_type: Specifies the recurrence type of the scheduled task. 
               If set, both `recurrence_value` and `recurrence_end_time` must be set. Valid values:
               - Daily: The scheduled task is executed once every specified number of days.
               - Weekly: The scheduled task is executed on each specified day of a week.
               - Monthly: The scheduled task is executed on each specified day of a month.
               - Cron: (Available in 1.60.0+) The scheduled task is executed based on the specified cron expression.
        :param pulumi.Input[str] recurrence_value: Specifies how often a scheduled task recurs. The valid value depends on `recurrence_type`
               - Daily: You can enter one value. Valid values: 1 to 31.
               - Weekly: You can enter multiple values and separate them with commas (,). For example, the values 0 to 6 correspond to the days of the week in sequence from Sunday to Saturday.
               - Monthly: You can enter two values in A-B format. Valid values of A and B: 1 to 31. The value of B must be greater than or equal to the value of A.
               - Cron: You can enter a cron expression which is written in UTC and consists of five fields: minute, hour, day of month (date), month, and day of week. The expression can contain wildcard characters including commas (,), question marks (?), hyphens (-), asterisks (*), number signs (#), forward slashes (/), and the L and W letters.
        :param pulumi.Input[str] scheduled_action: The operation to be performed when a scheduled task is triggered. Enter the unique identifier of a scaling rule.
        :param pulumi.Input[str] scheduled_task_name: Display name of the scheduled task, which must be 2-40 characters (English or Chinese) long.
        :param pulumi.Input[bool] task_enabled: Specifies whether to start the scheduled task. Default to true.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/ess_scheduled_task.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["description"] = description
        __props__["launch_expiration_time"] = launch_expiration_time
        __props__["launch_time"] = launch_time
        __props__["recurrence_end_time"] = recurrence_end_time
        __props__["recurrence_type"] = recurrence_type
        __props__["recurrence_value"] = recurrence_value
        __props__["scheduled_action"] = scheduled_action
        __props__["scheduled_task_name"] = scheduled_task_name
        __props__["task_enabled"] = task_enabled
        return ScheduledTask(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

