Nama Templat
ACS-ECS-CloneInstancesAcrossAZ: Mengkloning satu atau beberapa Instance ECS ke zona ketersediaan berbeda dalam wilayah yang sama.
Description
Mengkloning satu atau beberapa Instance ECS ke zona ketersediaan berbeda dalam wilayah yang sama.
Template type
Automation
Owner
Alibaba Cloud
Input parameters
|
Parameter |
Description |
Type |
Required |
Default |
Constraints |
|
targets |
Instans target. |
Json |
Yes |
||
|
targetSecurityGroupId |
ID security group untuk instans baru. |
String |
Yes |
||
|
targetVSwitchId |
ID vSwitch untuk instans baru. Menentukan zona ketersediaan tujuan. |
String |
Yes |
||
|
targetTags |
Tag yang akan ditambahkan ke instans baru. |
Json |
Yes |
||
|
regionId |
ID wilayah. |
String |
No |
{{ ACS::RegionId }} |
|
|
targetResourceGroupId |
ID kelompok sumber daya untuk instans baru. |
String |
No |
||
|
targetInstanceType |
Tipe instans dari instans baru. |
String |
No |
||
|
targetInstanceChargeType |
Metode penagihan untuk instans baru. |
String |
No |
PostPaid |
|
|
targetPeriodUnit |
Unit durasi langganan. Diperlukan hanya jika metode penagihan adalah subscription ( |
String |
No |
||
|
targetPeriod |
Durasi langganan. Diperlukan hanya jika metode penagihan adalah subscription ( |
Number |
No |
1 |
|
|
targetDeploymentSetId |
ID set penyebaran untuk instans baru. |
String |
No |
||
|
targetInstanceName |
Nama instans baru. |
String |
No |
||
|
targetHostName |
Hostname instans baru. |
String |
No |
||
|
rateControl |
Konkurensi dan toleransi kesalahan untuk tugas loop. |
Json |
No |
{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} |
|
|
OOSAssumeRole |
Peran RAM yang diasumsikan oleh CloudOps Orchestration Service (OOS). |
String |
No |
"" |
Output parameters
|
Parameter |
Description |
Type |
|
instanceIds |
ID instans baru. |
List |
Required permissions
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateImage",
"ecs:DeleteImage",
"ecs:DescribeAvailableResource",
"ecs:DescribeDisks",
"ecs:DescribeImages",
"ecs:DescribeInstances",
"ecs:DescribeVSwitches",
"ecs:RunInstances"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Details
Details of ACS-ECS-CloneInstancesAcrossAZ
Isi templat
FormatVersion: OOS-2019-06-01
Description:
en: Clones one or more ECS instances to a different availability zone within the same region.
zh-cn: 跨可用区批量克隆ECS实例
name-en: ACS-ECS-CloneInstancesAcrossAZ
name-zh-cn: 跨可用区批量克隆ECS实例
categories:
- cross_region
Parameters:
regionId:
Type: String
Label:
en: Region ID
zh-cn: 地域ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Label:
en: Target instances
zh-cn: 目标实例
Type: Json
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
targetSecurityGroupId:
Label:
en: Target security group ID
zh-cn: 新实例的安全组ID
Type: String
AssociationProperty: 'ALIYUN::ECS::SecurityGroup::SecurityGroupId'
AssociationPropertyMetadata:
RegionId: regionId
Filters:
- SecurityGroupId: targetSecurityGroupId
targetVSwitchId:
Label:
en: Target vSwitch ID
zh-cn: 新实例的交换机ID,填写本参数时将会决定目的可用区
Type: String
AssociationProperty: 'ALIYUN::VPC::VSwitch::VSwitchId'
AssociationPropertyMetadata:
RegionId: regionId
Filters:
- SecurityGroupId: targetSecurityGroupId
targetResourceGroupId:
Label:
en: Target resource group ID
zh-cn: 新实例将加入的目的资源组ID
Type: String
Default: ' '
targetInstanceType:
Label:
en: Target instance type
zh-cn: 新实例的规格
Type: String
AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
AssociationPropertyMetadata:
RegionId: regionId
Default: ' '
targetTags:
Label:
en: Target tags
zh-cn: 新实例的标签
Type: Json
AssociationProperty: Tags
AssociationPropertyMetadata:
ShowSystem: false
targetInstanceChargeType:
Label:
en: Billing method
zh-cn: 新实例的付费模式,默认按量付费
Type: String
AllowedValues:
- PrePaid
- PostPaid
Default: PostPaid
targetPeriodUnit:
Label:
en: Subscription duration unit
zh-cn: 当新实例的付费方式选择包年包月时,请在此处选择时长单位,默认单位是月
Type: String
AllowedValues:
- Week
- Month
- ' '
Default: ' '
targetPeriod:
Label:
en: Subscription duration
zh-cn: 当新实例的付费方式选择包年包月时,请在此处填写时长数,默认值为1
Type: Number
Default: 1
targetDeploymentSetId:
Label:
en: Target deployment set ID
zh-cn: 新实例的部署集ID
Type: String
Default: ' '
targetInstanceName:
Label:
en: Instance name
zh-cn: 新实例的名称
Type: String
Default: ' '
targetHostName:
Label:
en: Hostname
zh-cn: 新实例的主机名称
Type: String
Default: ' '
rateControl:
Label:
en: Rate control
zh-cn: 循环任务执行的并发率及容错数
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOS assume role
zh-cn: OOS扮演的RAM角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Gets the target ECS instances.
zh-cn: 获取ECS实例
Action: 'ACS::SelectTargets'
Properties:
RegionId: '{{regionId}}'
ResourceType: 'ALIYUN::ECS::Instance'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: 'Instances.Instance[].InstanceId'
- Name: cloneInstancesAcrossAZ
Action: 'ACS::Template'
Description:
en: Clones the instances.
zh-cn: 克隆实例
Properties:
TemplateName: 'ACS::ECS::CloneInstanceAcrossAZ'
Parameters:
imageName: 'img-{{ ACS::TaskLoopItem }}-{{ACS::ExecutionId}}'
instanceId: '{{ ACS::TaskLoopItem }}'
targetSecurityGroupId: '{{ targetSecurityGroupId }}'
targetResourceGroupId: '{{ targetResourceGroupId }}'
targetVSwitchId: '{{ targetVSwitchId }}'
regionId: '{{ regionId }}'
targetInstanceName: '{{ targetInstanceName }}'
targetInstanceChargeType: '{{ targetInstanceChargeType }}'
targetPeriodUnit: '{{ targetPeriodUnit }}'
targetPeriod: '{{ targetPeriod }}'
targetInstanceType: '{{ targetInstanceType }}'
targetHostName: '{{ targetHostName }}'
targetDeploymentSetId: '{{ targetDeploymentSetId }}'
tags: '{{ targetTags }}'
OOSAssumeRole: '{{OOSAssumeRole}}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
instanceIds:
AggregateType: 'Fn::ListJoin'
AggregateField: instanceId
Outputs:
instanceId:
ValueSelector: instanceId
Type: String
Outputs:
instanceIds:
Value: '{{ cloneInstancesAcrossAZ.instanceIds }}'
Type: List
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- targetSecurityGroupId
- targetVSwitchId
- targetInstanceType
- targetTags
- targetInstanceChargeType
- targetPeriodUnit
- targetPeriod
- targetResourceGroupId
- targetDeploymentSetId
- targetInstanceName
- targetHostName
Label:
default:
zh-cn: 设置参数
en: Configure parameters
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: 选择实例
en: Select ECS instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 高级选项
en: Advanced options