Tous les produits
Search
Centre de documentation

CloudOps Orchestration Service:ACS-ECS-BulkyDownloadFile

Dernière mise à jour :Aug 11, 2026

Nom du modèle

ACS-ECS-BulkyDownloadFile

Execute Now

Description du modèle

Télécharge des fichiers en masse sur plusieurs instances ECS. Utilisez ce modèle pour les déploiements d'applications, la synchronisation des données ou tout autre scénario nécessitant la distribution de fichiers entre plusieurs instances. Spécifiez la région (regionId), les instances cibles (targets), le type de source du fichier (sourceType : local, OSS ou HTTPS) et le chemin du fichier (sourcePath). Le modèle renvoie les résultats du téléchargement à des fins de vérification.

Type de modèle

Automatisé

Propriétaire

Alibaba Cloud

Paramètres d'entrée

Paramètre

Description

Type

Requis

Valeur par défaut

Limite

targets

Instances ECS cibles

Json

Oui

sourcePath

Chemin du fichier

String

Oui

regionId

ID de région

String

Non

{{ ACS::RegionId }}

sourceType

Type de source du fichier

String

Non

local

destinationDir

Répertoire de destination sur l'instance

String

Non

/root

timeout

Délai d'expiration en secondes

Number

Non

600

fileOwner

Propriétaire du fichier

String

Non

""

fileGroup

Groupe du fichier

String

Non

""

fileMode

Autorisations du fichier

String

Non

""

overwrite

Indique s'il faut écraser les fichiers existants

Boolean

Non

True

rateControl

Paramètres de contrôle de la concurrence

Json

Non

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

OOSAssumeRole

Rôle RAM assumé par OOS

String

Non

""

Paramètres de sortie

Paramètre

Description

Type

commandOutput

String

Autorisations requises

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

Détails

Consultez le code source du modèle sur GitHub : ACS-ECS-BulkyDownloadFile.yml.

Contenu du modèle

