Nom du modèle
ACS-ECS-ScheduleToBulkyCreateSnapshot : création planifiée de snapshots par lot
Description du modèle
Crée des snapshots pour plusieurs disques simultanément, 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
|
Planification de la tâche
|
Json
|
Oui
| | | |
diskIds
|
ID des disques pour lesquels créer des snapshots
|
List
|
Oui
| | | |
regionId
|
ID de la région
|
String
|
Non
|
{{ ACS::RegionId }}
| | |
retentionDays
|
Durée de conservation des snapshots
|
Number
|
Non
|
0
| | |
tags
|
Tags à ajouter aux snapshots
|
Json
|
Non
|
[]
| | |
rateControl
|
Paramètres de contrôle du débit pour l'exécution concurrente
|
Json
|
Non
|
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}
| | |
OOSAssumeRole
|
Rôle RAM endossé par OOS
|
String
|
Non
|
OOSServiceRole
| |
Paramètres de sortie
|**Paramètre**
|
**Description**
|
**Type**
| | --- | --- | --- | |
createdSnapshotIds
| |
List
|
Stratégie d'autorisation requise pour exécuter le modèle
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateSnapshot",
"ecs:DescribeDisks",
"ecs:DescribeInstances",
"ecs:DescribeSnapshots"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Détails
Pour plus d'informations, consultez le fichier ACS-ECS-ScheduleToBulkyCreateSnapshot.yml sur GitHub.
Contenu du modèle
FormatVersion: OOS-2019-06-01
Description:
en: Schedules the batch creation of snapshots.
name-en: ACS-ECS-ScheduleToBulkyCreateSnapshot
Parameters:
regionId:
Label:
en: Region ID
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
timerTrigger:
Type: Json
Label:
en: Schedule
AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
AssociationPropertyMetadata:
MinuteInterval: 30
diskIds:
Label:
en: Disk IDs
AssociationProperty: ALIYUN::ECS::Disk::DiskId
AssociationPropertyMetadata:
RegionId: regionId
Type: List
retentionDays:
Label:
en: Retention Period (Days)
Description:
en: The retention period of the snapshots, in days. After the retention period expires, the snapshots are automatically released. A value of 0 indicates that the snapshots are not automatically released.
Type: Number
MaxValue: 65536
MinValue: 0
Default: 0
tags:
Label:
en: Snapshot Tags
Type: Json
AssociationProperty: Tags
AssociationPropertyMetadata:
ShowSystem: false
Default: []
rateControl:
Label:
en: Concurrency Control
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: RAM Role for OOS
Type: String
Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers the task on a schedule.
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: createSnapshot
Action: ACS::ECS::CreateSnapshot
Description:
en: Creates a snapshot for a disk.
Properties:
regionId: '{{ regionId }}'
diskId: '{{ ACS::TaskLoopItem }}'
retentionDays:
Fn::If:
- Fn::Equals:
- '{{ retentionDays }}'
- 0
- ''
- '{{ retentionDays }}'
tags: '{{ tags }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ diskIds }}'
Outputs:
snapshotIds:
AggregateType: Fn::ListJoin
AggregateField: snapshotId
Outputs:
createdSnapshotIds:
Type: List
Value: '{{ createSnapshot.snapshotIds }}'