Nom du modèle
ACS-ECS-ScheduleToRebootInstancesWithSLR
Description du modèle
Redémarre les instances Elastic Compute Service (ECS) selon une planification définie.
Type de modèle
Automatisé
Propriétaire
Alibaba Cloud
Paramètres d'entrée
|
Paramètre |
Description |
Type |
Obligatoire |
Valeur par défaut |
Limite |
|
timerTrigger |
Type et expression de la tâche planifiée. |
Json |
Oui |
||
|
targets |
Instances ECS cibles à redémarrer. |
Json |
Oui |
||
|
regionId |
ID de la région. |
String |
Non |
{{ ACS::RegionId }} |
|
|
rateControl |
Paramètres de concurrence pour l'exécution des tâches. |
Json |
Non |
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} |
|
|
OOSAssumeRole |
Rôle RAM endossé par CloudOps Orchestration Service (OOS). |
String |
Non |
AliyunServiceRoleForOOSInstanceScheduler |
Paramètres de sortie
|
Paramètre |
Description |
Type |
|
instanceIds |
List |
Politique d'autorisation requise pour exécuter le modèle
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:RebootInstance"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Détails
Détails de ACS-ECS-ScheduleToRebootInstancesWithSLR
Contenu du modèle
FormatVersion: OOS-2019-06-01
Description:
en: Schedules the restart of ECS instances.
name-en: ACS-ECS-ScheduleToRebootInstancesWithSLR
categories:
- time_trigger
Parameters:
regionId:
Type: String
Label:
en: Region ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
timerTrigger:
Type: Json
Label:
en: Timer Trigger
AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
AssociationPropertyMetadata:
MinuteInterval: 30
targets:
Type: Json
Label:
en: Target Instance
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
en: Rate Control
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOS Assume Role
Type: String
Default: AliyunServiceRoleForOOSInstanceScheduler
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers a task on a schedule based on the specified type and expression.
Properties:
Type:
Fn::Select:
- type
- '{{timerTrigger}}'
Expression:
Fn::Select:
- expression
- '{{timerTrigger}}'
StartDate:
Fn::Select:
- startDate
- '{{ timerTrigger }}'
EndDate:
Fn::Select:
- endDate
- '{{ timerTrigger }}'
TimeZone:
Fn::Select:
- timeZone
- '{{ timerTrigger }}'
- Name: getInstance
Description:
en: Retrieves the specified ECS instances.
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: rebootInstance
Action: ACS::ECS::RebootInstance
Description:
en: Restarts the ECS instances.
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
instanceIds:
Type: List
Value: '{{ getInstance.instanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- timerTrigger
Label:
default:
en: Timer Trigger Settings
- Parameters:
- regionId
- targets
Label:
default:
en: Instance Selection
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
en: Advanced Options