Precautions: To download files over HTTPS, the ECS instance must have public network access enabled.To download files from OSS, a RAM role must be configured for the ECS instance. For more information, see this document.Note To download files using HTTPS, the ECS instance must have public network access.To download files using OSS, the ECS instance must have a RAM role configured. For more information, see the referenced document.
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
      Status: Running
  sourceType:
    Type: String
    Description:
      en: The size of a local file to be uploaded cannot exceed 500 MB.
      zh-cn: The size of a local file to be uploaded cannot exceed 500 MB.
    Label:
      en: Source type
      zh-cn: Source type
    AllowedValues:
      - local
      - oss
      - https
    Default: local
    AssociationPropertyMetadata:
      LocaleKey: DownloadFileType
      RegionId: ${regionId}
  sourcePath:
    Type: String
    Label:
      en: Source path
      zh-cn: Select file
    AssociationProperty: ALIYUN::OOS::File::FileUrl
    AssociationPropertyMetadata:
      FileType: ${sourceType}
      RegionId: ${regionId}
  destinationDir:
    Label:
      en: Destination directory
      zh-cn: Destination directory
    Description:
      en: <li class="Li">The full path to save the file on the target instance. For example, /root for Linux or E:// for Windows.
      zh-cn: The full path to save the file on the target instance. For example, /root for Linux or E:// for Windows.
    Type: String
    Default: /root
  timeout:
    Label:
      en: Timeout (s)
      zh-cn: Timeout (s)
    Type: Number
    Default: 600
  fileOwner:
    Label:
      en: File owner
      zh-cn: File owner
    Type: String
    Default: ''
  fileGroup:
    Label:
      en: File group
      zh-cn: File group
    Type: String
    Default: ''
  fileMode:
    Label:
      en: File mode
      zh-cn: File mode
    Type: String
    Default: ''
  overwrite:
    Label:
      en: Overwrite existing file
      zh-cn: Overwrite existing file
    Type: Boolean
    Default: true
  rateControl:
    Label:
      en: Concurrency rate for task execution
      zh-cn: Concurrency rate for task execution
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: RAM role for OOS to assume
      zh-cn: RAM role for OOS to assume
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Gets the specified ECS instances
      zh-cn: Gets the specified ECS instances
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'
  - Name: downloadFileToInstances
    Action: 'ACS::ECS::DownloadFile'
    Description:
      en: Downloads a file to the specified ECS instances
      zh-cn: Downloads a file to the specified ECS instances
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      sourceType: '{{ sourceType }}'
      sourcePath: '{{ sourcePath }}'
      destinationDir: '{{ destinationDir }}'
      timeout: '{{ timeout }}'
      fileOwner: '{{ fileOwner }}'
      fileGroup: '{{ fileGroup }}'
      fileMode: '{{ fileMode }}'
      overwrite: '{{ overwrite }}'
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        commandOutputs:
          AggregateType: 'Fn::ListJoin'
          AggregateField: commandOutput
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: commandOutput
Outputs:
  commandOutput:
    Type: String
    Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - sourceType
          - sourcePath
          - destinationDir
        Label:
          default:
            zh-cn: Configure parameters
            en: Configure parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            zh-cn: Select instances
            en: Select instances
      - Parameters:
          - timeout
          - fileOwner
          - fileGroup
          - fileMode
          - overwrite
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced options
            en: Advanced options

    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
      Status: Running
  sourceType:
    Type: String
    Description:
      en: The size of a local file cannot exceed 500 MB.
    Label:
      en: Source type
    AllowedValues:
      - local
      - oss
      - https
    Default: local
    AssociationPropertyMetadata:
      LocaleKey: DownloadFileType
      RegionId: ${regionId}
  sourcePath:
    Type: String
    Label:
      en: Source path
    AssociationProperty: ALIYUN::OOS::File::FileUrl
    AssociationPropertyMetadata:
      FileType: ${sourceType}
      RegionId: ${regionId}
  destinationDir:
    Label:
      en: Destination directory
    Description:
      en: 
    Type: String
    Default: /root
  timeout:
    Label:
      en: Timeout (s)
    Type: Number
    Default: 600
  fileOwner:
    Label:
      en: File owner
    Type: String
    Default: ''
  fileGroup:
    Label:
      en: File group
    Type: String
    Default: ''
  fileMode:
    Label:
      en: File mode
    Type: String
    Default: ''
  overwrite:
    Label:
      en: Overwrite existing file
    Type: Boolean
    Default: true
  rateControl:
    Label:
      en: Rate control
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOS assume role
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: getInstance
    Description:
      en: Gets the specified ECS instances.
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'
  - Name: downloadFileToInstances
    Action: 'ACS::ECS::DownloadFile'
    Description:
      en: Downloads the file to the specified instances.
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      sourceType: '{{ sourceType }}'
      sourcePath: '{{ sourcePath }}'
      destinationDir: '{{ destinationDir }}'
      timeout: '{{ timeout }}'
      fileOwner: '{{ fileOwner }}'
      fileGroup: '{{ fileGroup }}'
      fileMode: '{{ fileMode }}'
      overwrite: '{{ overwrite }}'
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        commandOutputs:
          AggregateType: 'Fn::ListJoin'
          AggregateField: commandOutput
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: commandOutput
Outputs:
  commandOutput:
    Type: String
    Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - sourceType
          - sourcePath
          - destinationDir
        Label:
          default:
            en: Configure parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            en: Select instances
      - Parameters:
          - timeout
          - fileOwner
          - fileGroup
          - fileMode
          - overwrite
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            en: Advanced options
FormatVersion: OOS-2019-06-01
Description:
  en: 'Bulky upload files to multiple Alibaba Cloud ECS instances, applicable to scenarios that require distributing files across multiple instances, such as application deployment and data synchronization. During configuration, users need to provide the following required parameter information: Region ID (regionId), which specifies the region of the target ECS instances where the files will be uploaded, Target Instances (targets), which defines the specific ECS instances to be operated on, Source Type (sourceType), which specifies the source method of the file (e.g., local, OSS, or HTTPS), and Source Path (sourcePath), which is the exact location of the file. Upon execution, the template provides the results of the file upload operation, enabling users to verify the status of the file uploads.'
  name-en: Upload File
  categories:
    - instance_manage
    - application_manage
    - computenest
    - tag_operate_resource
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  targets:
    Type: Json
    Label:
      en: TargetInstance
    Description:
      en: <p class="p">Notes:</p> <ul class="ul"> <li class="li"><font color='red'>To download files over HTTPS, the ECS instance must have public network access.</font></li><li class="li"><font color='red'>To download files from OSS, the ECS instance must have a RAM role attached. For more information, see <a href="https://www.alibabacloud.com/help/en/operation-orchestration-service/latest/download-multiple-objects-to-an-instance#vOk3w">the related documentation</a>.</font></li></ul>
    AssociationProperty: Targets
    AssociationPropertyMetadata:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: regionId
      Status: Running
  sourceType:
    Type: String
    Description:
      en: The size of a file uploaded from a local machine cannot exceed 500 MB.
    Label:
      en: SourceType
    AllowedValues:
      - local
      - oss
      - https
    Default: local
    AssociationPropertyMetadata:
      LocaleKey: DownloadFileType
      RegionId: ${regionId}
  sourcePath:
    Type: String
    Label:
      en: SourcePath
    AssociationProperty: ALIYUN::OOS::File::FileUrl
    AssociationPropertyMetadata:
      FileType: ${sourceType}
      RegionId: ${regionId}
  destinationDir:
    Label:
      en: DestinationDir
    Description:
      en: The full path on the target instance where the file is saved. Examples: /root for Linux, E:// for Windows.
    Type: String
    Default: /root
  timeout:
    Label:
      en: Timeout (s)
    Type: Number
    Default: 600
  fileOwner:
    Label:
      en: FileOwner
    Type: String
    Default: ''
  fileGroup:
    Label:
      en: FileGroup
    Type: String
    Default: ''
  fileMode:
    Label:
      en: FileMode
    Type: String
    Default: ''
  overwrite:
    Label:
      en: Overwrite
    Type: Boolean
    Default: true
  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: Retrieves the specified ECS instances.
    Action: 'ACS::SelectTargets'
    Properties:
      ResourceType: 'ALIYUN::ECS::Instance'
      RegionId: '{{ regionId }}'
      Filters:
        - '{{ targets }}'
    Outputs:
      instanceIds:
        Type: List
        ValueSelector: 'Instances.Instance[].InstanceId'
  - Name: downloadFileToInstances
    Action: 'ACS::ECS::DownloadFile'
    Description:
      en: Downloads the file to the specified ECS instances.
    Properties:
      regionId: '{{ regionId }}'
      instanceId: '{{ ACS::TaskLoopItem }}'
      sourceType: '{{ sourceType }}'
      sourcePath: '{{ sourcePath }}'
      destinationDir: '{{ destinationDir }}'
      timeout: '{{ timeout }}'
      fileOwner: '{{ fileOwner }}'
      fileGroup: '{{ fileGroup }}'
      fileMode: '{{ fileMode }}'
      overwrite: '{{ overwrite }}'
    Loop:
      Items: '{{ getInstance.instanceIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        commandOutputs:
          AggregateType: 'Fn::ListJoin'
          AggregateField: commandOutput
    Outputs:
      commandOutput:
        Type: String
        ValueSelector: commandOutput
Outputs:
  commandOutput:
    Type: String
    Value: '{{ downloadFileToInstances.commandOutputs }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - sourceType
          - sourcePath
          - destinationDir
        Label:
          default:
            en: Configure Parameters
      - Parameters:
          - regionId
          - targets
        Label:
          default:
            en: Select Instances
      - Parameters:
          - timeout
          - fileOwner
          - fileGroup
          - fileMode
          - overwrite
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            en: Control Options