Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-InheritDiskTagToSnapshot

Dernière mise à jour :Aug 11, 2026

Nom du modèle

Le modèle ACS-ECS-InheritDiskTagToSnapshot hérite des tags de tous les disques vers leurs snapshots dans une région spécifiée.

Execute Now

Description du modèle

Hérite des tags de disque spécifiés vers les snapshots correspondants dans une région.

Type de modèle

Automatisé

Propriétaire

Alibaba Cloud

Paramètres d'entrée

Paramètre

Description

Type

Obligatoire

Valeur par défaut

Limite

tagKeys

Clés de tag à hériter.

List

Oui

OOSAssumeRole

Rôle RAM endossé par OOS.

String

Oui

regionId

Région cible.

String

Non

{{ ACS::RegionId }}

isUpdate

Écraser les valeurs de tag existantes.

Boolean

Non

False

rateControl

Taux de concurrence d'exécution des tâches.

Json

Non

{'Mode': 'Concurrency', 'MaxErrors': 100, 'Concurrency': 10}

Paramètres de sortie

Aucun

Autorisations requises

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeDisks",
                "ecs:DescribeSnapshots",
                "ecs:TagResources"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Détails

Source du modèle : ACS-ECS-InheritDiskTagToSnapshot.yml sur GitHub.

Contenu du modèle

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