All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::ImagePipeline

Last Updated:Apr 24, 2024

ALIYUN::ECS::ImagePipeline is used to create an image template.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

BaseImageType

String

Yes

No

The type of the source image.

Valid values:

  • IMAGE

  • IMAGE_FAMILY

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.

SystemDiskSize

Integer

No

No

The system disk size of the intermediate instance.

Unit: GiB.

Valid values: 20 to 500.

Default value: 40.

VSwitchId

String

No

No

The ID of the vSwitch in the virtual private cloud (VPC).

If you do not specify this property, a new VPC and vSwitch are created by default. Make sure that the quotas of VPC resources within your account are sufficient. For more information, see Limits and quotas.

AddAccount

List

No

No

The IDs of Alibaba Cloud accounts with which you want to share the image to be created based on the image template.

You can specify up to 20 account IDs.

Name

String

No

No

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 Name, the return value of ImagePipelineId is used by default.

ExecutePipeline

Boolean

No

No

Specifies whether to execute the image build task.

Valid values:

  • true (default)

  • false

DeleteInstanceOnFailure

Boolean

No

No

Specifies whether to release the intermediate instance if the image fails to be created.

Valid values:

  • true (default)

  • false

Note

If the intermediate instance fails to be started, the intermediate instance is released by default.

ImageName

String

No

No

The name prefix of the image to be created based on the image template.

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 image name that consists of the specified prefix and the build task ID (ExecutionId) in the format of {ImageName}_{ExecutionId}.

ToRegionId

List

No

No

The IDs of regions to which you want to distribute the image to be created based on the image template.

You can specify up to 20 region IDs. If you do not specify this property, the image is created only in the current region by default.

InternetMaxBandwidthOut

Integer

No

No

The size of the outbound public bandwidth for the intermediate instance.

Unit: Mbit/s.

Valid values: 0 to 100.

Default value: 0.

InstanceType

String

No

No

The instance type.

You can call the DescribeInstanceTypes operation to query instance types.

If you do not specify this property, an instance type that provides the fewest vCPUs and memory resources is selected by default. This configuration is subject to the resource availability of instance types.

For example, the ecs.g6.large instance type is selected by default. If available ecs.g6.large resources are insufficient, the ecs.g6.xlarge instance type is selected.

Tags

List

No

No

The tags.

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

BuildContent

String

No

No

The content of the image template.

The content can be up to 16 KB in size and supports up to 127 commands.

BaseImage

String

Yes

No

The source image.

If you set BaseImageType to IMAGE, you must set BaseImage to the ID of an image.

If you set BaseImageType to IMAGE_FAMILY, you must set BaseImage to the name of an image family.

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

ImagePipelineId: the ID of the image template.

Examples

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