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

CloudOps Orchestration Service:ACS-ECS-ScheduleToUpgradeInternetBandwidth

最終更新日:Jan 17, 2025

テンプレート名

ACS-ECS-ScheduleToUpgradeInternetBandwidth

今すぐ実行

テンプレートの説明

スケジュールに従って、複数の Elastic Compute Service (ECS) インスタンスの帯域幅を一時的にアップグレードします。

テンプレートタイプ

自動化

所有者

Alibaba Cloud

入力パラメーター

パラメーター

説明

タイプ

必須

デフォルト値

制限

targets

帯域幅を一時的にアップグレードする ECS インスタンス。

Json

はい

regionId

リージョン ID。

String

いいえ

{{ ACS::RegionId }}

triggerCron

帯域幅アップグレードタスクを実行する間隔。

String

いいえ

0 0 12 ? * *

triggerEndDate

定期実行の終了時間。

String

いいえ

2025-12-31T15:59:59Z

timeZone

スケジュールされた実行のタイムゾーン。

String

いいえ

UTC

maxBandwidthIn

パブリックインバウンドトラフィックの最大帯域幅。

Number

いいえ

10

maxBandwidthOut

パブリックアウトバウンドトラフィックの最大帯域幅。

Number

いいえ

10

durationHour

帯域幅アップグレードの期間。

Number

いいえ

4

rateControl

レート制御設定。

Json

いいえ

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

OOSAssumeRole

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

String

いいえ

OOSServiceRole

出力パラメーター

なし

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

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

参照

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

テンプレートコンテンツ

FormatVersion: OOS-2019-06-01
Description:
  en: Schedule to upgrades internet bandwidth for ECS instances
  zh-cn: ECS インスタンスのインターネット帯域幅をアップグレードするスケジュール
  name-en: ACS-ECS-ScheduleToUpgradeInternetBandwidth
  name-zh-cn: ECS インスタンスの一時的な帯域幅のスケジュールされたアップグレード
  categories:
    - time_trigger
Parameters:
  regionId:
    Type: String
    Label:
      en: The id of region
      zh-cn: リージョンの ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: TargetInstance
      zh-cn: ターゲットインスタンス
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: ALIYUN::ECS::Instance
      RegionId: regionId
      InternetChargeType: PayByBandwidth
      ChargeType: PrePaid
  triggerCron:
    Label:
      en: 'The schedule of bandwidth upgrade task'
      zh-cn: 帯域幅アップグレードタスクのスケジュール
    Type: String
    AssociationProperty: Cron
    Default: 0 0 12 ?  * *
  triggerEndDate:
    Label:
      en: 'The end date of bandwidth upgrade task'
      zh-cn: 帯域幅アップグレードタスクの終了日
    Type: String
    AssociationProperty: DateTime
    AssociationPropertyMetadata:
      Format: 'YYYY-MM-DDTHH:mm:ssZ'
    Default: '2025-12-31T15:59:59Z'
  timeZone:
    Label:
      en: The time zone of schedule
      zh-cn: スケジュールのタイムゾーン
    Type: String
    AssociationProperty: TimeZone
    Default: UTC
  maxBandwidthIn:
    Label:
      en: The maximum public network bandwidth for in-direction
      zh-cn: 受信方向の最大パブリックネットワーク帯域幅
    Description:
      en: 'Unit: Mbit/s (Megabit per second), range: 1~10 when maxBandwidthOut<=10Mbit/s, else 1~maxBandwidthOut'
      zh-cn: 単位: Mbit/s (メガビット/秒)、範囲: maxBandwidthOut<=10Mbit/s の場合は 1~10、それ以外の場合は 1~maxBandwidthOut
    Type: Number
    MinValue: 1
    Default: 10
  maxBandwidthOut:
    Label:
      en: The maximum public network bandwidth for out-direction
      zh-cn: 送信方向の最大パブリックネットワーク帯域幅
    Description:
      en: <p>Unit: Mbit/s (Megabit per second). Value range: 0 to 100. OOS does not validate the maxBandwidthOut parameter value. <br/><font color='red'>If the value exceeded the limit of ECS, bandwidth upgrade task will fail. You can submit a ticket to ECS to raise the maximum bandwidth or modify the bandwidth parameter in limit range.</font></p>
      zh-cn: <p>単位: Mbit/s (メガビット/秒)。値の範囲: 0~100。OOS は maxBandwidthOut パラメーター値を検証しません。<br/><font color='red'>値が ECS の制限を超えた場合、帯域幅のアップグレードタスクは失敗します。最大帯域幅を引き上げるために ECS にチケットを送信するか、制限範囲内で帯域幅パラメーターを変更できます。</font></p>
    Type: Number
    MinValue: 0
    Default: 10
  durationHour:
    Label:
      en: The number of hours that the bandwidth upgrade lasts
      zh-cn: 帯域幅のアップグレードが続く時間数
    Description:
      zh-cn: 単位: 時間。帯域幅のアップグレードは少なくとも 4 時間続く必要があります。アップグレードは時間単位でのみ終了します。
      en: 'Unit: Hour. The bandwidth upgrade should last at least 4 hours. Upgrade only ends on the hour'
    Type: Number
    MinValue: 4
    Default: 4
  rateControl:
    Label:
      en: RateControl
      zh-cn: レート制御
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOSAssumeRole
    Type: String
    Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
  Action: ACS::TimerTrigger
  Description:
    en: Triggers a task as scheduled by specifying Cron expression
    zh-cn: Cron 式を指定して、スケジュールに従ってタスクをトリガーします
  Properties:
    Type: cron
    Expression: '{{ triggerCron }}'
    EndDate: '{{ triggerEndDate }}'
    TimeZone: '{{ timeZone }}'
- Name: getInstance
  Description:
    en: Views the 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: modifyInstanceNetworkSpec
  Action: ACS::ExecuteAPI
  Description:
    en: Modifies the temporary bandwidth of the instances
    zh-cn: インスタンスの一時的な帯域幅を変更します
  Properties:
    Service: ECS
    API: ModifyInstanceNetworkSpec
    Parameters:
      RegionId: '{{ regionId }}'
      InstanceId: '{{ ACS::TaskLoopItem }}'
      InternetMaxBandwidthIn: '{{ maxBandwidthIn }}'
      InternetMaxBandwidthOut: '{{ maxBandwidthOut }}'
      EndTime:
        Fn::FormatUTCTime:
          - Fn::AddHour:
              - '{{ ACS::CurrentUTCTime }}'
              - '{{ durationHour }}'
          - '%Y-%m-%dT%HZ'
  Loop:
    RateControl: '{{ rateControl }}'
    Items: '{{ getInstance.instanceIds }}'