DATASOURCE::ENS::Instance

DATASOURCE::ENS::Instance类型用于查询单台ENS实例的详细信息。

语法

{
  "Type": "DATASOURCE::ENS::Instance",
  "Properties": {
    "InstanceId": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

InstanceId

String

实例ID。

RefreshOptions

String

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

有效值:

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

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

返回值

Fn::GetAtt

  • PrivateIpAddress:实例的私网信息。

  • InstanceId:实例ID。

  • VSwitchId:交换机ID。

  • NetworkId:网络 ID。

  • SystemDisk:磁盘信息。

  • InstanceName:实例名称。

  • DataDisk:数据盘信息。

  • InternetMaxBandwidthOut:最小上行带宽,单位:Mbps。

  • ImageId:镜像 ID。

  • SecurityId:安全组 ID。

  • PaymentType:付费类型。

  • EnsRegionId:实例所属地域 ID。

  • InstanceType:实例规格。

  • HostName:实例主机名称。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceId:
    Type: String
    Description:
      en: The ID of the instance.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::ENS::Instance
    Properties:
      InstanceId:
        Ref: InstanceId
Outputs:
  PrivateIpAddress:
    Description: The private IP address. Can only be used for node-level scheduling. If a private IP address is specified, the number of instances can only be one, and both the private IP address and the vSwitch ID are not empty, the private IP address takes effect.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - PrivateIpAddress
  InstanceId:
    Description: The ID of the instance.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - InstanceId
  VSwitchId:
    Description: The ID of the vSwitch to which the instance belongs.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - VSwitchId
  NetworkId:
    Description: The ID of the network.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - NetworkId
  SystemDisk:
    Description: System Disk Specification. SystemDisk is a non-required parameter when InstanceType is x86_pm,x86_bmi,x86_bm,pc_bmi, or arm_bmi. SystemDisk is a required parameter when instanceType is other specification families.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - SystemDisk
  InstanceName:
    Description: 'The instance name. Example value: test-InstanceName. It must be 2 to 128 characters in length and must start with an uppercase or lowercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-width colons (:), underscores (_), periods (.'
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - InstanceName
  DataDisk:
    Description: Data disk specifications.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - DataDisk
  InternetMaxBandwidthOut:
    Description: Maximum public network bandwidth. The field type is Long, and the precision may be lost during serialization/deserialization.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - InternetMaxBandwidthOut
  ImageId:
    Description: The ID of the image.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ImageId
  SecurityId:
    Description: ID of the security group to which the instance belongs.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - SecurityId
  PaymentType:
    Description: Instance payment method.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - PaymentType
  EnsRegionId:
    Description: The node ID. When ScheduleAreaLevel is Region, EnsRegionId is required. When ScheduleAreaLevel is Big,Middle,Small, EnsRegionId is invalid.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - EnsRegionId
  InstanceType:
    Description: 'The specification of the instance. Example value: ens.sn1.'
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - InstanceType
  HostName:
    Description: The hostname of the instance.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - HostName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the instance."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::ENS::Instance",
      "Properties": {
        "InstanceId": {
          "Ref": "InstanceId"
        }
      }
    }
  },
  "Outputs": {
    "PrivateIpAddress": {
      "Description": "The private IP address. Can only be used for node-level scheduling. If a private IP address is specified, the number of instances can only be one, and both the private IP address and the vSwitch ID are not empty, the private IP address takes effect.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PrivateIpAddress"
        ]
      }
    },
    "InstanceId": {
      "Description": "The ID of the instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "InstanceId"
        ]
      }
    },
    "VSwitchId": {
      "Description": "The ID of the vSwitch to which the instance belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VSwitchId"
        ]
      }
    },
    "NetworkId": {
      "Description": "The ID of the network.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "NetworkId"
        ]
      }
    },
    "SystemDisk": {
      "Description": "System Disk Specification. SystemDisk is a non-required parameter when InstanceType is x86_pm,x86_bmi,x86_bm,pc_bmi, or arm_bmi. SystemDisk is a required parameter when instanceType is other specification families.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SystemDisk"
        ]
      }
    },
    "InstanceName": {
      "Description": "The instance name. Example value: test-InstanceName. It must be 2 to 128 characters in length and must start with an uppercase or lowercase letter or a Chinese character. It cannot start with http:// or https. Can contain Chinese, English, numbers, half-width colons (:), underscores (_), periods (.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "InstanceName"
        ]
      }
    },
    "DataDisk": {
      "Description": "Data disk specifications.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "DataDisk"
        ]
      }
    },
    "InternetMaxBandwidthOut": {
      "Description": "Maximum public network bandwidth. The field type is Long, and the precision may be lost during serialization/deserialization.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "InternetMaxBandwidthOut"
        ]
      }
    },
    "ImageId": {
      "Description": "The ID of the image.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ImageId"
        ]
      }
    },
    "SecurityId": {
      "Description": "ID of the security group to which the instance belongs.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "SecurityId"
        ]
      }
    },
    "PaymentType": {
      "Description": "Instance payment method.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PaymentType"
        ]
      }
    },
    "EnsRegionId": {
      "Description": "The node ID. When ScheduleAreaLevel is Region, EnsRegionId is required. When ScheduleAreaLevel is Big,Middle,Small, EnsRegionId is invalid.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "EnsRegionId"
        ]
      }
    },
    "InstanceType": {
      "Description": "The specification of the instance. Example value: ens.sn1.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "InstanceType"
        ]
      }
    },
    "HostName": {
      "Description": "The hostname of the instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "HostName"
        ]
      }
    }
  }
}