ALIYUN::ESS::ScheduledTask is used to create a scheduled task based on specified 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

PropertyTypeRequiredEditableDescriptionConstraint
TaskEnabledBooleanNoYes

Specifies whether to enable the scheduled task.

Valid values:
  • true: enables the task. This is the default value.
  • false: stops the task.
DescriptionStringNoYesThe description of the scheduled task.The description must be 2 to 200 characters in length.
ScheduledTaskNameStringNoYesThe display name of the scheduled task.

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

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

If you do not specify this parameter, the default value is the ID of the scheduled scaling task.

LaunchExpirationTimeIntegerNoYes

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

Valid values: 0 to 21600.

Unit: seconds.

Default value: 600.

LaunchTimeStringYesYes

The time at which the scheduled task is triggered.

Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format.
The time must be in UTC.
  • 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 executed only 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.
RecurrenceEndTimeStringNoYes

The end time of the scheduled task to be repeated.

Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format.

The time must be in UTC.

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.

RecurrenceTypeStringNoYesThe interval at which the scheduled task is repeated.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: The scheduled task is executed based on the specified Cron expression.

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

RecurrenceValueStringNoYesThe recurrence value of the scheduled task to be repeated.
  • Valid values when RecurrenceType is set to Daily: 1 to 31.
  • Valid values when RecurrenceType is set to Weekly: 0 to 6. 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.
  • Valid values when RecurrenceType is set to Monthly: two values ranging from 1 to 31 in the A-B format. B must be greater than or equal to A.
  • Valid values when RecurrenceType is set to Cron: a Cron expression. 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.

ScheduledActionStringYesYes

The operations to be performed when the scheduled task is triggered.

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

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

Response parameters

Fn::GetAtt

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

Examples

  • YAMLformat

    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
  • JSONformat

    {
      "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"
            ]
          }
        }
      }
    }