All Products
Search
Document Center

Resource Orchestration Service:Query parameter constraints

Last Updated:Jun 10, 2026

Query the valid values of parameters defined in a template based on resource property constraints.

Background information

AssociationProperty and AssociationPropertyMetadata can filter parameters, but the filtered parameters may not meet your requirements in specific scenarios.

For example, different services support different ZoneId values. Use a parameter constraint query to obtain the ZoneId values defined in your template.

Supported properties

  • If a resource property is referenced by a parameter through the Ref function, call the GetTemplateParameterConstraints operation to obtain the property value. The following table lists the supported properties and resource types.

  • You can call the GetFeatureDetails operation to obtain resource types whose properties support parameter constraint queries.

Note

The target template must contain the Parameters section.

Resource type

Property

Description

ALIYUN::ADB::DBCluster

  • ZoneId

None.

ALIYUN::ALB::LoadBalancer

  • ZoneId in ZoneMappings

None.

ALIYUN::AMQP::Instance

  • PeriodUnit

  • Period

None.

ALIYUN::ApiGateway::Instance

  • PricingCycle

  • Duration

None.

ALIYUN::CDDC::DedicatedHost

  • Period

  • UsedTime

None.

ALIYUN::CEN::CenBandwidthPackage

  • PricingCycle

  • Period

None.

ALIYUN::ClickHouse::DBCluster

  • Period

  • ZoneId

  • UsedTime

None.

ALIYUN::CloudPhone::InstanceGroup

  • PeriodUnit

  • Period

None.

ALIYUN::CS::AnyCluster

  • PeriodUnit

  • Period

  • MasterInstanceTypes

  • WorkerZoneIds

  • PodVswitchIds

  • WorkerSystemDiskCategory

  • MasterZoneIds

  • WorkerVSwitchIds

  • KubernetesVersion

  • WorkerInstanceTypes

  • ScalingGroup.SystemDiskCategory in NodePools

  • ScalingGroup.ZoneIds in NodePools

  • ScalingGroup.InstanceTypes in NodePools

  • MasterSystemDiskCategory

  • Category in WorkerDataDisks

  • Category in MasterDataDisks

  • Category in ScalingGroup.DataDisks of NodePools

None.

ALIYUN::CS::ClusterNodePool

  • PeriodUnit in ScalingGroup

  • Period in ScalingGroup

  • InstanceTypes in ScalingGroup

  • ZoneIds in ScalingGroup

  • Category in ScalingGroup.DataDisks

  • SystemDiskCategory in ScalingGroup

None.

ALIYUN::CS::KubernetesCluster

  • MasterInstanceTypes

  • MasterSystemDiskCategory

  • WorkerInstanceTypes

  • WorkerSystemDiskCategory

  • WorkerVSwitchIds

  • PodVswitchIds

  • KubernetesVersion

  • PeriodUnit

  • WorkerZoneIds

  • Period

  • MasterZoneIds

  • ScalingGroup.InstanceTypes in NodePools

  • Category in ScalingGroup.DataDisks of NodePools

  • ScalingGroup.ZoneIds in NodePools

  • ScalingGroup.SystemDiskCategory in NodePools

  • Category in MasterDataDisks

  • Category in WorkerDataDisks

None.

ALIYUN::CS::ManagedEdgeKubernetesCluster

  • WorkerInstanceTypes

  • PeriodUnit

  • Period

  • ZoneIds

  • VSwitchIds

  • WorkerSystemDiskCategory

  • WorkerDataDiskCategory

None.

ALIYUN::CS::ManagedKubernetesCluster

  • WorkerInstanceTypes

  • WorkerSystemDiskCategory

  • VSwitchIds

  • PodVswitchIds

  • KubernetesVersion

  • PeriodUnit

  • Period

  • ZoneIds

  • ScalingGroup.ZoneIds in NodePools

  • ScalingGroup.InstanceTypes in NodePools

  • Category in ScalingGroup.DataDisks of NodePools

  • Category in WorkerDataDisks

  • ScalingGroup.SystemDiskCategory in NodePools

None.

ALIYUN::CS::ServerlessKubernetesCluster

  • PeriodUnit

  • Period

  • KubernetesVersion

None.

ALIYUN::DRDS::DrdsInstance

  • PricingCycle

  • Duration

None.

ALIYUN::DTS::SubscriptionInstance

  • Period

  • UsedTime

None.

ALIYUN::DTS::SynchronizationJob

  • Period

  • UsedTime

None.

ALIYUN::ECD::Desktops

  • PeriodUnit

  • Period

None.

ALIYUN::ECS::DedicatedHost

  • PeriodUnit

  • Period

None.

ALIYUN::ECS::Disk

  • DiskCategory

  • ZoneId

None.

ALIYUN::ECS::Instance

  • ZoneId

  • PeriodUnit

  • InstanceType

  • Period

  • SystemDiskCategory

  • Category in DiskMappings

