Nama Template
ACS-ECS-BulkyDownloadFile
Deskripsi Template
Mengunduh file secara massal ke beberapa instans Elastic Compute Service (ECS) Alibaba Cloud. Templat ini cocok untuk skenario yang memerlukan distribusi file ke beberapa instans, seperti penerapan aplikasi dan sinkronisasi data. Saat dikonfigurasi, Anda harus menyediakan beberapa parameter yang diperlukan: regionId menentukan wilayah instans ECS target; targets mendefinisikan instans ECS spesifik untuk operasi tersebut; sourceType menentukan sumber file, seperti local, Object Storage Service (OSS), atau HTTPS; dan sourcePath menentukan lokasi file. Setelah templat dijalankan, hasil operasi unduhan akan dikembalikan sehingga Anda dapat memverifikasi status unduhan.
Tipe Template
Otomatis
Pemilik
Alibaba Cloud
Parameter masukan
Parameter | Deskripsi | Tipe | Diperlukan | Nilai Default | Batas |
targets | Target instance | Json | Ya | ||
sourcePath | Select File | String | Ya | ||
regionId | ID wilayah. | String | Tidak | {{ ACS::RegionId }} | |
sourceType | Tipe file. | String | Tidak | local | |
destinationDir | Direktori tempat file disimpan. | String | Tidak | /root | |
timeout | Periode timeout dalam detik. | Number | Tidak | 600 | |
fileOwner | Pemilik file. | String | Tidak | "" | |
fileGroup | Grup file tempat file tersebut termasuk. | String | Tidak | "" | |
fileMode | Izin pada file. | String | Tidak | "" | |
overwrite | Menentukan apakah akan menimpa file yang ada. | Boolean | Tidak | True | |
rateControl | 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 | "" |
Parameter Output
Parameter | Deskripsi | Tipe |
commandOutput | String |
Kebijakan Izin yang Diperlukan untuk Menjalankan Template
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Rincian
Untuk informasi lebih lanjut, lihat ACS-ECS-BulkyDownloadFile.yml di GitHub.
Konten Template
Tindakan pencegahan:
Untuk mengunduh file melalui HTTPS, instans ECS harus memiliki akses jaringan publik yang diaktifkan.
Untuk mengunduh file dari OSS, peran RAM harus dikonfigurasikan untuk instans ECS. Untuk informasi selengkapnya, lihat dokumen ini.
Catatan
Untuk mengunduh file menggunakan HTTPS, instans ECS harus memiliki akses jaringan publik.
Untuk mengunduh file menggunakan OSS, instans ECS harus memiliki peran RAM yang dikonfigurasikan. Untuk informasi selengkapnya, lihat dokumen referensi.
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
Status: Running
sourceType:
Type: String
Description:
en: The size of a local file to be uploaded cannot exceed 500 MB.
zh-cn: The size of a local file to be uploaded cannot exceed 500 MB.
Label:
en: Source type
zh-cn: Source type
AllowedValues:
- local
- oss
- https
Default: local
AssociationPropertyMetadata:
LocaleKey: DownloadFileType
RegionId: ${regionId}
sourcePath:
Type: String
Label:
en: Source path
zh-cn: Select file
AssociationProperty: ALIYUN::OOS::File::FileUrl
AssociationPropertyMetadata:
FileType: ${sourceType}
RegionId: ${regionId}
destinationDir:
Label:
en: Destination directory
zh-cn: Destination directory
Description:
en: <li class="Li">The full path to save the file on the target instance. For example, /root for Linux or E:// for Windows.
zh-cn:
The full path to save the file on the target instance. For example, /root for Linux or E:// for Windows.
Type: String
Default: /root
timeout:
Label:
en: Timeout (s)
zh-cn: Timeout (s)
Type: Number
Default: 600
fileOwner:
Label:
en: File owner
zh-cn: File owner
Type: String
Default: ''
fileGroup:
Label:
en: File group
zh-cn: File group
Type: String
Default: ''
fileMode:
Label:
en: File mode
zh-cn: File mode
Type: String
Default: ''
overwrite:
Label:
en: Overwrite existing file
zh-cn: Overwrite existing file
Type: Boolean
Default: true
rateControl:
Label:
en: Concurrency rate for task execution
zh-cn: Concurrency rate for task execution
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: RAM role for OOS to assume
zh-cn: RAM role for OOS to assume
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- 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: downloadFileToInstances
Action: 'ACS::ECS::DownloadFile'
Description:
en: Downloads a file to the specified ECS instances
zh-cn: Downloads a file to the specified ECS instances
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
sourceType: '{{ sourceType }}'
sourcePath: '{{ sourcePath }}'
destinationDir: '{{ destinationDir }}'
timeout: '{{ timeout }}'
fileOwner: '{{ fileOwner }}'
fileGroup: '{{ fileGroup }}'
fileMode: '{{ fileMode }}'
overwrite: '{{ overwrite }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
commandOutputs:
AggregateType: 'Fn::ListJoin'
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: commandOutput
Outputs:
commandOutput:
Type: String
Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- sourceType
- sourcePath
- destinationDir
Label:
default:
zh-cn: Configure parameters
en: Configure parameters
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Select instances
en: Select instances
- Parameters:
- timeout
- fileOwner
- fileGroup
- fileMode
- overwrite
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Advanced options
en: Advanced options
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
Status: Running
sourceType:
Type: String
Description:
en: The size of a local file cannot exceed 500 MB.
Label:
en: Source type
AllowedValues:
- local
- oss
- https
Default: local
AssociationPropertyMetadata:
LocaleKey: DownloadFileType
RegionId: ${regionId}
sourcePath:
Type: String
Label:
en: Source path
AssociationProperty: ALIYUN::OOS::File::FileUrl
AssociationPropertyMetadata:
FileType: ${sourceType}
RegionId: ${regionId}
destinationDir:
Label:
en: Destination directory
Description:
en:
Type: String
Default: /root
timeout:
Label:
en: Timeout (s)
Type: Number
Default: 600
fileOwner:
Label:
en: File owner
Type: String
Default: ''
fileGroup:
Label:
en: File group
Type: String
Default: ''
fileMode:
Label:
en: File mode
Type: String
Default: ''
overwrite:
Label:
en: Overwrite existing file
Type: Boolean
Default: true
rateControl:
Label:
en: Rate control
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOS assume role
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: 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: downloadFileToInstances
Action: 'ACS::ECS::DownloadFile'
Description:
en: Downloads the file to the specified instances.
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
sourceType: '{{ sourceType }}'
sourcePath: '{{ sourcePath }}'
destinationDir: '{{ destinationDir }}'
timeout: '{{ timeout }}'
fileOwner: '{{ fileOwner }}'
fileGroup: '{{ fileGroup }}'
fileMode: '{{ fileMode }}'
overwrite: '{{ overwrite }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
commandOutputs:
AggregateType: 'Fn::ListJoin'
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: commandOutput
Outputs:
commandOutput:
Type: String
Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- sourceType
- sourcePath
- destinationDir
Label:
default:
en: Configure parameters
- Parameters:
- regionId
- targets
Label:
default:
en: Select instances
- Parameters:
- timeout
- fileOwner
- fileGroup
- fileMode
- overwrite
- rateControl
- OOSAssumeRole
Label:
default:
en: Advanced options
<p>Precautions:</p><ul> <li><font>Untuk mengunduh file melalui HTTPS, instans ECS harus memiliki akses jaringan publik yang diaktifkan.</font></li><li><font>Untuk mengunduh file dari OSS, peran RAM harus dikonfigurasi untuk instans ECS. Untuk informasi selengkapnya, lihat <a href="https://www.alibabacloud.com/help/document_detail/175396.html?spm=a2c4g.120556.0.0.34c9de53iyt2Z1#vOk3w">dokumen ini</a>.</font></li><p>Note</p><ul> <li><font>Untuk mengunduh file menggunakan HTTPS, instans ECS harus memiliki akses jaringan publik.</font></li><li><font>Untuk mengunduh file menggunakan OSS, instans ECS harus memiliki peran RAM yang dikonfigurasi. Untuk informasi selengkapnya, lihat <a href="https://www.alibabacloud.com/help/document_detail/175396.html?spm=a2c4g.120556.0.0.34c9de53iyt2Z1#vOk3w">dokumen referensi</a>.</font></li>
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
Status: Running
sourceType:
Type: String
Description:
en: The size of a local file to be uploaded cannot exceed 500 MB.
zh-cn: The size of a local file to be uploaded cannot exceed 500 MB.
Label:
en: Source type
zh-cn: Source type
AllowedValues:
- local
- oss
- https
Default: local
AssociationPropertyMetadata:
LocaleKey: DownloadFileType
RegionId: ${regionId}
sourcePath:
Type: String
Label:
en: Source path
zh-cn: Select file
AssociationProperty: ALIYUN::OOS::File::FileUrl
AssociationPropertyMetadata:
FileType: ${sourceType}
RegionId: ${regionId}
destinationDir:
Label:
en: Destination directory
zh-cn: Destination directory
Description:
en: <li class="Li">The full path to save the file on the target instance. For example, /root for Linux or E:// for Windows.<!-- /li-->
zh-cn: <li>The full path to save the file on the target instance. For example, /root for Linux or E:// for Windows.</li>
Type: String
Default: /root
timeout:
Label:
en: Timeout (s)
zh-cn: Timeout (s)
Type: Number
Default: 600
fileOwner:
Label:
en: File owner
zh-cn: File owner
Type: String
Default: ''
fileGroup:
Label:
en: File group
zh-cn: File group
Type: String
Default: ''
fileMode:
Label:
en: File mode
zh-cn: File mode
Type: String
Default: ''
overwrite:
Label:
en: Overwrite existing file
zh-cn: Overwrite existing file
Type: Boolean
Default: true
rateControl:
Label:
en: Concurrency rate for task execution
zh-cn: Concurrency rate for task execution
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: RAM role for OOS to assume
zh-cn: RAM role for OOS to assume
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- 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: downloadFileToInstances
Action: 'ACS::ECS::DownloadFile'
Description:
en: Downloads a file to the specified ECS instances
zh-cn: Downloads a file to the specified ECS instances
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
sourceType: '{{ sourceType }}'
sourcePath: '{{ sourcePath }}'
destinationDir: '{{ destinationDir }}'
timeout: '{{ timeout }}'
fileOwner: '{{ fileOwner }}'
fileGroup: '{{ fileGroup }}'
fileMode: '{{ fileMode }}'
overwrite: '{{ overwrite }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
commandOutputs:
AggregateType: 'Fn::ListJoin'
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: commandOutput
Outputs:
commandOutput:
Type: String
Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- sourceType
- sourcePath
- destinationDir
Label:
default:
zh-cn: Configure parameters
en: Configure parameters
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: Select instances
en: Select instances
- Parameters:
- timeout
- fileOwner
- fileGroup
- fileMode
- overwrite
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: Advanced options
en: Advanced options
</ul>
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
Status: Running
sourceType:
Type: String
Description:
en: The size of a local file cannot exceed 500 MB.
Label:
en: Source type
AllowedValues:
- local
- oss
- https
Default: local
AssociationPropertyMetadata:
LocaleKey: DownloadFileType
RegionId: ${regionId}
sourcePath:
Type: String
Label:
en: Source path
AssociationProperty: ALIYUN::OOS::File::FileUrl
AssociationPropertyMetadata:
FileType: ${sourceType}
RegionId: ${regionId}
destinationDir:
Label:
en: Destination directory
Description:
en:
Type: String
Default: /root
timeout:
Label:
en: Timeout (s)
Type: Number
Default: 600
fileOwner:
Label:
en: File owner
Type: String
Default: ''
fileGroup:
Label:
en: File group
Type: String
Default: ''
fileMode:
Label:
en: File mode
Type: String
Default: ''
overwrite:
Label:
en: Overwrite existing file
Type: Boolean
Default: true
rateControl:
Label:
en: Rate control
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOS assume role
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: 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: downloadFileToInstances
Action: 'ACS::ECS::DownloadFile'
Description:
en: Downloads the file to the specified instances.
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
sourceType: '{{ sourceType }}'
sourcePath: '{{ sourcePath }}'
destinationDir: '{{ destinationDir }}'
timeout: '{{ timeout }}'
fileOwner: '{{ fileOwner }}'
fileGroup: '{{ fileGroup }}'
fileMode: '{{ fileMode }}'
overwrite: '{{ overwrite }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
commandOutputs:
AggregateType: 'Fn::ListJoin'
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: commandOutput
Outputs:
commandOutput:
Type: String
Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- sourceType
- sourcePath
- destinationDir
Label:
default:
en: Configure parameters
- Parameters:
- regionId
- targets
Label:
default:
en: Select instances
- Parameters:
- timeout
- fileOwner
- fileGroup
- fileMode
- overwrite
- rateControl
- OOSAssumeRole
Label:
default:
en: Advanced options
</ul>FormatVersion: OOS-2019-06-01
Description:
en: 'Bulky upload files to multiple Alibaba Cloud ECS instances, applicable to scenarios that require distributing files across multiple instances, such as application deployment and data synchronization. During configuration, users need to provide the following required parameter information: Region ID (regionId), which specifies the region of the target ECS instances where the files will be uploaded, Target Instances (targets), which defines the specific ECS instances to be operated on, Source Type (sourceType), which specifies the source method of the file (e.g., local, OSS, or HTTPS), and Source Path (sourcePath), which is the exact location of the file. Upon execution, the template provides the results of the file upload operation, enabling users to verify the status of the file uploads.'
name-en: Upload File
categories:
- instance_manage
- application_manage
- computenest
- tag_operate_resource
Parameters:
regionId:
Type: String
Label:
en: RegionId
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Type: Json
Label:
en: TargetInstance
Description:
en: <p class="p">Notes:</p> <ul class="ul"> <li class="li"><font color='red'>To download files over HTTPS, the ECS instance must have public network access.</font></li><li class="li"><font color='red'>To download files from OSS, the ECS instance must have a RAM role attached. For more information, see <a href="https://www.alibabacloud.com/help/en/operation-orchestration-service/latest/download-multiple-objects-to-an-instance#vOk3w">the related documentation</a>.</font></li></ul>
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
Status: Running
sourceType:
Type: String
Description:
en: The size of a file uploaded from a local machine cannot exceed 500 MB.
Label:
en: SourceType
AllowedValues:
- local
- oss
- https
Default: local
AssociationPropertyMetadata:
LocaleKey: DownloadFileType
RegionId: ${regionId}
sourcePath:
Type: String
Label:
en: SourcePath
AssociationProperty: ALIYUN::OOS::File::FileUrl
AssociationPropertyMetadata:
FileType: ${sourceType}
RegionId: ${regionId}
destinationDir:
Label:
en: DestinationDir
Description:
en: The full path on the target instance where the file is saved. Examples: /root for Linux, E:// for Windows.
Type: String
Default: /root
timeout:
Label:
en: Timeout (s)
Type: Number
Default: 600
fileOwner:
Label:
en: FileOwner
Type: String
Default: ''
fileGroup:
Label:
en: FileGroup
Type: String
Default: ''
fileMode:
Label:
en: FileMode
Type: String
Default: ''
overwrite:
Label:
en: Overwrite
Type: Boolean
Default: true
rateControl:
Label:
en: RateControl
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Retrieves 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: downloadFileToInstances
Action: 'ACS::ECS::DownloadFile'
Description:
en: Downloads the file to the specified ECS instances.
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
sourceType: '{{ sourceType }}'
sourcePath: '{{ sourcePath }}'
destinationDir: '{{ destinationDir }}'
timeout: '{{ timeout }}'
fileOwner: '{{ fileOwner }}'
fileGroup: '{{ fileGroup }}'
fileMode: '{{ fileMode }}'
overwrite: '{{ overwrite }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
commandOutputs:
AggregateType: 'Fn::ListJoin'
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: commandOutput
Outputs:
commandOutput:
Type: String
Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- sourceType
- sourcePath
- destinationDir
Label:
default:
en: Configure Parameters
- Parameters:
- regionId
- targets
Label:
default:
en: Select Instances
- Parameters:
- timeout
- fileOwner
- fileGroup
- fileMode
- overwrite
- rateControl
- OOSAssumeRole
Label:
default:
en: Control Options