テンプレート名
ACS-CS-BulkyOSSecurityUpdate
テンプレートの説明
オペレーティングシステム カーネルを更新します。
テンプレートの種類
自動化
所有者
Alibaba Cloud
入力パラメータ
パラメータ | 説明 | 種類 | 必須 | デフォルト値 | 制限 |
targets | 宛先インスタンス。 | Json | はい | ||
regionId | リージョン ID。 | String | いいえ | {{ ACS::RegionId }} | |
rateControl | タスク実行の同時実行率 | Json | いいえ | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | CloudOps Orchestration Service ( OOS ) によって引き受けられる RAM ロール。 | String | いいえ | "" |
出力パラメータ
パラメータ | 説明 | 種類 |
commandOutputs | List |
テンプレートを実行するために必要な権限ポリシー
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"oos:GetApplicationGroup"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
詳細
詳細については、GitHub の ACS-CS-BulkyOSSecurityUpdate.yml をご参照ください。
テンプレートの内容
FormatVersion: OOS-2019-06-01
Description:
ja: OS セキュリティを更新します
name-en: ACS-CS-BulkyOSSecurityUpdate
categories:
- run_command
Parameters:
regionId:
Type: String
Label:
ja: リージョン ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targets:
Label:
ja: 対象インスタンス
Type: Json
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
ja: レート制御
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
ja: OOS 引き受けロール
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
ja: ECS インスタンスを表示します
Action: ACS::SelectTargets
Properties:
ResourceType: ALIYUN::ECS::Instance
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: Instances.Instance[].InstanceId
- Name: runCommand
Action: ACS::ECS::RunCommand
Description:
ja: クラウドアシスタント コマンドを実行します
Properties:
regionId: '{{ regionId }}'
commandContent: |-
yum update-minimal --exclude kernel* --security -y || true
instanceId: '{{ ACS::TaskLoopItem }}'
commandType: RunShellScript
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ getInstance.instanceIds }}'
Outputs:
commandOutputs:
AggregateType: Fn::ListJoin
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: invocationOutput
Outputs:
commandOutputs:
Type: List
Value: '{{ runCommand.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- targets
Label:
default:
ja: インスタンスの選択
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
ja: 制御オプション