Todos os produtos
Search
Central de documentação

CloudOps Orchestration Service:ACS-ECS-BulkyCopyImage

Última atualização: Jun 28, 2026

Nome do modelo

ACS-ECS-BulkyCopyImage: Clona imagens em lote entre regiões

Executar agora

Descrição do modelo

Clona uma imagem para várias regiões simultaneamente.

Tipo de modelo

Automatizado

Proprietário

Alibaba Cloud

Parâmetros de entrada

Parâmetro

Descrição

Tipo

Obrigatório

Valor padrão

Limite

imageId

ID da imagem de origem.

String

Sim

regionId

ID da região.

String

Não

{{ ACS::RegionId }}

targetImageName

Nome da imagem de destino.

String

Não

""

targetImageDescription

ID da região de destino.

String

Não

['all-regions']

targetRegionIds

IDs das regiões de destino.

List

Não

['all-regions']

rateControl

Configurações de controle de taxa.

Json

Não

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

OOSAssumeRole

Função do Resource Access Management (RAM) assumida pelo CloudOps Orchestration Service (OOS).

String

Não

""

Parâmetros de saída

Parâmetro

Descrição

Tipo

imageIds

List

Política de permissões necessária para executar o modelo

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:CopyImage",
                "ecs:DescribeImages",
                "ecs:DescribeRegions"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Detalhes

Para obter mais informações, consulte ACS-ECS-BulkyCopyImage.yml no GitHub.

Conteúdo do modelo

FormatVersion: OOS-2019-06-01
Description:
  en: Cross Regions copy image
  zh-cn: Copies images to multiple regions in batches.
  name-en: ACS-ECS-BulkyCopyImage
  name-zh-cn: BatchCopyImagesAcrossRegions
  categories:
    - image_manage
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  imageId:
    Label:
      en: ImageId
      zh-cn: Source Image ID
    Type: String
    AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
    AssociationPropertyMetadata:
      RegionId: regionId
      SupportedImageOwnerAlias:
        - self
  targetImageName:
    Label:
      en: Target image name
      zh-cn: Destination Image Name
    Type: String
    Default: ''
  targetImageDescription:
    Label:
      en: Target image description
      zh-cn: Image Description
    Type: String
    Default: ''
  targetRegionIds:
    Label:
      en: TargetRegionIds
      zh-cn: Destination Region IDs
    Type: List
    AllowedValues:
      - all-regions
      - cn-hangzhou
      - cn-shanghai
      - cn-nanjing
      - cn-qingdao
      - cn-beijing
      - cn-zhangjiakou
      - cn-huhehaote
      - cn-wulanchabu
      - cn-shenzhen
      - cn-heyuan
      - cn-guangzhou
      - cn-chengdu
      - cn-wuhan-lr
      - cn-fuzhou
      - cn-hongkong
      - ap-northeast-1
      - ap-northeast-2
      - ap-southeast-1
      - ap-southeast-2
      - ap-southeast-3
      - ap-southeast-5
      - ap-southeast-6
      - ap-southeast-7
      - ap-south-1
      - eu-central-1
      - eu-west-1
      - us-west-1
      - us-east-1
      - me-east-1
      - me-central-1
      - na-south-1
      - us-southeast-1
    Default:
      - all-regions
  rateControl:
    Label:
      en: RateControl
      zh-cn: Concurrency Control
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 5
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: OOS Assume Role
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: queryAllAvailableRegions
    Action: 'ACS::ExecuteAPI'
    Description:
      en: View all available regions
      zh-cn: Queries all available regions.
    Properties:
      Service: ECS
      API: DescribeRegions
      Parameters:
        RegionId: '{{ACS::RegionId}}'
    Outputs:
      regionIds:
        Type: List
        ValueSelector: >-
          Regions.Region[]|.RegionId|select([scan("{{ACS::RegionId}}|test")]|length<1)
      allRegionsChosen:
        Type: String
        ValueSelector: '.|{{targetRegionIds}}|sort|.[0]'
  - Name: whetherCloneToAllRegions
    Action: 'ACS::Choice'
    Description:
      en: Choose next task by targetRegionIds Chosen
      zh-cn: Determines the next task based on the selected destination regions.
    Properties:
      DefaultTask: copyImage
      Choices:
        - When:
            'Fn::Equals':
              - all-regions
              - '{{ queryAllAvailableRegions.allRegionsChosen }}'
          NextTask: copyImageToAllRegions
  - Name: copyImage
    Action: 'ACS::ECS::CopyImage'
    OnSuccess: 'ACS::END'
    OnError: 'ACS::END'
    Description:
      en: Copy image to regions chosen
      zh-cn: Copies the image to the specified regions.
    Properties:
      regionId: '{{ regionId }}'
      imageId: '{{ imageId }}'
      targetRegionId: '{{ ACS::TaskLoopItem }}'
      targetImageName: '{{ targetImageName }}'
      targetImageDescription: '{{ targetImageDescription }}'
    Loop:
      Items: '{{ targetRegionIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        imageIdsWithRegion:
          AggregateType: 'Fn::ListJoin'
          AggregateField: imageIdWithRegion
    Outputs:
      imageIdWithRegion:
        ValueSelector: '.|(.imageId),"{{ ACS::TaskLoopItem }}"'
        Type: List
  - Name: copyImageToAllRegions
    Action: 'ACS::ECS::CopyImage'
    Description:
      en: Copy image to all available regions
      zh-cn: Copies the image to all available regions.
    Properties:
      regionId: '{{ regionId }}'
      imageId: '{{ imageId }}'
      targetRegionId: '{{ ACS::TaskLoopItem }}'
      targetImageName: '{{ targetImageName }}'
      targetImageDescription: '{{ targetImageDescription }}'
    Loop:
      Items: '{{ queryAllAvailableRegions.regionIds }}'
      RateControl: '{{ rateControl }}'
      Outputs:
        imageIdsWithRegion:
          AggregateType: 'Fn::ListJoin'
          AggregateField: imageIdWithRegion
    Outputs:
      imageIdWithRegion:
        ValueSelector: '.|(.imageId),"{{ ACS::TaskLoopItem }}"'
        Type: List
Outputs:
  imageIds:
    Type: List
    Value:
      'Fn::If':
        - 'Fn::Equals':
            - all-regions
            - '{{ queryAllAvailableRegions.allRegionsChosen }}'
        - '{{ copyImageToAllRegions.imageIdsWithRegion }}'
        - '{{ copyImage.imageIdsWithRegion }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - regionId
          - imageId
          - targetRegionIds
          - targetImageName
          - targetImageDescription
        Label:
          default:
            zh-cn: Configure Parameters
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced Options
            en: Advanced Options