Nama Template
ACS-ECS-ScheduleToStartInstances: Mulai instance ECS sesuai jadwal
Deskripsi Template
Memulai instance Elastic Compute Service (ECS) sesuai jadwal. Gunakan templat ini untuk menjalankan instance pada waktu tertentu—misalnya, secara otomatis memulai lingkungan pengembangan atau pengujian selama periode tertentu. Saat mengonfigurasi templat, Anda harus memberikan parameter yang diperlukan: regionId menentukan wilayah tempat instance berada, cron mendefinisikan jadwal tugas menggunakan ekspresi cron, dan targets menentukan instance ECS yang akan dimulai. Templat kemudian menjalankan instance tersebut sesuai jadwal yang ditentukan.
Tipe Template
Otomatis
Pemilik
Alibaba Cloud
Parameter masukan
Parameter | Deskripsi | Tipe | Diperlukan | Nilai Default | Batasan |
endDate | Waktu akhir dari tugas terjadwal. | String | Ya | ||
targets | Instance target | Json | Ya | ||
regionId | ID wilayah. | String | Tidak | {{ ACS::RegionId }} | |
cron | Ekspresi CRON. | String | Tidak | 0 0 12 ? * * | |
timeZone | Zona waktu. | String | Tidak | UTC | |
rateControl | Rasio konkurensi eksekusi tugas | Json | Tidak | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | Peran Resource Access Management (RAM) yang diasumsikan oleh CloudOps Orchestration Service (OOS). | String | Tidak | OOSServiceRole |
Parameter Output
Parameter | Deskripsi | Tipe |
instanceIds | List |
Kebijakan Izin yang Diperlukan untuk Menjalankan Template
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:StartInstance"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Rincian
Untuk informasi lebih lanjut, lihat ACS-ECS-ScheduleToStartInstances.
Konten Template
FormatVersion: OOS-2019-06-01
Description:
en: 'Starts ECS instances on a schedule. Use this template to start instances at a specific time, such as automatically starting development or test environments. You must provide the region ID (regionId), a cron expression (cron), and the target instances (targets). The template then starts the specified instances according to the schedule.'
zh-cn: 'Starts ECS instances on a schedule. Use this template to start instances at a specific time, such as automatically starting development or test environments. You must provide the region ID (regionId), a cron expression (cron), and the target instances (targets). The template then starts the specified instances according to the schedule.'
name-en: ACS-ECS-ScheduleToStartInstances
name-zh-cn: Start ECS instances on a schedule
categories:
- time_trigger
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: Region ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
cron:
Description:
en: 'For more information, see https://www.alibabacloud.com/help/document_detail/169784.html'
zh-cn: 'For more information, see https://www.alibabacloud.com/help/document_detail/169784.html'
Label:
en: CronExpression
zh-cn: Ekspresi cron
Type: String
AssociationProperty: Cron
Default: 0 0 12 ? * *
endDate:
Description:
en: 'Format: yyyy-MM-ddTHH:mm:ssZ.'
zh-cn: 'Format: yyyy-MM-ddTHH:mm:ssZ'
Label:
en: EndDate
zh-cn: Waktu akhir pemicu
Type: String
AssociationProperty: DateTime
AssociationPropertyMetadata:
Format: 'YYYY-MM-DDTHH:mm:ssZ'
timeZone:
Label:
en: TimeZone
zh-cn: Zona waktu
Type: String
AssociationProperty: TimeZone
Default: UTC
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: Instance target
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
en: RateControl
zh-cn: Laju konkurensi untuk eksekusi tugas
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: Peran RAM yang diasumsikan oleh OOS
Type: String
Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: timerTrigger
Action: ACS::TimerTrigger
Description:
en: Triggers a task on a schedule by specifying the trigger type and expression.
zh-cn: Triggers a task on a schedule by specifying the trigger type and expression.
Properties:
Type: cron
Expression: '{{ cron }}'
EndDate: '{{ endDate }}'
TimeZone: '{{ timeZone }}'
- Name: getInstance
Description:
en: Gets the ECS instances.
zh-cn: Mengambil instance ECS.
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: startInstance
Action: ACS::ECS::StartInstance
Description:
en: Starts the ECS instances.
zh-cn: Memulai instance.
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Outputs:
instanceIds:
Type: List
Value: '{{ getInstance.instanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- timeZone
- cron
- endDate
Label:
default:
zh-cn: Pengaturan pengatur waktu
en: Timer Trigger Configure
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Pilih instance
en: Select ECS Instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Opsi lanjutan
en: Control Options