Nama templat
ACS-ECS-BulkyDeleteExpiredSnapshot: Menghapus snapshot kedaluwarsa secara batch.
Deskripsi templat
Menghapus snapshot kedaluwarsa secara batch.
Jenis templat
Automation
Pemilik
Alibaba Cloud
Parameter input
|
Nama parameter |
Deskripsi |
Tipe |
Wajib |
Nilai default |
Batasan |
|
expiredDays |
Jumlah hari setelah snapshot dianggap kedaluwarsa. |
Number |
Yes |
||
|
regionId |
ID wilayah. |
String |
No |
{{ ACS::RegionId }} |
|
|
force |
Apakah akan memaksa penghapusan snapshot. |
Boolean |
No |
False |
|
|
snapshotName |
Nama yang digunakan untuk memfilter snapshot. |
String |
No |
||
|
tags |
Tag dari snapshot. |
Json |
No |
[] |
|
|
rateControl |
Laju konkurensi untuk eksekusi task. |
Json |
No |
{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10} |
|
|
OOSAssumeRole |
Peran RAM yang diasumsikan oleh OOS. |
String |
No |
“” |
Parameter respons
|
Nama parameter |
Deskripsi |
Tipe |
|
deletedSnapshotIds |
List |
Kebijakan akses yang diperlukan untuk templat ini
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DeleteSnapshot",
"ecs:DescribeSnapshots"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detail
Untuk informasi lebih lanjut, lihat detail ACS-ECS-BulkyDeleteExpiredSnapshot.
Konten templat
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