Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ECS::ImageComponent

Última atualização: Jun 27, 2026

Cria um componente de imagem.

Sintaxe

{
  "Type": "ALIYUN::ECS::ImageComponent",
  "Properties": {
    "ComponentType": String,
    "Description": String,
    "ResourceGroupId": String,
    "Content": String,
    "SystemType": String,
    "Tags": List,
    "Name": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

ComponentType

String

Não

Não

Tipo do componente de imagem.

Há suporte apenas para componentes de criação de imagem.

Defina o valor como Build.

Description

String

Não

Não

Descrição.

A descrição deve ter de 2 a 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.

Content

String

Sim

Não

Conteúdo do componente de imagem.

O conteúdo consiste em até 127 comandos. Para obter mais informações sobre os comandos compatíveis e seus formatos, consulte Comandos compatíveis com o Image Builder.

SystemType

String

Não

Não

Sistema operacional compatível com o componente de imagem.

Há suporte apenas para Linux.

Defina o valor como Linux.

Tags

List

Não

Não

Tags.

Adicione até 20 tags. Para obter mais informações, consulte Propriedades de Tags.

Name

String

Não

Não

Nome do componente de imagem.

O nome deve ter de 2 a 128 caracteres. Deve começar com uma letra e não pode iniciar com http:// ou https://. Pode conter letras, dígitos, dois-pontos (:), sublinhados (_), pontos (.) e hifens (-).

Nota

Se Name for deixado em branco, o valor retornado de ImageComponentId será usado como nome do componente de imagem por padrão.

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.

O valor da tag pode ser uma string vazia. Deve ter no máximo 128 caracteres e não pode começar com acs:. Não pode conter http:// ou https://.

Key

String

Não

Não

Chave da tag.

A chave da tag não pode ser uma string vazia. Deve ter no máximo 128 caracteres e não pode começar com aliyun ou acs:. Não pode conter http:// ou https://.

Valores de retorno

Fn::GetAtt

ImageComponentId: ID do componente de imagem.

Exemplos

  • YAML formato

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ComponentType:
        AllowedValues:
        - Build
        Default: Build
        Description:
          en: 'The type of the image component. Only image build components are supported.
            Set the value to Build.Default value: Build.'
        Required: false
        Type: String
      Content:
        Description:
          en: The content of the image component. The content consists of up to 127 commands.
        Required: true
        Type: String
      Description:
        AssociationProperty: TextArea
        Description:
          en: The description. The description must be 2 to 256 characters in length and
            cannot start with http:// or https://.
        Required: false
        Type: String
      Name:
        Description:
          en: 'The component name. The name must be 2 to 128 characters in length. The
            name must start with a letter but cannot start with http:// or https://.The
            name can contain letters, digits, colons (:), underscores (_), periods (.),
            and hyphens (-).
    
            Note If you do not configure Name, the return value of ImageComponentId is
            used.'
        Required: false
        Type: String
      ResourceGroupId:
        AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId
        Description:
          en: The ID of the resource group.
        Required: false
        Type: String
      SystemType:
        AllowedValues:
        - Linux
        Default: Linux
        Description:
          en: 'The operating system type supported by the image component. Only Linux
            is supported. Set the value to Linux.Default value: Linux.'
        Required: false
        Type: String
      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
    Resources:
      ImageComponent:
        Properties:
          ComponentType:
            Ref: ComponentType
          Content:
            Ref: Content
          Description:
            Ref: Description
          Name:
            Ref: Name
          ResourceGroupId:
            Ref: ResourceGroupId
          SystemType:
            Ref: SystemType
          Tags:
            Ref: Tags
        Type: ALIYUN::ECS::ImageComponent
    Outputs:
      ImageComponentId:
        Description: The ID of the image component.
        Value:
          Fn::GetAtt:
          - ImageComponent
          - ImageComponentId
                            
  • JSON formato

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ComponentType": {
          "Type": "String",
          "Description": {
            "en": "The type of the image component. Only image build components are supported. Set the value to Build.Default value: Build."
          },
          "AllowedValues": [
            "Build"
          ],
          "Required": false,
          "Default": "Build"
        },
        "Description": {
          "AssociationProperty": "TextArea",
          "Type": "String",
          "Description": {
            "en": "The description. The description must be 2 to 256 characters in length and 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
        },
        "Content": {
          "Type": "String",
          "Description": {
            "en": "The content of the image component. The content consists of up to 127 commands."
          },
          "Required": true
        },
        "SystemType": {
          "Type": "String",
          "Description": {
            "en": "The operating system type supported by the image component. Only Linux is supported. Set the value to Linux.Default value: Linux."
          },
          "AllowedValues": [
            "Linux"
          ],
          "Required": false,
          "Default": "Linux"
        },
        "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
        },
        "Name": {
          "Type": "String",
          "Description": {
            "en": "The component name. The name must be 2 to 128 characters in length. The name must start with a letter but cannot start with http:// or https://.The name can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).\nNote If you do not configure Name, the return value of ImageComponentId is used."
          },
          "Required": false
        }
      },
      "Resources": {
        "ImageComponent": {
          "Type": "ALIYUN::ECS::ImageComponent",
          "Properties": {
            "ComponentType": {
              "Ref": "ComponentType"
            },
            "Description": {
              "Ref": "Description"
            },
            "ResourceGroupId": {
              "Ref": "ResourceGroupId"
            },
            "Content": {
              "Ref": "Content"
            },
            "SystemType": {
              "Ref": "SystemType"
            },
            "Tags": {
              "Ref": "Tags"
            },
            "Name": {
              "Ref": "Name"
            }
          }
        }
      },
      "Outputs": {
        "ImageComponentId": {
          "Description": "The ID of the image component.",
          "Value": {
            "Fn::GetAtt": [
              "ImageComponent",
              "ImageComponentId"
            ]
          }
        }
      }
    }