All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::ImageComponent

最終更新日:Apr 12, 2024

ALIYUN::ECS::ImageComponent is used to create an image component.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

ComponentType

String

No

No

The type of the image component.

Only image build components are supported.

Set the value to Build.

Description

String

No

No

The description.

The description must be 2 to 256 characters in length. It can contain letters and cannot start with http:// or https://.

ResourceGroupId

String

No

No

The ID of the resource group.

None.

Content

String

Yes

No

The content of the image component.

The content consist of up to 127 commands. For more information about supported commands and command formats, see Commands supported by Image Builder.

SystemType

String

No

No

The OS that is supported by the image component.

Only Linux is supported.

Set the value to Linux.

Tags

List

No

No

The tags.

You can add up to 20 tags. For more information, see Tags properties.

Name

String

No

No

The name of the image component.

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 leave Name empty, the return value of ImageComponentId is used as the name of the image component by default.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The tag value.

The tag value can be an empty string. The tag value can be up to 128 characters in length, and cannot start with acs:. It cannot contain http:// or https://.

Key

String

No

No

The tag key.

The tag key cannot be an empty string. The tag key can be up to 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

Return values

Fn::GetAtt

ImageComponentId: the ID of the image component.

Examples

  • YAML format

    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 format

    {
      "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"
            ]
          }
        }
      }
    }