ACS-ECS-ScheduleToUpgradeInternetBandwidthNew

更新时间:2024-09-05 05:40:18

模板名称

ACS-ECS-ScheduleToUpgradeInternetBandwidthNew 定时升级ECS实例临时带宽

立即执行

模板描述

定时升级ECS实例临时带宽

模板类型

自动化

所有者

Alibaba Cloud

输入参数

参数名称

描述

类型

是否必填

默认值

约束

参数名称

描述

类型

是否必填

默认值

约束

targets

目标实例

Json

timerTrigger

定时类型

Json

regionId

地域ID

String

{{ ACS::RegionId }}

maxBandwidthOut

公网最大出带宽

Number

10

durationHour

带宽升级持续时间

Number

4

rateControl

任务执行的并发比率

Json

{‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10}

OOSAssumeRole

OOS扮演的RAM角色

String

AliyunServiceRoleForOOSBandwidthScheduler

输出参数

执行此模板需要的权限策略

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

详情

ACS-ECS-ScheduleToUpgradeInternetBandwidthNew详情

模板内容

FormatVersion: OOS-2019-06-01
Description:
  en: Schedule to upgrades internet bandwidth for ECS instances
  zh-cn: 定时升级ECS实例临时带宽
  name-en: ACS-ECS-ScheduleToUpgradeInternetBandwidthNew
  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
  timerTrigger:
    Type: Json
    Label:
      en: TimerTrigger
      zh-cn: 定时类型
    AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
    AssociationPropertyMetadata:
      MinuteInterval: 30
  maxBandwidthOut:
    Label:
      en: The maximum public network bandwidth for out-direction
      zh-cn: 公网最大出带宽
    Description:
      en: 'Unit: Mbit/s, range:0~100'
      zh-cn: 单位:Mbit/s, 取值范围:0~100
    Type: Number
    MinValue: 0
    MaxValue: 100
    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: The RAM role to be assumed by OOS
      zh-cn: OOS扮演的RAM角色
    Type: String
    Default: AliyunServiceRoleForOOSBandwidthScheduler
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
  Action: ACS::TimerTrigger
  Description:
    en: Triggers a task as scheduled by specifying type and expression
    zh-cn: 通过指定触发类型和表达式按计划触发任务
  Properties:
    Type:
      Fn::Select:
        - type
        - '{{timerTrigger}}'
    Expression:
      Fn::Select:
        - expression
        - '{{timerTrigger}}'
    EndDate:
      Fn::Select:
        - endDate
        - '{{ timerTrigger }}'
    TimeZone:
      Fn::Select:
        - timeZone
        - '{{ timerTrigger }}'
- 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 }}'
      InternetMaxBandwidthOut: '{{ maxBandwidthOut }}'
      EndTime:
        Fn::FormatUTCTime:
          - Fn::AddHour:
              - '{{ ACS::CurrentUTCTime }}'
              - '{{ durationHour }}'
          - '%Y-%m-%dT%HZ'
  Loop:
    RateControl: '{{ rateControl }}'
    Items: '{{ getInstance.instanceIds }}'

  • 本页导读 (1)
  • 模板名称
  • 模板描述
  • 模板类型
  • 所有者
  • 输入参数
  • 输出参数
  • 执行此模板需要的权限策略
  • 详情
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等