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

CloudOps Orchestration Service:ACS-ECS-BulkyModifyInstanceNetworkChargeType

最終更新日:Dec 21, 2025

テンプレート名

ACS-ECS-BulkyModifyInstanceNetworkChargeType ECS インスタンスのネットワーク課金タイプの一括変更

今すぐ実行

テンプレートの説明

複数の Elastic Compute Service (ECS)インスタンスのネットワーク課金方法を一度に変更します。

テンプレートタイプ

自動化

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

タイプ

必須

デフォルト値

制限

targets

ターゲットインスタンス

Json

はい

networkChargeType

ECS インスタンスのネットワーク課金方法。

String

はい

regionId

リージョン ID。

String

いいえ

{{ ACS::RegionId }}

maxBandwidthIn

最大インバウンド帯域幅。

String

いいえ

""

maxBandwidthOut

最大アウトバウンド帯域幅。

String

いいえ

""

rateControl

タスク実行の同時実行率

Json

いいえ

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

OOSAssumeRole

CloudOps Orchestration Service (OOS) によってアシュームされる Resource Access Management (RAM) ロール。

String

いいえ

""

出力パラメーター

なし

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

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

詳細

ACS-ECS-BulkyModifyInstanceNetworkChargeType の詳細

テンプレートコンテンツ

FormatVersion: OOS-2019-06-01
Description:
  en: Bulk-modify the network billing method for ECS instances
  name-en: ACS-ECS-BulkyModifyInstanceNetworkChargeType
  categories:
    - instance_manage
Parameters:
  regionId:
    Type: String
    Label:
      en: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: Target Instances
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
  maxBandwidthIn:
    Label:
      en: Maximum inbound public bandwidth
    Type: String
    Default: ""
  maxBandwidthOut:
    Label:
      en: Maximum outbound public bandwidth
    Type: String
    Default: ""
  networkChargeType:
    Label:
      en: Network billing method
    Type: String
    AllowedValues:
      - PayByBandwidth
      - PayByTraffic
  rateControl:
    Label:
      en: Concurrency rate for task execution
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: The RAM role to be assumed by OOS
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
  Description:
    en: Retrieves the specified ECS instances.
  Action: ACS::SelectTargets
  Properties:
    ResourceType: ALIYUN::ECS::Instance
    RegionId: '{{ regionId }}'
    Filters:
      - '{{ targets }}'
  Outputs:
    instanceIds:
      Type: List
      ValueSelector: Instances.Instance[].InstanceId
- Name: modifyInstanceNetworkChargeType
  Action: ACS::ExecuteAPI
  Description:
    en: Modifies the network billing method of the ECS instance.
  Properties:
    Service: ECS
    API: ModifyInstanceNetworkSpec
    Parameters:
      RegionId: '{{ regionId }}'
      InstanceId: '{{ ACS::TaskLoopItem }}'
      NetworkChargeType: '{{ networkChargeType }}'
      InternetMaxBandwidthIn:
        'Fn::If':
          - 'Fn::Equals':
              - ""
              - '{{ maxBandwidthIn }}'
          - Null
          - '{{ maxBandwidthIn }}'
      InternetMaxBandwidthOut:
        'Fn::If':
          - 'Fn::Equals':
              - ""
              - '{{ maxBandwidthOut }}'
          - Null
          - '{{ maxBandwidthOut }}'
  Loop:
    RateControl: '{{ rateControl }}'
    Items: '{{ getInstance.instanceIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - maxBandwidthIn
          - maxBandwidthOut
          - networkChargeType
        Label:
          default:
            en: Configure Parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            en: Select ECS Instances
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            en: Advanced Options