Todos os produtos
Search
Central de documentação

CloudOps Orchestration Service:ACS-ECS-RunRemoteShellScript

Última atualização: Jun 28, 2026

Nome do modelo

ACS-ECS-RunRemoteShellScript: Baixa um script shell do OSS para uma instância ECS e o executa

Executar agora

Descrição do modelo

Baixa um script shell do Object Storage Service (OSS) para uma instância ECS e o executa por meio do Cloud Assistant.

Tipo de modelo

Automation

Proprietário

Alibaba Cloud

Parâmetros de entrada

Nome do parâmetro

Descrição

Tipo

Obrigatório

Valor padrão

Restrições

instanceId

O ID da instância ECS onde o script será executado.

String

Sim

instanceRole

A função RAM associada à instância.

String

Sim

fileName

O nome do arquivo de script shell a ser executado.

String

Sim

srcUrl

O diretório no OSS onde o arquivo de script está armazenado.

String

Sim

destUrl

O diretório de destino na instância ECS para onde o arquivo de script é copiado.

String

Sim

regionId

O ID da região.

String

Não

{{ ACS::RegionId }}

workingDir

O diretório de trabalho na instância onde o comando é executado.

String

Não

/root

timeout

O tempo limite máximo para execução do comando. Unidade: segundos.

Number

Não

600

OOSAssumeRole

A função RAM que o OOS assume para executar este modelo.

String

Não

“”

Parâmetros de saída

Nome do parâmetro

Descrição

Tipo

commandOutput

String

Política de acesso necessária para este modelo

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

Detalhes

Detalhes do ACS-ECS-RunRemoteShellScript

Conteúdo do modelo

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

Instruções

  1. Leia o conteúdo em inglês para compreender O QUE precisa ser comunicado

  2. Escreva o texto em português do Brasil DO ZERO — esqueça a estrutura das frases em inglês

  3. Preserve toda a formatação markdown, blocos de código, links e imagens exatamente como estão

  4. Tags xref (<a data-tag="xref" ...>texto</a>) — preserve a tag INTEIRA com todos os atributos na ordem e caixa originais, traduza APENAS o texto visível entre > e

  5. Aplique todas as regras específicas do idioma rigorosamente

  6. Aplique as regras de stopwords com tolerância zero

  7. Use o modo imperativo em passos numerados e listas de procedimentos

  8. Garanta a consistência terminológica — o mesmo termo deve ter a mesma tradução em todo o documento

  9. Varie os inícios de frase em listas e tabelas — nenhum início deve se repetir mais de 3 vezes

  10. Retorne APENAS o documento markdown em português do Brasil, sem explicações