テンプレート名
ACS-ECS-BulkyDownloadOSSFileAndRunCommand:複数の OSS ファイルを複数の ECS インスタンスにダウンロードし、クラウドアシスタントコマンドを実行します。
テンプレートの説明
Object Storage Service (OSS) から複数の Elastic Compute Service (ECS) インスタンスに一度にファイルをダウンロードし、ECS インスタンスで Cloud Assistant コマンドを実行します。
テンプレートの種類
自動化
所有者
Alibaba Cloud
入力パラメーター
パラメーター | 説明 | 種類 | 必須 | デフォルト値 | 制限 |
targets | ターゲットインスタンス | Json | はい | ||
bucketName | OSS バケット名 | String | はい | ||
objectName | OSS オブジェクトの名前。 | String | はい | ||
destinationDir | ECS インスタンス内でファイルをダウンロードするディレクトリ。 | String | はい | ||
regionId | リージョン ID。 | String | いいえ | {{ ACS::RegionId }} | |
OSSRegion | OSS バケットが存在するリージョン。 | String | いいえ | {{ ACS::RegionId }} | |
URLExpirationTime | OSS オブジェクトのダウンロード URL の有効期間。 | Number | いいえ | 6000 | |
whetherSaveToFile | ファイルの内容を特定のファイルに保存するかどうかを指定します。 | Boolean | いいえ | True | |
commandContent | ECS インスタンスで実行される Cloud Assistant コマンド。 | String | いいえ | echo hello | |
timeout | ECS インスタンスでコマンドを実行するためのタイムアウト期間。 | Number | いいえ | 600 | |
rateControl | レート制御設定。 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | CloudOps Orchestration Service (OOS) によって引き受けられる Resource Access Management (RAM) ロール。 | String | いいえ | "" |
出力パラメーター
なし
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oss:GetObject"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、GitHub の ACS-ECS-BulkyDownloadOSSFileAndRunCommand.yml をご参照ください。
テンプレートの内容
FormatVersion: OOS-2019-06-01
Description:
en: OSS ファイルをインスタンスに一括ダウンロードし、コマンドを実行します。
zh-cn: OSS ファイルをインスタンスに一括ダウンロードし、コマンドを実行します。
name-en: ACS-ECS-BulkyDownloadOSSFileAndRunCommand
name-zh-cn: ACS-ECS-BulkyDownloadOSSFileAndRunCommand
categories:
- instance_manage
Parameters:
regionId:
Type: String
Label:
en: リージョン ID
zh-cn: リージョン ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Label:
en: ターゲットインスタンス
zh-cn: ターゲットインスタンス
Type: Json
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
OSSRegion:
Label:
en: OSS リージョン
zh-cn: OSS リージョン
Type: String
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
bucketName:
Label:
en: バケット名
zh-cn: バケット名
Type: String
objectName:
Label:
en: オブジェクト名
zh-cn: オブジェクト名
Type: String
URLExpirationTime:
Label:
en: ダウンロード URL の有効期間
zh-cn: ダウンロード URL の有効期間
Type: Number
Default: 6000
destinationDir:
Label:
en: 宛先ディレクトリ
zh-cn: 宛先ディレクトリ
Type: String
whetherSaveToFile:
Label:
en: 特定のファイルに保存
zh-cn: 特定のファイルに保存
Type: Boolean
Default: true
commandContent:
Label:
en: コマンド内容
zh-cn: コマンド内容
Type: String
AssociationProperty: Code
Default: echo hello
timeout:
Label:
en: タイムアウト
zh-cn: タイムアウト
Type: Number
Default: 600
rateControl:
Label:
en: レート制御
zh-cn: レート制御
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOS が偽装するロール
zh-cn: OOS が偽装するロール
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: 指定された ECS インスタンスを取得します。
zh-cn: 指定された ECS インスタンスを取得します。
Action: 'ACS::SelectTargets'
Properties:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: 'Instances.Instance[].InstanceId'
- Name: downloadOSSFileAndRunCommand
Action: ACS::ECS::DownloadOSSFileAndRunCommand
Description:
en: OSS ファイルを ECS インスタンスにダウンロードし、コマンドを実行します。
zh-cn: OSS ファイルを ECS インスタンスにダウンロードし、コマンドを実行します。
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
bucketName: '{{ bucketName }}'
objectName: '{{ objectName }}'
URLExpirationTime: '{{ URLExpirationTime }}'
OSSRegion: '{{ OSSRegion }}'
destinationDir: '{{ destinationDir }}'
whetherSaveToFile: '{{ whetherSaveToFile }}'
commandContent: '{{ commandContent }}'
timeout: '{{ timeout }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: インスタンスの選択
en: インスタンスの選択
- Parameters:
- OSSRegion
- bucketName
- objectName
- URLExpirationTime
- whetherSaveToFile
- destinationDir
Label:
default:
zh-cn: ダウンロードファイルパラメーターの設定
en: ダウンロードファイルパラメーターの設定
- Parameters:
- commandContent
- timeout
Label:
default:
zh-cn: 実行コマンドパラメーターの設定
en: 実行コマンドパラメーターの設定
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 詳細オプション
en: 詳細オプション