All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies

Last Updated:Jun 22, 2026

Template name

ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies: Modifies the billing method for multiple instances in specified instance type families.

Execute Now

Description

Modifies the billing method for multiple Elastic Compute Service (ECS) instances in specified instance type families.

Template type

Automation

Owner

Alibaba Cloud

Parameters

Parameter

Description

Type

Required

Default

Constraints

targets

The ECS instances to modify.

Json

Yes

instanceTypeFamilies

The instance type families to which the billing method change applies.

List

Yes

regionId

The region ID.

String

No

{{ ACS::RegionId }}

instanceChargeType

The target billing method for the instances.

String

No

PostPaid

networkChargeType

The target billing method for the network.

String

No

PayByTraffic

rateControl

The concurrency settings for task execution.

Json

No

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

OOSAssumeRole

The RAM role assumed by OOS to execute this template.

String

No

""

Output parameters

None

Required permissions

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

Details

Details of ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies

Template content

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 }}'