Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ECS::ImagePipeline

Última atualização: Jun 27, 2026

Cria um modelo de imagem para compilar imagens personalizadas do ECS.

Sintaxe

{
  "Type": "ALIYUN::ECS::ImagePipeline",
  "Properties": {
    "BaseImageType": String,
    "Description": String,
    "ResourceGroupId": String,
    "SystemDiskSize": Integer,
    "VSwitchId": String,
    "AddAccount": List,
    "Name": String,
    "ExecutePipeline": Boolean,
    "DeleteInstanceOnFailure": Boolean,
    "ImageName": String,
    "ToRegionId": List,
    "InternetMaxBandwidthOut": Integer,
    "InstanceType": String,
    "Tags": List,
    "BuildContent": String,
    "BaseImage": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

BaseImageType

String

Sim

Não

Tipo da imagem de source.

Valores válidos:

  • IMAGE

  • IMAGE_FAMILY

Description

String

Não

Não

Descrição do modelo.

Deve ter entre 2 e 256 caracteres. Pode conter letras, mas não pode começar com http:// ou https://.

ResourceGroupId

String

Não

Não

ID do grupo de recursos.

Nenhuma.

SystemDiskSize

Integer

Não

Não

Tamanho do disco de sistema da instância intermediária.

Unidade: GiB.

Valores válidos: 20 a 500.

Valor padrão: 40.

VSwitchId

String

Não

Não

ID do vSwitch na Virtual Private Cloud (VPC).

Se você não especificar esta propriedade, o sistema criará uma nova VPC e um novo vSwitch. Verifique se sua conta possui cotas de VPC suficientes. Para mais informações, consulte Limites e cotas.

AddAccount

List

Não

Não

IDs das contas Alibaba Cloud com as quais compartilhar a imagem criada por este modelo.

É possível especificar até 20 IDs de conta.

Name

String

Não

Não

Nome do modelo de imagem.

Deve ter entre 2 e 128 caracteres. Precisa começar com uma letra e não pode iniciar com http:// ou https://. Aceita letras, dígitos, dois-pontos (:), sublinhados (_), pontos (.) e hífens (-).

Nota

Caso Name não seja especificado, o valor de retorno de ImagePipelineId será usado por padrão.

ExecutePipeline

Boolean

Não

Não

Define se a tarefa de compilação da imagem deve ser executada após a criação do modelo.

Valores válidos:

  • true (padrão)

  • false

DeleteInstanceOnFailure

Boolean

Não

Não

Indica se a instância intermediária deve ser liberada em caso de falha na criação da imagem.

Valores válidos:

  • true (padrão)

  • false

Nota

Se a instância intermediária não conseguir iniciar, ela será liberada automaticamente.

ImageName

String

Não

Não

Prefixo do nome da imagem gerada por este modelo.

O prefixo deve ter entre 2 e 64 caracteres, começar com uma letra e não pode iniciar com http:// ou https://. Pode incluir letras, dígitos, dois-pontos (:), sublinhados (_), pontos (.) e hífens (-).

O sistema gera o nome final da imagem combinando o prefixo especificado com o ID da tarefa de compilação (ExecutionId), no formato {ImageName}_{ExecutionId}.

ToRegionId

List

Não

Não

IDs das regiões para onde distribuir a imagem criada a partir deste modelo.

Permite especificar até 20 IDs de região. Sem essa definição, a imagem será criada apenas na região atual.

InternetMaxBandwidthOut

Integer

Não

Não

Largura de banda pública de saída da instância intermediária.

Unidade: Mbit/s.

Valores válidos: 0 a 100.

Valor padrão: 0.

InstanceType

String

Não

Não

Tipo da instância.

Chame a API DescribeInstanceTypes para consultar os tipos disponíveis.

Na ausência desta propriedade, o sistema seleciona automaticamente o tipo com menos vCPUs e memória, respeitando a disponibilidade de recursos.

Por exemplo, o tipo ecs.g6.large é escolhido por padrão. Se não houver recursos suficientes para ecs.g6.large, o sistema tentará usar ecs.g6.xlarge.

Tags

List

Não

Não

Tags associadas ao recurso.

Limite de 20 tags. Consulte Propriedades de Tags para detalhes.

BuildContent

String

Não

Não

Conteúdo do modelo de imagem.

Tamanho máximo de 16 KB, suportando até 127 comandos.

BaseImage

String

Sim

Não

Imagem de source.

Quando BaseImageType for IMAGE, defina BaseImage como o ID de uma imagem.

Quando BaseImageType for IMAGE_FAMILY, defina BaseImage como o nome de uma família de imagens.

Sintaxe de Tags

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Propriedades de Tags

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Value

String

Não

Não

Valor da tag.

Pode ser uma string vazia. Tamanho máximo de 128 caracteres. Não pode começar com acs:. Não pode conter http:// ou https://.

Key

String

Não

Não

Chave da tag.

Não pode ser uma string vazia. Tamanho máximo de 128 caracteres. Não pode começar com aliyun ou acs:. Não pode conter http:// ou https://.

Valores de retorno

Fn::GetAtt

ImagePipelineId: ID do modelo de imagem.

Exemplos

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      AddAccount:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            Description:
              en: The ID of Ali account.
            Required: false
            Type: String
        Description:
          en: The IDs of Alibaba Cloud accounts to which to share the image that will
            be created based on the image template. You can specify up to 20 account IDs.
        MaxLength: 20
        Required: false
        Type: Json
      BaseImage:
        Description:
          en: 'The source image.
    
            If you set BaseImageType to IMAGE, set the BaseImage parameter to the ID of
            a custom image.
    
            If you set BaseImageType to IMAGE_FAMILY, set the BaseImage parameter to the
            name of an image family.'
        Required: true
        Type: String
      BaseImageType:
        AllowedValues:
        - IMAGE
        - IMAGE_FAMILY
        Description:
          en: 'The type of the source image. Valid values:
    
            IMAGE: image
    
            IMAGE_FAMILY: image family'
        Required: true
        Type: String
      BuildContent:
        Description:
          en: The content of the image template. The content cannot exceed 16 KB in size
            and can contain up to 127 commands. For more information about the commands
            that are supported, see the "Usage notes" section of this topic.
        Required: false
        Type: String
      DeleteInstanceOnFailure:
        Description:
          en: 'Specifies whether to release the intermediate instance when the image cannot
            be created. Valid values:
    
            true
    
            false
    
            Default value: true.
    
            Note If the intermediate instance cannot be started, the instance is released
            by default.'
        Required: false
        Type: Boolean
      Description:
        AssociationProperty: TextArea
        Description:
          en: The description of the image template. The description must be 2 to 256
            characters in length. It cannot start with http:// or https://.
        Required: false
        Type: String
      ExecutePipeline:
        Default: true
        Description:
          en: Whether execute pipeline. Default value is true
        Required: false
        Type: Boolean
      ImageName:
        Description:
          en: 'The prefix of the image name. The prefix must be 2 to 64 characters in
            length. It must start with a letter and cannot start with http:// or https://.
            It can contain letters, digits, colons (:), underscores (_), periods (.),
            and hyphens (-).
    
            The system generates the final complete image name that consists of the specified
            prefix and the ID of the build task (ExecutionId) in the format of {ImageName}_{ExecutionId}.'
        Required: false
        Type: String
      InstanceType:
        Description:
          en: 'The instance type. You can call the  DescribeInstanceTypes  to query instance
            types.
    
            If you do not configure this parameter, an instance type that provides the
            fewest vCPUs and memory resources is automatically selected. This configuration
            is subject to resource availability of instance types. For example, the ecs.g6.large
            instance type is automatically selected. If available ecs.g6.large resources
            are insufficient, the ecs.g6.xlarge instance type is selected.'
        Required: false
        Type: String
      InternetMaxBandwidthOut:
        Description:
          en: 'The size of the outbound public bandwidth for the intermediate instance.
            Unit: Mbit/s. Valid values: 0 to 100.
    
            Default value: 0.'
        Required: false
        Type: Number
      Name:
        Description:
          en: 'The name of the image template. The name must be 2 to 128 characters in
            length. It must start with a letter and cannot start with http:// or https://.
            It can contain letters, digits, colons (:), underscores (_), periods (.),
            and hyphens (-).
    
            Note If you do not specify the Name parameter, the return value of ImagePipelineId
            is used.'
        Required: false
        Type: String
      ResourceGroupId:
        AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId
        Description:
          en: The ID of the resource group.
        Required: false
        Type: String
      SystemDiskSize:
        Description:
          en: 'The system disk size of the intermediate instance. Unit: GiB. Valid values:
            20 to 500.
    
            Default value: 40.'
        Required: false
        Type: Number
      Tags:
        AssociationProperty: List[Parameters]
        AssociationPropertyMetadata:
          ListMetadata:
            Order:
            - Key
            - Value
          Parameters:
            Key:
              Description:
                en: 'The key of tag N to add to the capacity reservation. Valid values
                  of N: 1 to 20. The tag key cannot be an empty string. The tag key can
                  be up to 128 characters in length and cannot contain http:// or https://.
                  It cannot start with acs: or aliyun.'
              Required: false
              Type: String
            Value:
              Description:
                en: 'The value of tag N to add to the capacity reservation. Valid values
                  of N: 1 to 20. The tag value can be an empty string. The tag value can
                  be up to 128 characters in length and cannot start with acs:. The tag
                  value cannot contain http:// or https://.'
              Required: false
              Type: String
        MaxLength: 20
        Required: false
        Type: Json
      ToRegionId:
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            Description:
              en: The region ID.
            Required: false
            Type: String
        Description:
          en: 'The IDs of regions to which you want to distribute the image that is created
            based on the image template. You can specify up to 20 region IDs.
    
            If you do not specify this parameter, the image is created only in the current
            region.'
        MaxLength: 20
        Required: false
        Type: Json
      VSwitchId:
        AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
          ZoneId: ${ZoneId}
        Description:
          en: 'The ID of the vSwitch.
    
            If you do not specify this parameter, a new VPC and vSwitch are created. Make
            sure that the VPC quota in your account is sufficient. For more information,
            see Limits and quotas.'
        Required: false
        Type: String
    Resources:
      ImagePipeline:
        Properties:
          AddAccount:
            Ref: AddAccount
          BaseImage:
            Ref: BaseImage
          BaseImageType:
            Ref: BaseImageType
          BuildContent:
            Ref: BuildContent
          DeleteInstanceOnFailure:
            Ref: DeleteInstanceOnFailure
          Description:
            Ref: Description
          ExecutePipeline:
            Ref: ExecutePipeline
          ImageName:
            Ref: ImageName
          InstanceType:
            Ref: InstanceType
          InternetMaxBandwidthOut:
            Ref: InternetMaxBandwidthOut
          Name:
            Ref: Name
          ResourceGroupId:
            Ref: ResourceGroupId
          SystemDiskSize:
            Ref: SystemDiskSize
          Tags:
            Ref: Tags
          ToRegionId:
            Ref: ToRegionId
          VSwitchId:
            Ref: VSwitchId
        Type: ALIYUN::ECS::ImagePipeline
    Outputs:
      ImagePipelineId:
        Description: The ID of the image template.
        Value:
          Fn::GetAtt:
          - ImagePipeline
          - ImagePipelineId
                            
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "BaseImageType": {
          "Type": "String",
          "Description": {
            "en": "The type of the source image. Valid values:\nIMAGE: image\nIMAGE_FAMILY: image family"
          },
          "AllowedValues": [
            "IMAGE",
            "IMAGE_FAMILY"
          ],
          "Required": true
        },
        "Description": {
          "AssociationProperty": "TextArea",
          "Type": "String",
          "Description": {
            "en": "The description of the image template. The description must be 2 to 256 characters in length. It cannot start with http:// or https://."
          },
          "Required": false
        },
        "ResourceGroupId": {
          "AssociationProperty": "ALIYUN::ECS::ResourceGroup::ResourceGroupId",
          "Type": "String",
          "Description": {
            "en": "The ID of the resource group."
          },
          "Required": false
        },
        "SystemDiskSize": {
          "Type": "Number",
          "Description": {
            "en": "The system disk size of the intermediate instance. Unit: GiB. Valid values: 20 to 500.\nDefault value: 40."
          },
          "Required": false
        },
        "VSwitchId": {
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}",
            "ZoneId": "${ZoneId}"
          },
          "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
          "Type": "String",
          "Description": {
            "en": "The ID of the vSwitch.\nIf you do not specify this parameter, a new VPC and vSwitch are created. Make sure that the VPC quota in your account is sufficient. For more information, see Limits and quotas."
          },
          "Required": false
        },
        "AddAccount": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Type": "String",
              "Description": {
                "en": "The ID of Ali account."
              },
              "Required": false
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "The IDs of Alibaba Cloud accounts to which to share the image that will be created based on the image template. You can specify up to 20 account IDs."
          },
          "Required": false,
          "MaxLength": 20
        },
        "Name": {
          "Type": "String",
          "Description": {
            "en": "The name of the image template. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).\nNote If you do not specify the Name parameter, the return value of ImagePipelineId is used."
          },
          "Required": false
        },
        "ExecutePipeline": {
          "Type": "Boolean",
          "Description": {
            "en": "Whether execute pipeline. Default value is true"
          },
          "Required": false,
          "Default": true
        },
        "DeleteInstanceOnFailure": {
          "Type": "Boolean",
          "Description": {
            "en": "Specifies whether to release the intermediate instance when the image cannot be created. Valid values:\ntrue\nfalse\nDefault value: true.\nNote If the intermediate instance cannot be started, the instance is released by default."
          },
          "Required": false
        },
        "ImageName": {
          "Type": "String",
          "Description": {
            "en": "The prefix of the image name. The prefix must be 2 to 64 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).\nThe system generates the final complete image name that consists of the specified prefix and the ID of the build task (ExecutionId) in the format of {ImageName}_{ExecutionId}."
          },
          "Required": false
        },
        "ToRegionId": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Type": "String",
              "Description": {
                "en": "The region ID."
              },
              "Required": false
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "The IDs of regions to which you want to distribute the image that is created based on the image template. You can specify up to 20 region IDs.\nIf you do not specify this parameter, the image is created only in the current region."
          },
          "Required": false,
          "MaxLength": 20
        },
        "InternetMaxBandwidthOut": {
          "Type": "Number",
          "Description": {
            "en": "The size of the outbound public bandwidth for the intermediate instance. Unit: Mbit/s. Valid values: 0 to 100.\nDefault value: 0."
          },
          "Required": false
        },
        "InstanceType": {
          "Type": "String",
          "Description": {
            "en": "The instance type. You can call the  DescribeInstanceTypes  to query instance types.\nIf you do not configure this parameter, an instance type that provides the fewest vCPUs and memory resources is automatically selected. This configuration is subject to resource availability of instance types. For example, the ecs.g6.large instance type is automatically selected. If available ecs.g6.large resources are insufficient, the ecs.g6.xlarge instance type is selected."
          },
          "Required": false
        },
        "Tags": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "Value": {
                "Type": "String",
                "Description": {
                  "en": "The value of tag N to add to the capacity reservation. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs:. The tag value cannot contain http:// or https://."
                },
                "Required": false
              },
              "Key": {
                "Type": "String",
                "Description": {
                  "en": "The key of tag N to add to the capacity reservation. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun."
                },
                "Required": false
              }
            },
            "ListMetadata": {
              "Order": [
                "Key",
                "Value"
              ]
            }
          },
          "AssociationProperty": "List[Parameters]",
          "Type": "Json",
          "Required": false,
          "MaxLength": 20
        },
        "BuildContent": {
          "Type": "String",
          "Description": {
            "en": "The content of the image template. The content cannot exceed 16 KB in size and can contain up to 127 commands. For more information about the commands that are supported, see the \"Usage notes\" section of this topic."
          },
          "Required": false
        },
        "BaseImage": {
          "Type": "String",
          "Description": {
            "en": "The source image.\nIf you set BaseImageType to IMAGE, set the BaseImage parameter to the ID of a custom image.\nIf you set BaseImageType to IMAGE_FAMILY, set the BaseImage parameter to the name of an image family."
          },
          "Required": true
        }
      },
      "Resources": {
        "ImagePipeline": {
          "Type": "ALIYUN::ECS::ImagePipeline",
          "Properties": {
            "BaseImageType": {
              "Ref": "BaseImageType"
            },
            "Description": {
              "Ref": "Description"
            },
            "ResourceGroupId": {
              "Ref": "ResourceGroupId"
            },
            "SystemDiskSize": {
              "Ref": "SystemDiskSize"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            },
            "AddAccount": {
              "Ref": "AddAccount"
            },
            "Name": {
              "Ref": "Name"
            },
            "ExecutePipeline": {
              "Ref": "ExecutePipeline"
            },
            "DeleteInstanceOnFailure": {
              "Ref": "DeleteInstanceOnFailure"
            },
            "ImageName": {
              "Ref": "ImageName"
            },
            "ToRegionId": {
              "Ref": "ToRegionId"
            },
            "InternetMaxBandwidthOut": {
              "Ref": "InternetMaxBandwidthOut"
            },
            "InstanceType": {
              "Ref": "InstanceType"
            },
            "Tags": {
              "Ref": "Tags"
            },
            "BuildContent": {
              "Ref": "BuildContent"
            },
            "BaseImage": {
              "Ref": "BaseImage"
            }
          }
        }
      },
      "Outputs": {
        "ImagePipelineId": {
          "Description": "The ID of the image template.",
          "Value": {
            "Fn::GetAtt": [
              "ImagePipeline",
              "ImagePipelineId"
            ]
          }
        }
      }
    }