Nama template
ACS-ECS-ScheduleToUpgradeInternetBandwidthNew: Menjadwalkan peningkatan sementara bandwidth Internet untuk sebuah Instance ECS.
Deskripsi template
Sementara meningkatkan bandwidth untuk beberapa instance Elastic Compute Service (ECS) sesuai jadwal.
Tipe template
Otomatis
Pemilik
Alibaba Cloud
Parameter masukan
Parameter | Deskripsi | Tipe | Diperlukan | Nilai default | Batasan |
targets | Target instance | Json | Ya | ||
timerTrigger | Jenis jadwal | Json | Ya | ||
regionId | ID wilayah. | String | Tidak | {{ ACS::RegionId }} | |
maxBandwidthOut | Bandwidth publik maksimum arah keluar. | Number | Tidak | 10 | |
durationHour | Durasi peningkatan bandwidth, dalam jam. | Number | Tidak | 4 | |
rateControl | Laju eksekusi tugas konkuren | Json | Tidak | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | Peran RAM yang diasumsikan oleh CloudOps Orchestration Service (OOS). | String | Tidak | AliyunServiceRoleForOOSBandwidthScheduler |
Parameter Keluaran
Tidak ada
Kebijakan izin yang diperlukan untuk mengeksekusi template
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:ModifyInstanceNetworkSpec"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detail
Detail ACS-ECS-ScheduleToUpgradeInternetBandwidthNew
Konten Template
FormatVersion: OOS-2019-06-01
Description:
en: Schedules a temporary bandwidth upgrade for ECS instances.
zh-cn: Schedules a temporary bandwidth upgrade for ECS instances.
name-en: ACS-ECS-ScheduleToUpgradeInternetBandwidthNew
name-zh-cn: Schedules a temporary bandwidth upgrade for ECS instances.
categories:
- time_trigger
Parameters:
regionId:
Type: String
Label:
en: The ID of the region.
zh-cn: The ID of the region.
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: Target instances
zh-cn: Target instances
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: ALIYUN::ECS::Instance
RegionId: regionId
InternetChargeType: PayByBandwidth
ChargeType: PrePaid
timerTrigger:
Type: Json
Label:
en: Timer trigger
zh-cn: Timer trigger type
AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
AssociationPropertyMetadata:
MinuteInterval: 30
maxBandwidthOut:
Label:
en: The maximum outbound public bandwidth.
zh-cn: The maximum outbound public bandwidth.
Description:
en: 'Unit: Mbit/s. Valid values: 0 to 100.'
zh-cn: 'Unit: Mbit/s. Valid values: 0 to 100.'
Type: Number
MinValue: 0
MaxValue: 100
Default: 10
durationHour:
Label:
en: The duration of the bandwidth upgrade, in hours.
zh-cn: The duration of the bandwidth upgrade, in hours.
Type: Number
MinValue: 4
MaxValue: 10000
Default: 4
AssociationProperty: ALIYUN::OOS::Component::BandwidthUpgradeDurationHour
AssociationPropertyMetadata:
TimerTrigger: '${timerTrigger}'
rateControl:
Label:
en: Rate control
zh-cn: The concurrency rate for the task execution.
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: The RAM role that OOS assumes.
zh-cn: The RAM role that OOS assumes.
Type: String
Default: AliyunServiceRoleForOOSBandwidthScheduler
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers the task based on the specified schedule.
zh-cn: Triggers the task based on the specified schedule.
Properties:
Type:
Fn::Select:
- type
- '{{timerTrigger}}'
Expression:
Fn::Select:
- expression
- '{{timerTrigger}}'
StartDate:
Fn::Select:
- startDate
- '{{ timerTrigger }}'
EndDate:
Fn::Select:
- endDate
- '{{ timerTrigger }}'
TimeZone:
Fn::Select:
- timeZone
- '{{ timerTrigger }}'
- Name: getInstance
Description:
en: Gets the specified ECS instances.
zh-cn: Gets 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: modifyInstanceNetworkSpec
Action: ACS::ExecuteAPI
Description:
en: Temporarily modifies the bandwidth of the instances.
zh-cn: Temporarily modifies the bandwidth of the instances.
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 }}'