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

CloudOps Orchestration Service:ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies

最終更新日:Jun 23, 2026

テンプレート名

ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies: 指定したインスタンスタイプファミリーに属する、複数のインスタンスの課金方法を変更します。

今すぐ実行

説明

指定したインスタンスタイプファミリーに属する、複数の Elastic Compute Service (ECS) インスタンスの課金方法を変更します。

テンプレートタイプ

自動化

所有者

Alibaba Cloud

パラメーター

パラメーター

説明

タイプ

必須

デフォルト

制約

targets

変更する ECS インスタンス。

Json

はい

instanceTypeFamilies

課金方法を変更するインスタンスタイプファミリー。

List

はい

regionId

リージョン ID。

String

いいえ

{{ ACS::RegionId }}

instanceChargeType

変更先のインスタンス課金方法。

String

いいえ

PostPaid

networkChargeType

変更先のネットワーク課金方法。

String

いいえ

PayByTraffic

rateControl

タスク実行の同時実行設定。

Json

いいえ

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

OOSAssumeRole

CloudOps Orchestration Service (OOS) がこのテンプレートを実行する際に引き受ける RAM ロール。

String

いいえ

""

出力パラメーター

なし

必要な権限

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:ModifyInstanceChargeType",
                "ecs:ModifyInstanceNetworkSpec"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "oos:GetApplicationGroup"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

詳細

ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies の詳細

テンプレートの内容

FormatVersion: OOS-2019-06-01
Description:
  en: >-
    Modifies the billing method in bulk for instances that belong to specified
    instance type families.
  zh-cn: 批量修改指定实例规格族下实例的计费方式
  name-en: ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies
  name-zh-cn: 批量修改指定实例规格族下实例的计费方式
  categories:
    - instance_manage
Parameters:
  regionId:
    Label:
      en: Region ID
      zh-cn: 地域ID
    Type: String
    Description:
      en: The ID of the region.
      zh-cn: 地域ID。
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Label:
      en: Target Instances
      zh-cn: 目标实例
    Type: Json
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  instanceChargeType:
    Label:
      en: Instance Billing Method
      zh-cn: 实例计费方式
    Description:
      en: The target billing method for the instances.
      zh-cn: 实例需要修改的目标计费方式。
    Type: String
    AllowedValues:
      - PostPaid
      - PrePaid
    Default: PostPaid
  networkChargeType:
    Label:
      en: Network Billing Method
      zh-cn: 网络计费方式
    Description:
      en: The target billing method for the network.
      zh-cn: 网络需要修改的目标计费方式。
    Type: String
    AllowedValues:
      - PayByBandwidth
      - PayByTraffic
    Default: PayByTraffic
  instanceTypeFamilies:
    Label:
      en: Instance Type Families
      zh-cn: 实例规格族
    Description:
      en: >-
        The instance type families. This action applies only to instances that
        belong to the specified families.
      zh-cn: 要修改付费方式的ECS实例对应的实例规格族
    Type: List
  rateControl:
    Label:
      en: Rate Control
      zh-cn: 任务执行的并发设置
    Description:
      en: The concurrency settings for the task execution.
      zh-cn: 任务执行的并发设置。
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOS Assume Role
      zh-cn: OOS扮演的RAM角色
    Description:
      en: The RAM role that OOS assumes.
      zh-cn: OOS扮演的RAM角色。
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Gets the target ECS instances.
      zh-cn: 获取ECS实例。
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'
  - Name: modifyInstanceChargeTypeByInstanceTypeFamily
    Description:
      en: Modifies the billing method for instances in the specified instance type families.
      zh-cn: 修改指定实例规格族下实例的计费方式。
    Action: 'ACS::ECS::ModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies'
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      instanceChargeType: '{{ instanceChargeType }}'
      networkChargeType: '{{ networkChargeType }}'
      instanceTypeFamilies: '{{ instanceTypeFamilies }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ getInstance.instanceIds }}'