Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-LOG-BulkyInstallLogtail

Dernière mise à jour :Aug 11, 2026

Installez l'agent Logtail par lot sur plusieurs instances ECS via OOS.

Nom du modèle

ACS-LOG-BulkyInstallLogtail

Exécuter maintenant

Description du modèle

Installez l'agent Logtail simultanément sur plusieurs instances Elastic Compute Service (ECS).

Type de modèle

Automatisé

Propriétaire

Alibaba Cloud

Paramètres d'entrée

Paramètre

Description

Type de données

Obligatoire

Valeur par défaut

Limite

targets

Les instances ECS cibles.

Json

Oui

regionId

L'ID de la région.

String

Non

{{ ACS::RegionId }}

action

Le type d'opération.

String

Non

install

overwrite

Indique s'il faut écraser les configurations Logtail existantes sur vos instances ECS.

String

Non

false

rateControl

Les paramètres de contrôle du débit.

Json

Non

{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}

OOSAssumeRole

Le rôle RAM assumé par CloudOps Orchestration Service (OOS).

String

Non

""

Paramètres de sortie

Paramètre

Description

Type de données

commandOutput

String

Stratégie d'autorisation requise pour exécuter le modèle

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeInstances",
                "ecs:DescribeInvocationResults",
                "ecs:DescribeInvocations",
                "ecs:InvokeCommand"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Références

ACS-LOG-BulkyInstallLogtail

Contenu du modèle

FormatVersion: OOS-2019-06-01
Description:
  en: Use this template to install sls logtail on ecs  
  name-en: ACS-LOG-BulkyInstallLogtail  
  categories:
    - run_command
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId       
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  action:
    Type: String
    Label:
      en: Action      
    AllowedValues:
      - install
      - upgrade
      - uninstall
    Default: install
  overwrite:
    Description:
      en: If Logtail exists in the instance, choose whether to overwrite Logtail(Default no).   
    Label:
      en: Overwrite      
    Type: String
    AllowedValues:
      - 'true'
      - 'false'
    Default: 'false'
  targets:
    Type: Json
    Label:
      en: TargetInstance
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: ALIYUN::ECS::Instance
      RegionId: regionId
  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: Views the ECS instances       
    Action: ACS::SelectTargets
    Properties:
      ResourceType: ALIYUN::ECS::Instance
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: Instances.Instance[].InstanceId
      instanceInfos:
        Type: List
        ValueSelector: .Instances.Instance[] | {"osType":.OSType, "instanceId":.InstanceId}
  - Name: invokeCommand
    Action: ACS::ECS::InvokeCommand
    Properties:
      instanceId: '{{ ACS::TaskLoopItem }}'
      regionId: '{{ regionId }}'
      parameters:
        regionid: '{{ regionId }}'
        action: '{{ action }}'
        overwrite: '{{ overwrite }}'
      commandId:
        Fn::If:
          - Fn::Equals:
              - Fn::Jq:
                  - First
                  - .|map(select(.instanceId == "{{ ACS::TaskLoopItem }}").osType)[]
                  - '{{ getInstance.instanceInfos }}'
              - linux
          - cmd-ACS-LOG-InstallLogtail-for-linux.sh
          - cmd-ACS-LOG-InstallLogtail-for-windows.ps1
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        commandOutputs:
          AggregateType: 'Fn::ListJoin'
          AggregateField: commandOutput
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: invocationOutput
Outputs:
  commandOutput:
    Type: String
    Value: '{{ invokeCommand.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - action
          - overwrite
        Label:
          default:             
            en: Configure Parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:             
            en: Select Ecs Instances
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:            
            en: Control Options