ALIYUN::ENS::Image

Updated at: 2024-12-30 08:46

ALIYUN::ENS::Image is used to create an image from an instance.

Syntax

{
  "Type": "ALIYUN::ENS::Image",
  "Properties": {
    "ImageName": String,
    "DeleteAfterImageUpload": Boolean,
    "InstanceId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Property

Type

Required

Editable

Description

Constraint

ImageName

String

Yes

Yes

The image name.

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 (_), and hyphens (-).

DeleteAfterImageUpload

Boolean

No

No

Specifies whether to automatically release the packaged and uploaded image when the instance is released.

Valid values:

  • true: releases the packaged and uploaded image when the instance is released.

  • false: retains the packaged and uploaded image when the instance is released.

InstanceId

String

No

No

The instance ID.

None.

Return values

Fn::GetAtt

  • ImageOwnerAlias: the source of the image.

  • ImageName: the image name.

  • SnapshotId: the snapshot ID.

  • Platform: the OS type of the image.

  • Architecture: the architecture of the image.

  • ImageSize: the image size. Unit: GiB.

  • InstanceId: the instance ID.

  • OsVersion: the OS version.

  • CreateTime: the time when the image was created.

  • ImageId: the image ID.

  • ComputeType: the computing type.

Examples

YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ImageName:
    Type: String
    Description:
      en: |-
        The name of the image. The name must be 2 to 128 characters in length. 
        The name can contain letters, digits, colons (:), underscores (_), and hyphens (-). 
        It must start with a letter but cannot start with http:// or https://. 
        The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    Required: true
  InstanceId:
    Type: String
    Description:
      en: The ID of the instance corresponding to the image.
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::ENS::Image
    Properties:
      ImageName:
        Ref: ImageName
      InstanceId:
        Ref: InstanceId
Outputs:
  ImageOwnerAlias:
    Description: |-
      The source of the image. Valid values:
      system: public images
      self: your custom images
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ImageOwnerAlias
  ImageName:
    Description: The name of the image.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ImageName
  SnapshotId:
    Description: The ID of the snapshot corresponding to the image.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SnapshotId
  Platform:
    Description: |-
      The type of operating system used by the image.
      centos
      ubuntu
      alios
      debian
      rhel
      windows
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Platform
  Architecture:
    Description: |-
      The image architecture. Valid values:
      i386
      x86_64
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Architecture
  ImageSize:
    Description: 'The size of the image. Unit: GiB.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ImageSize
  InstanceId:
    Description: The ID of the instance corresponding to the image.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - InstanceId
  OsVersion:
    Description: The operating system version.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - OsVersion
  CreateTime:
    Description: The image creation time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  ImageId:
    Description: The ID of the image.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ImageId
  ComputeType:
    Description: |-
      Computing type. ens_vm/ens: x86 computing.
       bare_metal: x86 bare machine or x86 bare metal. 
      arm_vm: ARM computing. 
      arm_bare_metal: ARM bare machine or ARM bare metal.
      pcfarm: heterogeneous computing.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ComputeType
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ImageName": {
      "Type": "String",
      "Description": {
        "en": "The name of the image. The name must be 2 to 128 characters in length. \nThe name can contain letters, digits, colons (:), underscores (_), and hyphens (-). \nIt must start with a letter but cannot start with http:// or https://. \nThe name can contain letters, digits, colons (:), underscores (_), and hyphens (-)."
      },
      "Required": true
    },
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the instance corresponding to the image."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ENS::Image",
      "Properties": {
        "ImageName": {
          "Ref": "ImageName"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        }
      }
    }
  },
  "Outputs": {
    "ImageOwnerAlias": {
      "Description": "The source of the image. Valid values:\nsystem: public images\nself: your custom images",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageOwnerAlias"
        ]
      }
    },
    "ImageName": {
      "Description": "The name of the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageName"
        ]
      }
    },
    "SnapshotId": {
      "Description": "The ID of the snapshot corresponding to the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SnapshotId"
        ]
      }
    },
    "Platform": {
      "Description": "The type of operating system used by the image.\ncentos\nubuntu\nalios\ndebian\nrhel\nwindows",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Platform"
        ]
      }
    },
    "Architecture": {
      "Description": "The image architecture. Valid values:\ni386\nx86_64",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Architecture"
        ]
      }
    },
    "ImageSize": {
      "Description": "The size of the image. Unit: GiB.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageSize"
        ]
      }
    },
    "InstanceId": {
      "Description": "The ID of the instance corresponding to the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "InstanceId"
        ]
      }
    },
    "OsVersion": {
      "Description": "The operating system version.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "OsVersion"
        ]
      }
    },
    "CreateTime": {
      "Description": "The image creation time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "ImageId": {
      "Description": "The ID of the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageId"
        ]
      }
    },
    "ComputeType": {
      "Description": "Computing type. ens_vm/ens: x86 computing.\n bare_metal: x86 bare machine or x86 bare metal. \narm_vm: ARM computing. \narm_bare_metal: ARM bare machine or ARM bare metal.\npcfarm: heterogeneous computing.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ComputeType"
        ]
      }
    }
  }
}
                        
  • On this page (1, T)
  • Syntax
  • Properties
  • Return values
  • Examples
Feedback