Nome do modelo
ACS-ECS-ScheduleToStartInstances: Iniciar instâncias ECS por agendamento
Descrição do modelo
Inicia instâncias do Elastic Compute Service (ECS) por agendamento. Use este modelo para iniciar automaticamente ambientes de desenvolvimento ou teste em horários específicos. Especifique o ID da região (regionId), uma expressão cron (cron) para definir o agendamento e as instâncias de destino (targets) a iniciar.
Tipo de modelo
Automatizado
Proprietário
Alibaba Cloud
Parâmetros de entrada
|
Parâmetro |
Descrição |
Tipo |
Obrigatório |
Valor padrão |
Limite |
|
endDate |
Hora de término da tarefa agendada. |
String |
Sim |
||
|
targets |
Instâncias ECS de destino a iniciar. |
Json |
Sim |
||
|
regionId |
ID da região. |
String |
Não |
{{ ACS::RegionId }} |
|
|
cron |
Expressão CRON. |
String |
Não |
0 0 12 ? |
|
|
timeZone |
Fuso horário. |
String |
Não |
UTC |
|
|
rateControl |
Configurações de concorrência para execução da tarefa. |
Json |
Não |
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} |
|
|
OOSAssumeRole |
Função RAM assumida pelo OOS. |
String |
Não |
OOSServiceRole |
Parâmetros de saída
|
Parâmetro |
Descrição |
Tipo |
|
instanceIds |
List |
Permissões necessárias
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:StartInstance"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detalhes
Para mais informações, consulte ACS-ECS-ScheduleToStartInstances.
Conteúdo do modelo
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: Cron expression
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: End time of the trigger
Type: String
AssociationProperty: DateTime
AssociationPropertyMetadata:
Format: 'YYYY-MM-DDTHH:mm:ssZ'
timeZone:
Label:
en: TimeZone
zh-cn: Time zone
Type: String
AssociationProperty: TimeZone
Default: UTC
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: Target instances
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
en: RateControl
zh-cn: Concurrency rate for task execution
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: The RAM role assumed by 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: Gets the ECS instances.
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: Starts the instances.
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: Timer settings
en: Timer Trigger Configure
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Select instances
en: Select ECS Instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Advanced options
en: Control Options