Nama template
Template ACS-ECS-InheritDiskTagToSnapshot mewariskan tag dari semua disk ke Snapshot-nya di Wilayah tertentu.
Deskripsi template
Template ini mewariskan tag yang ditentukan dari disk ke Snapshot yang sesuai di Wilayah yang ditentukan.
Tipe template
Otomatis
Pemilik
Alibaba Cloud
Parameter input
Parameter | Deskripsi | Tipe | Diperlukan | Nilai default | Batasan |
tagKeys | Kunci tag yang akan diwarisi. | Daftar | Ya | ||
OOSAssumeRole | Peran RAM untuk Operation Orchestration Service (OOS) untuk mengasumsikan. | String | Ya | ||
regionId | Region | String | Tidak | {{ ACS::RegionId }} | |
isUpdate | Overwriting tag values | Boolean | Tidak | Salah | |
rateControl | Concurrent Task Execution Rate | Json | Tidak | {'Mode': 'Concurrency', 'MaxErrors': 100, 'Concurrency': 10} |
Parameter Keluaran
Tidak ada
Kebijakan izin yang diperlukan untuk mengeksekusi template
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeDisks",
"ecs:DescribeSnapshots",
"ecs:TagResources"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detail
Untuk informasi lebih lanjut, lihat ACS-ECS-InheritDiskTagToSnapshot.yml di GitHub.
Konten Template
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS-ECS-InheritDiskTagToSnapshot
name-zh-cn: Inherits all disk tags in a region to snapshots
en: All snapshots in the specified region inherit the specified tag on the corresponding disk.
zh-cn: All snapshots in a specified region inherit the specified tags from their corresponding disks.
categories:
- tag_manage
Parameters:
regionId:
Type: String
Description:
en: The id of region
zh-cn: The ID of the region
Label:
en: Region
zh-cn: Region
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
tagKeys:
Type: List
Description:
en: The list of tag key
zh-cn: The collection of tag keys
Label:
en: TagKeys
zh-cn: List of tag keys to inherit
isUpdate:
Type: Boolean
Label:
en: IsUpdate
zh-cn: Overwrite tag value
Description:
en: Whether to overwrite the tag value if the tag key is the same
zh-cn: If a tag with the same key exists, specifies whether to overwrite the tag value
Default: false
rateControl:
Label:
en: RateControl
zh-cn: Concurrency rate for task execution
Description:
en: Concurrency rate of task execution
zh-cn: Concurrency rate of task execution
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 100
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: The RAM role for OOS to assume
Description:
name-en: The RAM role to be assumed by OOS.
name-zh-cn: The RAM role for OOS to assume.
Type: String
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getDisks
Action: ACS::ExecuteAPI
Description:
en: Query the disk information
zh-cn: Queries disk information
Properties:
Service: ECS
API: DescribeDisks
Parameters:
RegionId: '{{ regionId }}'
Outputs:
disks:
Type: List
ValueSelector: .Disks.Disk[].DiskId
- Name: tagSnapshot
Action: ACS::ECS::InheritDiskTagToSnapshot
Description:
en: Inherit the specified disk tags to snapshots
zh-cn: Inherits tags from the specified disk to its snapshots
Properties:
regionId: '{{ regionId }}'
diskId: '{{ACS::TaskLoopItem}}'
tagKeys: '{{tagKeys}}'
isUpdate: '{{isUpdate}}'
rateControl: '{{rateControl}}'
Loop:
RateControl: '{{rateControl}}'
Items: '{{getDisks.disks}}'
Outputs:
tagResult:
AggregateType: Fn::ListJoin
AggregateField: reqResult