Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-ScheduleToStartInstances

Dernière mise à jour :Aug 11, 2026

Nom du modèle

ACS-ECS-ScheduleToStartInstances : Démarrer des instances ECS selon une planification

Exécuter maintenant

Description du modèle

Démarre des instances Elastic Compute Service (ECS) selon une planification. Utilisez ce modèle pour démarrer automatiquement des environnements de développement ou de test à une heure spécifique. Spécifiez l'ID de région (regionId), une expression cron (cron) pour définir la planification et les instances cibles (targets) à démarrer.

Type de modèle

Automatisé

Propriétaire

Alibaba Cloud

Paramètres d'entrée

Paramètre

Description

Type

Obligatoire

Valeur par défaut

Limite

endDate

L'heure de fin de la tâche planifiée.

String

Oui

targets

Les instances ECS cibles à démarrer.

Json

Oui

regionId

L'ID de région.

String

Non

{{ ACS::RegionId }}

cron

L'expression CRON.

String

Non

0 0 12 ?

timeZone

Le fuseau horaire.

String

Non

UTC

rateControl

Les paramètres de concurrence pour l'exécution des tâches.

Json

Non

{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}

OOSAssumeRole

Le rôle RAM assumé par OOS.

String

Non

OOSServiceRole

Paramètres de sortie

Paramètre

Description

Type

instanceIds

List

Autorisations requises

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:StartInstance"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Détails

Pour plus d'informations, consultez ACS-ECS-ScheduleToStartInstances.

Contenu du modèle

FormatVersion: OOS-2019-06-01
Description:
  en: 'Starts ECS instances on a schedule. Use this template to start instances at a specific time, such as automatically starting development or test environments. You must provide the region ID (regionId), a cron expression (cron), and the target instances (targets). The template then starts the specified instances according to the schedule.'
  zh-cn: 'Starts ECS instances on a schedule. Use this template to start instances at a specific time, such as automatically starting development or test environments. You must provide the region ID (regionId), a cron expression (cron), and the target instances (targets). The template then starts the specified instances according to the schedule.'
  name-en: ACS-ECS-ScheduleToStartInstances
  name-zh-cn: Start ECS instances on a schedule
  categories:
    - time_trigger
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  cron:
    Description:
      en: 'For more information, see https://www.alibabacloud.com/help/document_detail/169784.html'
      zh-cn: 'For more information, see https://www.alibabacloud.com/help/document_detail/169784.html'
    Label:
      en: CronExpression
      zh-cn: Cron expression
    Type: String
    AssociationProperty: Cron
    Default: 0 0 12 ? * *
  endDate:
    Description:
      en: 'Format: yyyy-MM-ddTHH:mm:ssZ.'
      zh-cn: 'Format: yyyy-MM-ddTHH:mm:ssZ'
    Label:
      en: EndDate
      zh-cn: End time of the trigger
    Type: String
    AssociationProperty: DateTime
    AssociationPropertyMetadata:
      Format: 'YYYY-MM-DDTHH:mm:ssZ'
  timeZone:
    Label:
      en: TimeZone
      zh-cn: Time zone
    Type: String
    AssociationProperty: TimeZone
    Default: UTC
  targets:
    Type: Json
    Label:
      en: TargetInstance
      zh-cn: Target instances
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  rateControl:
    Label:
      en: RateControl
      zh-cn: Concurrency rate for task execution
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: The RAM role assumed by OOS
    Type: String
    Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
  Action: ACS::TimerTrigger
  Description:
    en: Triggers a task on a schedule by specifying the trigger type and expression.
    zh-cn: Triggers a task on a schedule by specifying the trigger type and expression.
  Properties:
    Type: cron
    Expression: '{{ cron }}'
    EndDate: '{{ endDate }}'
    TimeZone: '{{ timeZone }}'
- Name: getInstance
  Description:
    en: Gets the ECS instances.
    zh-cn: Gets the ECS instances.
  Action: ACS::SelectTargets
  Properties:
    ResourceType: ALIYUN::ECS::Instance
    RegionId: '{{ regionId }}'
    Filters:
      - '{{ targets }}'
  Outputs:
    instanceIds:
      Type: List
      ValueSelector: Instances.Instance[].InstanceId
- Name: startInstance
  Action: ACS::ECS::StartInstance
  Description:
    en: Starts the ECS instances.
    zh-cn: Starts the instances.
  Properties:
    regionId: '{{ regionId }}'
    instanceId: '{{ ACS::TaskLoopItem }}'
  Loop:
    RateControl: '{{ rateControl }}'
    Items: '{{ getInstance.instanceIds }}'
Outputs:
  instanceIds:
    Type: List
    Value: '{{ getInstance.instanceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - timeZone
          - cron
          - endDate
        Label:
          default:
            zh-cn: Timer settings
            en: Timer Trigger Configure
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: Select instances
            en: Select ECS Instances
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced options
            en: Control Options