None.

ALIYUN::ECS::InstanceGroup

  • ZoneId

  • PeriodUnit

  • InstanceType

  • Period

  • SystemDiskCategory

  • Category in DiskMappings

None.

ALIYUN::ECS::InstanceGroupClone

  • PeriodUnit

  • Period

  • SystemDiskCategory

  • Category in DiskMappings

  • PeriodUnit

  • Period

  • InstanceType

  • ZoneId

None.

ALIYUN::ECS::PrepayInstance

  • PeriodUnit

  • Period

  • SystemDiskCategory

  • Category in DiskMappings

  • PeriodUnit

  • Period

  • InstanceType

  • ZoneId

None.

ALIYUN::ECS::PrepayInstanceGroupClone

  • PeriodUnit

  • Period

  • SystemDiskCategory

  • Category in DiskMappings

  • PeriodUnit

  • Period

  • InstanceType

  • ZoneId

None.

ALIYUN::ECS::VSwitch

  • ZoneId

  • Period

  • PeriodType

None.

ALIYUN::EHPC::Cluster

  • PeriodUnit

  • Period

  • EcsOrderManagerInstanceType

  • EcsOrderComputeInstanceType

  • EcsOrderLoginInstanceType

  • SystemDiskType

  • ZoneId

None.

ALIYUN::ElasticSearch::Instance

  • PeriodUnit

  • ZoneId

  • Period

  • Spec in DataNode

  • Spec in MasterNode

  • Spec in KibanaNode

You can query specifications only by zone.

ALIYUN::EMR::Cluster

  • DiskType in HostGroup

  • NetType

  • SysDiskType in HostGroup

  • InstanceType in HostGroup

  • ZoneId

None.

ALIYUN::Flink::Instance

  • PricingCycle

  • Duration

  • ZoneId

None.

ALIYUN::GA::Accelerator

  • PricingCycle

  • Duration

None.

ALIYUN::GA::BandwidthPackage

  • PricingCycle

  • Duration

None.

ALIYUN::GPDB::DBInstance

  • ZoneId

  • PeriodUnit

  • Period

None.

ALIYUN::GPDB::ElasticDBInstance

  • ZoneId

  • EngineVersion

  • InstanceSpec

  • DBInstanceCategory

  • SegStorageType

None.

ALIYUN::GWS::Instance

  • PeriodUnit

  • Period

None.

ALIYUN::MONGODB::Instance

  • StorageType

  • DBInstanceClass

  • EngineVersion

  • ZoneId

None.

ALIYUN::MONGODB::PrepayInstance

  • StorageType

  • DBInstanceClass

  • EngineVersion

  • ZoneId

None.

ALIYUN::MONGODB::ServerlessInstance

  • StorageType

  • DBInstanceClass

  • EngineVersion

  • ZoneId

None.

ALIYUN::MONGODB::ShardingInstance

  • StorageType

  • DBInstanceClass

  • EngineVersion

  • ZoneId

None.

ALIYUN::NAS::FileSystem

  • ProtocolType

  • StorageType

  • ZoneId

None.

ALIYUN::POLARDB::DBCluster

  • ZoneId

  • Duration

  • PricingCycle

  • DBNodeClass

None.

ALIYUN::PrivateLink::VpcEndpointService

  • ZoneId in Resource

None.

ALIYUN::RDS::DBInstance

  • ZoneId

  • Period

  • PeriodType

  • EngineVersion

  • Category

  • DBInstanceStorageType

  • DBInstanceClass

Note
  • To ensure complete validation, you must specify ZoneId, DBInstanceStorageType, and Category.

  • To ensure complete validation, you must set MultiAZ to false.

  • To ensure complete validation, you must place the parameters related to the Engine property of ApsaraDB RDS before the parameters related to other ApsaraDB RDS properties when you use Metadata to specify the parameter order.

ALIYUN::RDS::DBInstanceClone

  • PeriodType

  • Period

  • Category

  • EngineVersion

  • PeriodType

  • DBInstanceClass

  • DBInstanceStorageType

  • Period

  • ZoneId

Note
  • To ensure complete validation, you must specify ZoneId, DBInstanceStorageType, and Category.

  • To ensure complete validation, you must set MultiAZ to false.

  • To ensure complete validation, you must place the parameters related to the Engine property of ApsaraDB RDS before the parameters related to other ApsaraDB RDS properties when you use Metadata to specify the parameter order.

ALIYUN::RDS::PrepayDBInstance

  • ZoneId

  • EngineVersion

  • Category

  • DBInstanceStorageType

  • DBInstanceClass

  • Period

  • PeriodType

Note
  • To ensure complete validation, you must specify ZoneId, DBInstanceStorageType, and Category.

  • To ensure complete validation, you must set MultiAZ to false.

  • To ensure complete validation, you must place the parameters related to the Engine property of ApsaraDB RDS before the parameters related to other ApsaraDB RDS properties when you use Metadata to specify the parameter order.

