ACS-ECS-BulkyCreateAndExportImage
更新時間:
模板名稱
ACS-ECS-BulkyCreateAndExportImage 批量創(chuàng)建并導(dǎo)出鏡像到OSS-Bucket
模板描述
批量創(chuàng)建并導(dǎo)出鏡像到OSS-Bucket
模板類型
自動化
所有者
Alibaba Cloud
輸入?yún)?shù)
參數(shù)名稱 | 描述 | 類型 | 是否必填 | 默認(rèn)值 | 約束 |
targets | 目標(biāo)實例 | Json | 是 | ||
OSSBucket | 保存導(dǎo)出鏡像的OSS bucket | String | 是 | ||
tags | 鏡像標(biāo)簽 | Json | 否 | [] | |
rateControl | 任務(wù)執(zhí)行的并發(fā)比率 | Json | 否 | {‘Mode’: ‘Concurrency’, ‘MaxErrors’: 0, ‘Concurrency’: 10} | |
OOSAssumeRole | OOS扮演的RAM角色 | String | 否 | “” |
輸出參數(shù)
參數(shù)名稱 | 描述 | 類型 |
imageIds | List |
執(zhí)行此模板需要的權(quán)限策略
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:CreateImage",
"ecs:DescribeImages",
"ecs:DescribeInstances",
"ecs:ExportImage"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳情
ACS-ECS-BulkyCreateAndExportImage詳情
模板內(nèi)容
FormatVersion: OOS-2019-06-01
Description:
en: Bulky creates ECS image and exports them into OSS
zh-cn: 批量創(chuàng)建并導(dǎo)出鏡像到OSS-Bucket
name-en: ACS-ECS-BulkyCreateAndExportImage
name-zh-cn: 批量創(chuàng)建并導(dǎo)出鏡像到OSS-Bucket
categories:
- image_manage
Parameters:
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: 目標(biāo)實例
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: ALIYUN::ECS::Instance
OSSBucket:
Label:
en: OSSBucket
zh-cn: 保存導(dǎo)出鏡像的OSS bucket
Type: String
tags:
Label:
en: Tags
zh-cn: 鏡像標(biāo)簽
Type: Json
AssociationProperty: Tags
AssociationPropertyMetadata:
ShowSystem: false
Default: []
rateControl:
Label:
en: RateControl
zh-cn: 任務(wù)執(zhí)行的并發(fā)比率
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Views the ECS instances
zh-cn: 獲取ECS實例
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: createImage
Action: ACS::ECS::CreateImage
Description:
en: Create new image with the specified image name and instance ID
zh-cn: 通過指定實例ID和鏡像名稱創(chuàng)建新的鏡像
Properties:
instanceId: '{{ ACS::TaskLoopItem }}'
tags: '{{tags}}'
imageName: 'image_of_{{ ACS::TaskLoopItem }}_{{ ACS::ExecutionId }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
imageIds:
AggregateType: 'Fn::ListJoin'
AggregateField: imageId
Outputs:
imageId:
ValueSelector: imageId
Type: String
- Name: importImageToOSS
Action: ACS::ExecuteApi
Description:
en: EXport image to OSS bucket
zh-cn: 導(dǎo)出鏡像到OSS-Bucket
Properties:
Service: ECS
API: ExportImage
Parameters:
ImageId: '{{ ACS::TaskLoopItem }}'
OSSBucket: '{{ OSSBucket }}'
Loop:
Items: '{{ createImage.imageIds }}'
RateControl: '{{ rateControl }}'
Outputs:
imageIds:
Type: List
Value: '{{ createImage.imageIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- targets
- OSSBucket
- tags
Label:
default:
zh-cn: 配置參數(shù)
en: Configure Parameters
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 高級選項
en: Control Options
文檔內(nèi)容是否對您有幫助?