Nom du modèle
ACS-ECS-BulkyDeleteExpiredSnapshot : supprime les snapshots expirés par lots.
Description du modèle
Supprime les snapshots expirés par lots.
Type de modèle
Automatisation
Propriétaire
Alibaba Cloud
Paramètres d'entrée
|**Nom du paramètre**
|
**Description**
|
**Type**
|
**Obligatoire**
|
**Valeur par défaut**
|
**Contraintes**
| | --- | --- | --- | --- | --- | --- | |
expiredDays
|
Délai d'expiration des snapshots (en jours).
|
Number
|
Oui
| | | |
regionId
|
ID de la région.
|
String
|
Non
|
{{ ACS::RegionId }}
| | |
force
|
Force la suppression des snapshots.
|
Boolean
|
Non
|
False
| | |
snapshotName
|
Nom utilisé pour filtrer les snapshots.
|
String
|
Non
| | | |
tags
|
Tags des snapshots.
|
Json
|
Non
|
[]
| | |
rateControl
|
Taux de concurrence pour l'exécution des tâches.
|
Json
|
Non
|
{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10}
| | |
OOSAssumeRole
|
Rôle RAM endossé par OOS.
|
String
|
Non
|
“”
| |
Paramètres de réponse
|**Nom du paramètre**
|
**Description**
|
**Type**
| | --- | --- | --- | |
deletedSnapshotIds
| |
List
|
Politique d'accès requise pour ce modèle
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DeleteSnapshot",
"ecs:DescribeSnapshots"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Détails
Pour plus d'informations, consultez les détails ACS-ECS-BulkyDeleteExpiredSnapshot.
Contenu du modèle
FormatVersion: OOS-2019-06-01
Description:
en: Bulky delete expired snapshot
name-en: ACS-ECS-BulkyDeleteExpiredSnapshot
categories:
- data_backup
Parameters:
regionId:
Label:
en: RegionId
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
force:
Label:
en: Forced deletion of Snapshot
Type: Boolean
Default: false
expiredDays:
Label:
en: Snapshot Expiration Days
Type: Number
snapshotName:
Label:
en: Name Field Used To Filter Snapshot
Type: String
Default: " "
tags:
Label:
en: Snapshot Tags
Type: Json
AssociationProperty: Tags
AssociationPropertyMetadata:
ShowSystem: false
Default: [ ]
rateControl:
Label:
en: Rate Control
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: describeSnapshots
Action: 'ACS::ExecuteAPI'
Description:
en: Get the snapshots
Properties:
Service: ECS
API: DescribeSnapshots
Parameters:
RegionId: '{{ regionId }}'
Tags: '{{ tags }}'
Filter2Key: CreationEndTime
Filter2Value:
'Fn::FormatUTCTime':
- 'Fn::AddHour':
- '{{ ACS::CurrentUTCTime }}'
- "Fn::Eval":
- '-{{ expiredDays }}*24'
- '%Y-%m-%dT00:00Z'
Outputs:
snapshotIds:
Type: List
ValueSelector: '.Snapshots.Snapshot[] | select( .SnapshotName | test("{{snapshotName}}")) | .SnapshotId'
- Name: deleteSnapshots
Action: 'ACS::ExecuteAPI'
Description:
en: Delete the snapshots
Properties:
Service: ECS
API: DeleteSnapshot
Parameters:
RegionId: '{{ regionId }}'
SnapshotId: '{{ ACS::TaskLoopItem }}'
Force: '{{ force }}'
Loop:
Items: '{{ describeSnapshots.snapshotIds }}'
RateControl: '{{ rateControl }}'
Outputs:
deletedSnapshotIds:
Type: List
Value: '{{ describeSnapshots.snapshotIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- expiredDays
- snapshotName
- tags
- force
Label:
default:
en: Configure Parameters
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
en: Control Options