ALIYUN::RDS::ReadOnlyDBInstance

  • PeriodType

  • Period

  • Category

  • DBInstanceClass

  • EngineVersion

  • DBInstanceStorageType

  • ZoneId

Note
  • To ensure complete validation, you must specify ZoneId, DBInstanceStorageType, and Category.

  • To ensure complete validation, you must set MultiAZ to false.

  • To ensure complete validation, you must place the parameters related to the Engine property of ApsaraDB RDS before the parameters related to other ApsaraDB RDS properties when you use Metadata to specify the parameter order.

ALIYUN::REDIS::Instance

  • ZoneId

  • EngineVersion

  • InstanceClass

  • PeriodUnit

  • Period

None.

ALIYUN::REDIS::PrepayInstance

  • ZoneId

  • Period

  • PeriodUnit

  • EngineVersion

  • InstanceClass

None.

ALIYUN::SLB::AnyTunnel

  • PricingCycle

  • Duration

  • MasterZoneId

  • SlaveZoneId

None.

ALIYUN::SLB::LoadBalancer

  • MasterZoneId

  • SlaveZoneId

  • Duration

  • PricingCycle

None.

ALIYUN::TSDB::HiTSDBInstance

  • InstanceClass

  • ZoneId

  • Duration

  • PricingCycle

None.

ALIYUN::VPC::EIP

  • PricingCycle

  • Period

None.

ALIYUN::VPC::EIPPro

  • PricingCycle

  • Period

None.

ALIYUN::VPC::NatGateway

  • ZoneId

  • Duration

  • PricingCycle

None.

ALIYUN::VPC::RouterInterface

  • PricingCycle

  • Period

None.

Parameter dependencies

When you use a template to create ECS resources in ROS, you must specify parameters such as ZoneInfo and InstanceType.

Supported ECS instance types vary by zone. A specific value of the InstanceType parameter may become unavailable after you specify the ZoneInfo parameter.

To use only a specific value of the InstanceType parameter, you can use the Metadata section to configure the dependency between InstanceType and ZoneInfo.

Note

For more information, see Metadata.

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ZoneInfo:
    Type: String
  InstanceType:
    Type: String
Resources:
  ECS:
    Type: ALIYUN::ECS::Instance
    Properties:
      ZoneId:
        Ref: ZoneInfo
      InstanceType:
        Ref: InstanceType
      ImageId: ubuntu
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - InstanceType
          - ZoneInfo

Manually configure parameter constraints for Terraform templates

Add ResourcesForParameterConstraints to ALIYUN::ROS::Interface in the Metadata section or the .metadata file to configure parameter constraints.

Define the resources and properties relevant to the parameter constraints. For more information about the syntax of ResourcesForParameterConstraints, see Resources.

The Mappings, Conditions, and Rules sections in a template automatically take effect during parameter constraint queries. For more information, see (Optional) Mappings, (Optional) Conditions, and (Optional) Rules.

ROSTemplateFormatVersion: '2015-09-01'
Transform: Aliyun::Terraform-v1.1
Workspace:
  .metadata: |-
    {
        "ALIYUN::ROS::Interface": {
            "ResourcesForParameterConstraints": {
                "instance": {
                    "Type": "ALIYUN::ECS::Instance",
                    "Properties": {
                        "ImageId": {
                            "Ref": "image_id"
                        },
                        "InstanceType": {
                            "Ref": "instance_type"
                        },
                        "ZoneId": {
                            "Ref": "zone_id"
                        }
                    }
                }
            },
            "Hidden": [
                "image_id"
            ]
        }
    }
  main.tf: |-
    variable "image_id" {
      type    = string
      default = "ubuntu_18_04_64_20G_alibase_2019****.vhd"
    }

    variable "instance_type" {
      type = string
    }

    variable "zone_id" {
      type = string
    }

    resource "alicloud_vpc" "vpc" {
      cidr_block = "172.16.X.X/16"
    }

    resource "alicloud_security_group" "group" {
      vpc_id = alicloud_vpc.vpc.id
    }

    resource "alicloud_vswitch" "vswitch" {
      vpc_id     = alicloud_vpc.vpc.id
      cidr_block = "172.16.X.X/24"
      zone_id    = var.zone_id
    }

    resource "alicloud_instance" "instance" {
      availability_zone = var.zone_id
      security_groups   = [alicloud_security_group.group.id]
      instance_type     = var.instance_type
      image_id          = var.image_id
      vswitch_id        = alicloud_vswitch.vswitch.id
    }

In this Terraform template, four resources are defined. The zone_id and instance_type parameters are constrained and associated with alicloud_instance.

ResourcesForParameterConstraints defines only the ALIYUN::ECS::Instance resource type (corresponding to alicloud_instance), associating it with image_id, instance_type, and zone_id to constrain these parameters. The image_id parameter is hidden.