Nama templat
ACS-ECS-RunRemoteShellScript: Mengunduh skrip shell dari OSS ke instans ECS dan menjalankannya.
Deskripsi templat
Mengunduh skrip shell dari Object Storage Service (OSS) ke Instance ECS, lalu menjalankannya menggunakan Asisten Cloud.
Jenis templat
Automation
Pemilik
Alibaba Cloud
Parameter input
|
Nama parameter |
Deskripsi |
Tipe |
Wajib |
Nilai default |
Batasan |
|
instanceId |
ID instans ECS tempat skrip dijalankan. |
String |
Yes |
||
|
instanceRole |
Peran RAM yang ditautkan ke instans. |
String |
Yes |
||
|
fileName |
Nama file skrip shell yang akan dijalankan. |
String |
Yes |
||
|
srcUrl |
Direktori OSS tempat file skrip disimpan. |
String |
Yes |
||
|
destUrl |
Direktori tujuan pada instans ECS tempat file skrip disalin. |
String |
Yes |
||
|
regionId |
ID wilayah. |
String |
No |
{{ ACS::RegionId }} |
|
|
workingDir |
Direktori kerja pada instans tempat perintah dijalankan. |
String |
No |
/root |
|
|
timeout |
Periode timeout maksimum untuk menjalankan perintah. Satuan: detik. |
Number |
No |
600 |
|
|
OOSAssumeRole |
Peran RAM yang diasumsikan oleh OOS untuk menjalankan templat ini. |
String |
No |
“” |
Parameter output
|
Nama parameter |
Deskripsi |
Tipe |
|
commandOutput |
String |
Kebijakan akses yang diperlukan untuk templat ini
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstanceRAMRole",
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
Detail
Detail ACS-ECS-RunRemoteShellScript
Konten templat
FormatVersion: OOS-2019-06-01
Description:
en: Runs a remote shell script.
zh-cn: Runs a remote shell script.
name-en: ACS-ECS-RunRemoteShellScript
name-zh-cn: Run a remote shell script
categories:
- run_command
Parameters:
regionId:
Label:
en: Region ID
zh-cn: Region ID
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
instanceId:
Label:
en: ECS Instance
zh-cn: ECS Instance
Type: String
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
AssociationPropertyMetadata:
RegionId: regionId
instanceRole:
Label:
en: The RAM role attached to the instance
zh-cn: The RAM role attached to the instance
Type: String
fileName:
Label:
en: The name of the file to execute
zh-cn: The name of the file to execute
Type: String
srcUrl:
Label:
en: The directory in OSS where the file is located
zh-cn: The directory in OSS where the file is located
Type: String
destUrl:
Label:
en: The directory on the ECS instance to which the file is copied
zh-cn: The directory on the ECS instance to which the file is copied
Type: String
workingDir:
Label:
en: The directory on the instance where the command runs
zh-cn: The directory on the instance where the command runs
Type: String
Default: /root
timeout:
Label:
en: The maximum timeout period for running the command
zh-cn: The maximum timeout period for running the command
Type: Number
Default: 600
OOSAssumeRole:
Label:
en: The RAM role that OOS assumes
zh-cn: The RAM role that OOS assumes
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: copyOSSFileToInstance
Description:
en: Copies a file from OSS to a Linux instance.
zh-cn: Copies a file from OSS to a Linux instance.
Action: 'ACS::ECS::CopyLinuxInstanceFileFromOSS'
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ instanceId }}'
instanceRole: '{{ instanceRole }}'
srcUrl: '{{ srcUrl }}/{{ fileName }}'
destUrl: '{{ destUrl }}'
- Name: runCommand
Description:
en: Executes a Cloud Assistant command.
zh-cn: Executes a Cloud Assistant command.
Action: 'ACS::ECS::RunCommand'
Properties:
regionId: '{{ regionId }}'
commandContent: '/bin/bash {{ destUrl }}/{{ fileName }}'
instanceId: '{{ instanceId }}'
commandType: RunShellScript
workingDir: '{{ workingDir }}'
timeout: '{{ timeout }}'
Outputs:
commandOutput:
Type: String
ValueSelector: invocationOutput
Outputs:
commandOutput:
Type: String
Value: '{{ runCommand.commandOutput }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- instanceRole
- fileName
- srcUrl
- destUrl
- workingDir
- timeout
Label:
default:
zh-cn: Run Shell Script Options
en: Run Shell Script Options
- Parameters:
- instanceId
Label:
default:
zh-cn: Select ECS Instance
en: Select ECS Instance
- Parameters:
- OOSAssumeRole
Label:
default:
zh-cn: Control Options
en: Control Options