All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies

Last Updated:Jun 23, 2026

Nama Templat

ACS-ECS-BulkyModifyInstanceChargeTypeSpecifiedInstanceTypeFamilies: Mengubah metode penagihan untuk beberapa instans dalam keluarga tipe instans tertentu.

Execute Now

Description

Mengubah metode penagihan untuk beberapa instans Elastic Compute Service (ECS) dalam keluarga tipe instans yang ditentukan.

Template type

Automation

Owner

Alibaba Cloud

Parameters

Parameter

Description

Type

Required

Default

Constraints

targets

Instance ECS yang akan diubah.

Json

Yes

instanceTypeFamilies

Keluarga tipe instans tempat perubahan metode penagihan berlaku.

List

Yes

regionId

ID wilayah.

String

No

{{ ACS::RegionId }}

instanceChargeType

Metode penagihan target untuk instans.

String

No

PostPaid

networkChargeType

Metode penagihan target untuk jaringan.

String

No

PayByTraffic

rateControl

Pengaturan konkurensi untuk eksekusi task.

Json

No

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

OOSAssumeRole

Peran RAM yang diasumsikan oleh OOS untuk menjalankan templat ini.

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