Template name
ACS-ECS-BulkyConfigureOOSPackage
Template description
Installs a custom CloudOps Orchestration Service (OOS) software package on multiple Elastic Compute Service (ECS) instances at a time.
Template type
Automated
Owner
Alibaba Cloud
Input parameters
Parameter | Description | Type | Required | Default value | Limit |
packageName | The name of the software package to be installed. | String | Yes | ||
targets | The ECS instances on which you want to install the software package. | Json | Yes | ||
regionId | The region ID. | String | No | {{ ACS::RegionId }} | |
action | The operation to be performed on the software package. | String | No | install | |
packageVersion | The version of the software package to be configured. | String | No | "" | |
rateControl | The rate control settings. | Json | No | {'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10} | |
OOSAssumeRole | The Resource Access Management (RAM) role that is assumed by CloudOps Orchestration Service (OOS). | String | No | "" |
Output parameters
Parameter | Description | Type |
commandOutput | List |
Permission policy that is required to execute the template
{
"Version": "1",
"Statement": [
{
"Action": [
"ecs:DescribeInstances",
"ecs:DescribeInvocationResults",
"ecs:DescribeInvocations",
"ecs:RunCommand"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
References
For more information, see ACS-ECS-BulkyConfigureOOSPackage.yml at GitHub.
Template content
FormatVersion: OOS-2019-06-01
Description:
en: Use this template to install sls agent on ecs
zh-cn: the description in Chinese
name-en: ACS-ECS-BulkyConfigureOOSPackage
name-zh-cn: the description in Chinese
categories:
- run_command
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: the description in Chinese
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
action:
Label:
en: Action
zh-cn: the description in Chinese
Type: String
AllowedValues:
- install
- uninstall
Default: install
AssociationPropertyMetadata:
LocaleKey: SoftwareOperationType
packageName:
Label:
en: packageName
zh-cn: the description in Chinese
Type: String
AssociationProperty: 'ALIYUN::OOS::Package::PackageName'
AssociationPropertyMetadata:
RegionId: regionId
packageVersion:
Label:
en: packageVersion
zh-cn: the description in Chinese
Type: String
AssociationProperty: 'ALIYUN::OOS::Package::PackageVersion'
AssociationPropertyMetadata:
TemplateName: ${packageName}
Default: ''
targets:
Type: Json
Label:
en: TargetInstance
zh-cn: the description in Chinese
AssociationProperty: Targets
AssociationPropertyMetadata:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: regionId
rateControl:
Label:
en: RateControl
zh-cn: the description in Chinese
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: the description in Chinese
Type: String
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getInstance
Description:
en: Views the ECS instances
zh-cn: the description in Chinese
Action: 'ACS::SelectTargets'
Properties:
ResourceType: 'ALIYUN::ECS::Instance'
RegionId: '{{ regionId }}'
Filters:
- '{{ targets }}'
Outputs:
instanceIds:
Type: List
ValueSelector: 'Instances.Instance[].InstanceId'
- Name: configurePackage
Description:
en: Configure Package
zh-cn: the description in Chinese
Action: 'ACS::ECS::ConfigureOOSPackage'
Properties:
regionId: '{{ regionId }}'
instanceId: '{{ ACS::TaskLoopItem }}'
action: '{{ action }}'
packageName: '{{ packageName }}'
packageVersion: '{{ packageVersion }}'
Loop:
Items: '{{ getInstance.instanceIds }}'
RateControl: '{{ rateControl }}'
Outputs:
commandOutputs:
AggregateType: 'Fn::ListJoin'
AggregateField: commandOutput
Outputs:
commandOutput:
Type: String
ValueSelector: '.|{"InstanceId": "{{ ACS::TaskLoopItem }}", "ConfigureResult": .commandOutput}'
Outputs:
commandOutput:
Type: List
Value: '{{ configurePackage.commandOutputs }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- packageName
- action
- packageVersion
Label:
default:
zh-cn: the description in Chinese
en: Configure Parameters
- Parameters:
- regionId
- targets
Label:
default:
zh-cn: the description in Chinese
en: Select Instances
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: the description in Chinese
en: Control Options