ALIYUN::ESS::ScheduledTask is used to create scheduled tasks based on input parameters.

Syntax

{
  "Type": "ALIYUN::ESS::ScheduledTask",
  "Properties": {
    "TaskEnabled": Boolean,
    "Description": String,
    "ScheduledTaskName": String,
    "LaunchExpirationTime": Integer,
    "LaunchTime": String,
    "RecurrenceEndTime": String,
    "RecurrenceType": String,
    "RecurrenceValue": String,
    "ScheduledAction": String
  }
}

Properties

Name Type Required Editable Description Validity
TaskEnabled Boolean No Yes

Indicates whether to start a scheduled task.

  • When the parameter is set to true, the task is started.
  • When the parameter is set to false, the task is stopped.

Default value: true.

None
Description String No Yes The description of the scheduled task. The description must be 2 to 200 characters in length.
ScheduledTaskName String No Yes The display name of the scheduled task.

The name must be 2 to 40 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). It must start with a letter or digit.

The name of the scheduled task must be unique to an Alibaba Cloud account in a region.

The default value is the ID of the scheduled scaling task.

LaunchExpirationTime Integer No Yes

The period of time over which a failed scheduled task is retried.

Unit: second. Default value: 600.

Valid values: 0 to 21,600.
LaunchTime String Yes Yes

The time at which the scheduled task was triggered.

The time uses UTC and complies with the ISO 8601 standard.

If the RecurrenceType parameter is specified, the task is executed each day at the time specified by LaunchTime.

If the RecurrenceType parameter is not specified, the task is only executed once at the time specified by LaunchTime.

You cannot enter a time point later than 90 days from the date of scheduled task creation or modification.

The format is YYYY-MM-DDThh:mmZ.
RecurrenceEndTime String No Yes

The end time of the scheduled task to be repeated.

The time uses UTC and complies with the ISO 8601 standard.

You cannot enter a time point later than 90 days from the date of scheduled task creation or modification.

If you set RecurrenceEndTime, you must also set both RecurrenceType and RecurrenceValue.

The format is YYYY-MM-DDThh:mmZ.
RecurrenceType String No Yes Indicates the interval that a scheduled task is repeated at. Valid values:
  • Daily: The scheduled task is executed once after the 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: The scheduled task is executed based on the specified Cron expression.

If you set RecurrenceType, you must also set both RecurrenceEndTime and RecurrenceValue.

RecurrenceValue String No Yes Indicates how often a scheduled task recurs.
  • Daily: indicates the interval of days that a scheduled task is repeated on. You can enter a single value ranging from 1 to 31.
  • Weekly: indicates which days of the week that a scheduled task is repeated on. You can enter multiple values separated by commas (,). The values 0 to 6 correspond to the days of the week in sequence from Sunday to Saturday.
  • Monthly: indicates which days of the month that a scheduled task is repeated on. You can enter two values ranging from 1 to 31. The format is A-B. B must be greater than or equal to A.
  • Cron: indicates a user-defined Cron expression that the scheduled task is repeated on. A Cron expression is written in UTC time 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 characters.

If you set RecurrenceValue, you must also set both RecurrenceEndTime and RecurrenceType.

ScheduledAction String  Yes Yes

The operations performed when the scheduled task is triggered.

When you set this parameter, you must also enter the unique identifier of the scaling rule.

The parameter value can be up to 200 characters in length.

Response parameters

Fn::GetAtt

ScheduledTaskId: the ID of the scheduled task. It is a globally unique identifier (GUID) generated by the system.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "ScheduledTask": {
      "Type": "ALIYUN::ESS::ScheduledTask",
      "Properties": {
        "TaskEnabled": "true",
        "Description": "scheduledtask",
        "ScheduledTaskName": "task1",
        "LaunchTime": "2014-08-17T16:52Z",
        "RecurrenceEndTime": "2014-08-17T16:55Z",
        "RecurrenceType": "Daily",
        "RecurrenceValue": "1",
        "ScheduledAction": "ari:acs:ess:cn-qingdao:1344371:scalingRule/cCBpdYdQuBe2cUxOdu6piOk"
      }
    }
  },
  "Outputs": {
    "ScheduledTaskId": {
      "Value": {
        "FN::GetAtt": [
          "ScheduledTask",
          "ScheduledTaskId"
        ]
      }
    }
  }
}