All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::Instances

最終更新日:Nov 26, 2024

DATASOURCE::ECS::Instances is used to query the information about Elastic Compute Service (ECS) instances.

Syntax

{
  "Type": "DATASOURCE::ECS::Instances",
  "Properties": {
    "InnerIpAddresses": List,
    "ResourceGroupId": String,
    "PrivateIpAddresses": List,
    "InstanceChargeType": String,
    "InstanceTypeFamily": String,
    "InstanceNetworkType": String,
    "Filters": List,
    "AdditionalAttributes": List,
    "ImageId": String,
    "PublicIpAddresses": List,
    "RdmaIpAddresses": String,
    "InstanceIds": List,
    "InstanceType": String,
    "Ipv6Address": List,
    "Tags": List,
    "Status": String,
    "KeyPairName": String,
    "IoOptimized": Boolean,
    "ZoneId": String,
    "InstanceId": String,
    "HpcClusterId": String,
    "VSwitchId": String,
    "SecurityGroupId": String,
    "InternetChargeType": String,
    "InstanceName": String,
    "EipAddresses": List,
    "VpcId": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

InnerIpAddresses

List

No

Yes

The internal IP addresses of the instances deployed in the classic network.

This property takes effect when InstanceNetworkType is set to classic.

You can specify up to 100 IP addresses. Separate multiple IP addresses with commas (,).

Example: ["10.1.1.1", "10.1.2.1", … "10.1.10.1"].

ResourceGroupId

String

No

Yes

The ID of the resource group to which the instance belongs.

None.

PrivateIpAddresses

List

No

Yes

The private IP addresses of the instances deployed in virtual private clouds (VPCs).

This property takes effect when InstanceNetworkType is set to vpc.

You can specify up to 100 IP addresses. Separate multiple IP addresses with commas (,).

Example: ["172.16.1.1", "172.16.2.1", … "172.16.10.1"].

InstanceChargeType

String

No

Yes

The billing method of the instance.

Valid values:

  • PostPaid

  • PrePaid

InstanceTypeFamily

String

No

Yes

The instance family.

None.

InstanceNetworkType

String

No

Yes

The network type of the instance.

Valid values:

  • classic

  • vpc

Filters

List

No

Yes

The filters that you want to use to query resources.

For more information, see Filters properties.

AdditionalAttributes

List

No

Yes

The additional attributes.

Valid values:

  • META_OPTIONS: instance metadata

  • DDH_CLUSTER: dedicated host cluster

  • NETWORK_PRIMARY_ENI_IP: secondary IP address associated with the primary elastic network interface (ENI)

ImageId

String

No

Yes

The image ID.

None.

PublicIpAddresses

List

No

Yes

The public IP addresses of the instances.

You can specify up to 100 IP addresses. Separate multiple IP addresses with commas (,).

Example: ["192.0.2.0", "192.0.2.1", …, "192.0.2.10"].

RdmaIpAddresses

String

No

Yes

The Remote Direct Memory Access (RDMA) IP addresses of the instances that belong to a High Performance Computing (HPC) cluster.

None.

InstanceIds

List

No

Yes

The IDs of the instances.

You can specify up to 100 IDs. Separate multiple IDs with commas (,).

InstanceType

String

No

Yes

The instance type.

None.

Ipv6Address

List

No

Yes

The IPv6 addresses of the ENI.

You can specify up to 100 IP addresses. Separate multiple IP addresses with commas (,).

Tags

List

No

Yes

The tags of the instance.

You can add up to 20 tags.

For more information, see Tags properties.

Status

String

No

Yes

The status of the instance.

Valid values:

  • Pending: The instance is being created.

  • Running: The instance is running.

  • Starting: The instance is being started.

  • Stopping: The instance is being stopped.

  • Stopped: The instance is stopped.

KeyPairName

String

No

Yes

The name of the SSH key pair bound to the instance.

None.

IoOptimized

Boolean

No

Yes

Specifies whether the instance is an I/O optimized instance.

Valid values:

  • true

  • false

ZoneId

String

No

Yes

The zone ID.

None.

InstanceId

String

No

Yes

The instance ID.

None.

HpcClusterId

String

No

Yes

The ID of the HPC cluster to which the instance belongs.

None.

VSwitchId

String

No

Yes

The vSwitch ID.

None.

SecurityGroupId

String

No

Yes

The ID of the security group.

None.

InternetChargeType

String

No

Yes

The metering method for network usage.

Valid values:

  • PayByBandwidth

  • PayByTraffic

InstanceName

String

No

Yes

The instance name.

None.

EipAddresses

List

No

Yes

The elastic IP addresses (EIPs) of the instances.

This property takes effect when InstanceNetworkType is set to vpc.

You can specify up to 100 EIPs. Separate multiple EIPs with commas (,).

VpcId

String

No

Yes

The VPC ID.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Filters syntax

"Filters": [
  {
    "Value": String,
    "Key": String
  }
]

Filters properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The filter key.

Set the value to CreationStartTime. A value of CreationStartTime specifies the beginning of the time range during which resources are created.

You can specify both Key and Value to query resources that are created after the specified point in time.

Value

String

No

No

The filter value.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC+0.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

None.

Value

String

No

No

The tag value.

None.

Return values (Fn::GetAtt)

  • InstanceIds: the IDs of the instances.

  • Instances: details of the instances.

Property

Type

Description

Constraint

InstanceIds

List

The IDs of the instances.

None.

Instances

List

Details of the instances.

None.

SerialNumber

String

The serial number of the instance.

None.

Status

String

The status of the instance.

None.

DeploymentSetId

String

The ID of the deployment set.

None.

SpotStrategy

String

The preemption policy for the pay-as-you-go instance.

Valid values:

  • NoSpot: The instance is created as a regular pay-as-you-go instance.

  • SpotWithPriceLimit: The instance is created as a preemptible instance that has a user-defined maximum hourly price.

  • SpotAsPriceGo: The instance is created as a preemptible instance for which the market price at the time of purchase is automatically used as the bid price. The market price can be up to the pay-as-you-go price.

DeviceAvailable

Boolean

Indicates whether data disks can be attached to the instance.

Valid values:

  • true

  • false

Description

String

The description of the instance.

None.

InstanceNetworkType

String

The network type of the instance.

Valid values:

  • classic

  • vpc

InstanceName

String

The instance name.

None.

OSNameEn

String

The OS name of the instance in English.

None.

SpotPriceLimit

Number

The maximum hourly price of the instance.

This property takes effect when SpotStrategy is set to SpotWithPriceLimit.

Memory

Number

The memory size.

Unit: MiB.

OSName

String

The OS name of the instance in Chinese.

None.

ImageId

String

The image ID.

None.

GPUSpec

String

The GPU model used by the instance type.

None.

StoppedMode

String

The mode in which the instance is stopped. This property determines whether the system still implements billing for the instance after the instance is stopped.

Valid values:

  • KeepCharging: standard mode. The system still implements billing for the instance after the instance is stopped, and retains resources of the instance.

  • StopCharging: economical mode. The system does not implement billing for specific resources of the instance after the instance is stopped, and releases the resources, such as the vCPUs, memory, and public IP address.

  • Not-applicable: Economical mode is not applicable to the instance.

GPUAmount

Number

The number of GPUs used by the instance type.

None.

HostName

String

The hostname of the instance.

None.

InstanceId

String

The instance ID.

None.

InternetMaxBandwidthOut

Number

The maximum outbound public bandwidth.

Unit: Mbit/s.

InternetMaxBandwidthIn

Number

The maximum inbound public bandwidth.

Unit: Mbit/s.

InstanceType

String

The instance type.

None.

InstanceChargeType

String

The billing method of the instance.

Valid values:

  • PrePaid

  • PostPaid

IoOptimized

Boolean

Indicates whether the instance is an I/O optimized instance.

Valid values:

  • true

  • false

Cpu

Number

The number of vCPUs.

None.

ResourceGroupId

String

The ID of the resource group to which the instance belongs.

None.

InternetChargeType

String

The metering method for network usage.

Valid values:

  • PayByBandwidth

  • PayByTraffic

ZoneId

String

The zone ID.

None.

InstanceTypeFamily

String

The instance family.

None.

OSType

String

The OS type of the instance.

Valid values:

  • windows

  • linux

NetworkInterfaces

List

The ENIs that are attached to the instance.

None.

Tags

List

The tags of the instance.

None.

SecurityGroupIds

List

The IDs of the security groups to which the instance belongs.

None.

PublicIpAddress

List

The public IP addresses of the instances.

None.

InnerIpAddress

List

The internal IP addresses of the instances deployed in the classic network.

None.

EipAddress

List

The EIPs of the instances.

None.

DedicatedHostAttribute

List

The attributes of the dedicated host.

None.

EcsCapacityReservationAttr

List

The attributes of the capacity reservation for the instance.

None.

DedicatedInstanceAttribute

List

The attributes of the instance on the dedicated host.

None.

OperationLocks

List

The reasons why the instance is locked.

None.

PrivateIpAddress

List

The private IP addresses of the instances.

None.

VpcId

String

The VPC ID.

None.

VswitchId

String

The vSwitch ID.

None.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceIds:
    Type: Json
    Default:
      - i-bp17f03tk0f4bi86***
Resources:
  NetworkInterfaces:
    Type: DATASOURCE::ECS::Instances
    Properties:
      InstanceIds:
        Ref: InstanceIds
Outputs:
  Images:
    Value:
      Fn::GetAtt:
        - NetworkInterfaces
        - InstanceIds
  ImageIds:
    Value:
      Fn::GetAtt:
        - NetworkInterfaces
        - Instances
                    
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceIds": {
      "Type": "Json",
      "Default": [
        "i-bp17f03tk0f4bi86***"
      ]
    }
  },
  "Resources": {
    "NetworkInterfaces": {
      "Type": "DATASOURCE::ECS::Instances",
      "Properties": {
        "InstanceIds": {
          "Ref": "InstanceIds"
        }
      }
    }
  },
  "Outputs": {
    "Images": {
      "Value": {
        "Fn::GetAtt": [
          "NetworkInterfaces",
          "InstanceIds"
        ]
      }
    },
    "ImageIds": {
      "Value": {
        "Fn::GetAtt": [
          "NetworkInterfaces",
          "Instances"
        ]
      }
    }
  }
}