ALIYUN::ECS::ImageComponent类型用于创建一个镜像组件。
语法
{
"Type": "ALIYUN::ECS::ImageComponent",
"Properties": {
"ComponentType": String,
"Description": String,
"ResourceGroupId": String,
"Content": String,
"SystemType": String,
"Tags": List,
"Name": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ComponentType | String | 否 | 否 | 组件类型。 | 目前仅支持镜像构建组件。 取值:Build。 |
Description | String | 否 | 否 | 描述信息。 | 长度为2~256个英文或中文字符,不能以 |
ResourceGroupId | String | 否 | 否 | 企业资源组ID。 | 无 |
Content | String | 是 | 否 | 组件内容。 | 由多条命令组成,命令最大条数不能超过127条。支持的命令和命令格式详情,请参见镜像构建服务(ImageBuilder)指令集。 |
SystemType | String | 否 | 否 | 组件支持的操作系统。 | 目前仅支持Linux系统。 取值:Linux。 |
Tags | List | 否 | 否 | 标签列表。 | 最多支持20个标签。更多信息,请参见Tags属性。 |
Name | String | 否 | 否 | 组件名称。 | 长度为2~128个字符,必须以大小字母或中文开头,不能以 说明 不设置 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Value | String | 否 | 否 | 标签值。 | 一旦传入该值,可以为空字符串。最多支持128个字符,不能以 |
Key | String | 否 | 否 | 标签键。 | 一旦传入该值,则不允许为空字符串。最多支持128个字符,不能以 |
返回值
Fn::GetAtt
ImageComponentId:镜像组件ID。
示例
YAML
格式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
格式{ "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" ] } } } }