DATASOURCE::ENS::Image

更新时间:2025-02-28 02:44:47

DATASOURCE::ENS::Image类型用于查询单个自定义镜像详情。

语法

{
  "Type": "DATASOURCE::ENS::Image",
  "Properties": {
    "ImageId": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

ImageId

String

镜像 ID。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

取值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

  • ImageOwnerAlias:镜像所有者的别名。

  • ImageName:镜像名称。

  • SnapshotId:快照 ID。

  • Platform:平台。

  • Architecture:镜像的体系架构。

  • ImageSize:镜像大小,单位:GiB。

  • InstanceId:实例 ID。

  • OsVersion:系统版本。

  • CreateTime:镜像创建时间。

  • ImageId:镜像 ID。

  • ComputeType:计算属性

示例

YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ImageId:
    Type: String
    Description:
      en: The ID of the image. Fuzzy search is supported.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::ENS::Image
    Properties:
      ImageId:
        Ref: ImageId
Outputs:
  ImageOwnerAlias:
    Description: |-
      The source of the image. Valid values:
      - **others**: a custom image that is shared by other Alibaba Cloud accounts.
      - **self**: your own custom image.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ImageOwnerAlias
  ImageName:
    Description: The name of the image.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ImageName
  SnapshotId:
    Description: The ID of the snapshot corresponding to the image.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - SnapshotId
  Platform:
    Description: |-
      The type of operating system used by the image. Valid values:
      - **centos**
      - **ubuntu**
      - **alios**
      - **debian**
      - **rhel**
      - **windows**
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Platform
  Architecture:
    Description: |-
      The image architecture. Valid values:
      - **i386**
      - **x86_64**
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Architecture
  ImageSize:
    Description: 'The size of the image. Unit: GiB.'
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ImageSize
  InstanceId:
    Description: The ID of the instance corresponding to the image.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - InstanceId
  OsVersion:
    Description: The operating system version.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - 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:
        - ExtensionDataSource
        - CreateTime
  ImageId:
    Description: The ID of the image.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - 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:
        - ExtensionDataSource
        - ComputeType
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ImageId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the image. Fuzzy search is supported."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ENS::Image",
      "Properties": {
        "ImageId": {
          "Ref": "ImageId"
        }
      }
    }
  },
  "Outputs": {
    "ImageOwnerAlias": {
      "Description": "The source of the image. Valid values:\n- **others**: a custom image that is shared by other Alibaba Cloud accounts.\n- **self**: your own custom image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ImageOwnerAlias"
        ]
      }
    },
    "ImageName": {
      "Description": "The name of the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ImageName"
        ]
      }
    },
    "SnapshotId": {
      "Description": "The ID of the snapshot corresponding to the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SnapshotId"
        ]
      }
    },
    "Platform": {
      "Description": "The type of operating system used by the image. Valid values:\n- **centos**\n- **ubuntu**\n- **alios**\n- **debian**\n- **rhel**\n- **windows**",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Platform"
        ]
      }
    },
    "Architecture": {
      "Description": "The image architecture. Valid values:\n- **i386**\n- **x86_64**",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Architecture"
        ]
      }
    },
    "ImageSize": {
      "Description": "The size of the image. Unit: GiB.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ImageSize"
        ]
      }
    },
    "InstanceId": {
      "Description": "The ID of the instance corresponding to the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "InstanceId"
        ]
      }
    },
    "OsVersion": {
      "Description": "The operating system version.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "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": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "ImageId": {
      "Description": "The ID of the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "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": [
          "ExtensionDataSource",
          "ComputeType"
        ]
      }
    }
  }
}
                        
  • 本页导读 (1)
  • 语法
  • 属性
  • 返回值
  • 示例
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等