すべてのプロダクト
Search
ドキュメントセンター

CloudOps Orchestration Service:ACS-ECS-InheritDiskTagToSnapshot

最終更新日:Dec 21, 2025

テンプレート名

ACS-ECS-InheritDiskTagToSnapshot は、特定のリージョンにあるすべてのディスクからそのスナップショットにタグを継承します。

今すぐ実行

テンプレートの説明

このテンプレートは、指定されたリージョン内のディスクから対応するスナップショットに、指定されたタグを継承します。

テンプレートタイプ

自動化

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

タイプ

必須

デフォルト値

制限

tagKeys

継承されるタグキー。

リスト

はい

OOSAssumeRole

Operation Orchestration Service (OOS) が引き受ける RAM ロール。

文字列

はい

regionId

リージョン

文字列

いいえ

{{ ACS::RegionId }}

isUpdate

タグ値の上書き

ブール値

いいえ

False

rateControl

タスクの同時実行レート

JSON

いいえ

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

出力パラメーター

なし

テンプレートを実行するために必要な権限ポリシー

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

詳細

詳細については、GitHub の ACS-ECS-InheritDiskTagToSnapshot.yml をご参照ください。

テンプレートコンテンツ

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