edit-icon download-icon

ALIYUN::ECS::CustomImage

Last Updated: Jun 13, 2018

Description

Creates a custom image.

Syntax

  1. {
  2. "Type" : "ALIYUN::ECS::CustomImage",
  3. "Properties" : {
  4. "Description" : String,
  5. "InstanceId" : String,
  6. "ImageName" : String,
  7. "Timeout" : Integer,
  8. "ImageVersion" : String,
  9. "SnapshotId" : String
  10. }
  11. }

Properties

Name Type Required Description Constraints
Description String No Image description. Default value: null. It can contain up to 256 characters. It cannot start with http:// or https://.
InstanceId String No Instance ID. This parameter is specified if you create a custom image by using an instance.
ImageName String No Image name. It can contain 2 to 128 characters. It must begin with an uppercase or lowercase English letter, and can contain English letters, number, underscores(_), and hyphens(-). It cannot start with http:// or https://.
Timeout Integer No The length of time that ROS waits for the creation to be completed. - Value range: [200, 1440], unit: minute. Default value: 200.
- If this parameter is specified, the timeout for creating the entire resource stack is extended. The resource stack cannot be created if the creation of the custom image cannot be completed within the specified length of time here.
ImageVersion String No Image version. It can contain 1 to 40 characters.
SnapshotId String No Snapshot ID. This parameter is specified if you create a custom image by using a snapshot. If this parameter and InstanceId is both specified, this parameter is excluded.

Return values

Fn::GetAtt

ImageId: ID of the custom image.

Examples

  1. {
  2. "ROSTemplateFormatVersion": "2015-09-01",
  3. "Resources": {
  4. "WebServer": {
  5. "Type": "ALIYUN::ECS::InstanceGroup",
  6. "Properties": {
  7. "VpcId": "vpc-2zevx9ios1rszqv0azijb",
  8. "MinAmount": 1,
  9. "SecurityGroupId": "sg-2ze7pxymaix640qrg3vu",
  10. "ImageId": {
  11. "Ref": "CustomImage"
  12. },
  13. "IoOptimized": "optimized",
  14. "SystemDisk_Description": "SystemDisk.Description",
  15. "SystemDisk_DiskName": "SystemDisk.DiskName",
  16. "SystemDisk_Category": "cloud_ssd",
  17. "VSwitchId": "vsw-2zei67xd9nhcqxzec7qt7",
  18. "Password": "Wenqiao1234",
  19. "InstanceType": "ecs.n1.medium",
  20. "MaxAmount": 1
  21. }
  22. },
  23. "CustomImage": {
  24. "Type": "ALIYUN::ECS::CustomImage",
  25. "Properties": {
  26. "InstanceId": "i-2zefq1f3ynnrr89qkzg9",
  27. "SnapshotId": "s-2ze0ibk1pvak4mw6pt19",
  28. "ImageName": "image-test-6666",
  29. "ImageVersion": "verison-6-1"
  30. }
  31. }
  32. },
  33. "Outputs": {
  34. "CustomImage": {
  35. "Value": {
  36. "Fn::GetAtt": [
  37. "CustomImage",
  38. "ImageId"
  39. ]
  40. }
  41. },
  42. "InstanceIds": {
  43. "Value": {
  44. "Fn::GetAtt": [
  45. "WebServer",
  46. "InstanceIds"
  47. ]
  48. }
  49. }
  50. }
  51. }
Thank you! We've received your feedback.