This topic describes how to select parameter configurations by creating a stack in the Resource Orchestration Service (ROS) console.

Background information

When you create stacks to manage resources by using ROS, you may need to open multiple consoles to query resource parameters. You can add AssociationProperty to the template parameter configurations. This way, optional values are provided for a specified parameter and you can select a value when you create a stack in the ROS console.

Sample code snippet of a template

The following sample code snippet shows how to select parameter configurations. You need only to add the resources that you want to create to obtain a complete template.

In the sample code snippet, AssociationProperty is specified to obtain the corresponding resources in the selected region, and AssociationPropertyMetadata is specified to add filter conditions for different parameters. This way, you can filter parameters when you create resources.

{
  "Parameters": {
    "ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "Type": "String",
      "Description": {
        "zh-cn":   
        "en":  
      },
      "Label": {
        "zh-cn":  
        "en": "VSwitch Availability Zone"
      }
    },
    "VPC": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "zh-cn":  
        "en": "Please search the ID starting with (vpc-xxx)from console-Virtual Private Cloud"
      },
      "Label": {
        "zh-cn":  
        "en": "Existing VPC Instance ID"
      }
    },
    "VSwitch": {
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
        "zh-cn":  
        "en": "Please search the business vswitch ID starting with(vsw-xxx)from console-Virtual Private Cloud-VSwitches"
      },
      "Label": {
        "zh-cn":  
        "en": "VSwitch ID"
      },
      "AssociationPropertyMetadata": {
        "ZoneId": "ZoneId",
        "VpcId": "VPC"
      }
    },
    "SecurityGroup": {
      "Type": "String",
      "Description": {
        "zh-cn":  
        "en": "Please search the business security group ID starting with(sg-xxx)from console-ECS-Network & Security"
      },
      "Label": {
        "zh-cn":  
        "en": "Business Security Group ID"
      },
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "AssociationPropertyMetadata": {
        "VpcId": "VPC"
      }
    },
    "InstanceType": {
      "AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
      "AssociationPropertyMetadata": {
        "ZoneId": "ZoneId"
      },
      "Label": {
        "zh-cn":  
        "en": "Instance Type"
      },
      "Type": "String",
      "Description": {
        "zh-cn": "<font color='blue'><b>1.  
        "en": "<font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]"
      }
    }
  }
}

The following section describes the parameters:

  • VPC: the IDs of the virtual private clouds (VPCs) that are available in the selected region.
  • ZoneId: the IDs of the zones that are available in the selected region.
  • VSwitch: the IDs of the vSwitches that are available in the selected region or VPC.
  • SecurityGroup: the IDs of the security groups that are available in the selected VPC.
  • InstanceType: the Elastic Compute Service (ECS) instance types that are available in the selected zone.

Configuration items in the console

When you use the sample code snippet to create a stack, the ROS console obtains the information of existing resources within the current Alibaba Cloud account.

Template syntax
Parameter Description Example
VSwitch Availability Zone The zone ID of the vSwitch in the VPC. Qingdao Zone C
Existing VPC Instance ID The ID of the VPC.

For more information about how to create and query a VPC, see Create a VPC.

vpc-bp1m6fww66xbntjyc****
VSwitch ID The ID of the vSwitch in the VPC.

For more information about how to create and query a vSwitch, see Create a vSwitch.

vsw-bp183p93qs667muql****
Security Group ID The ID of the ECS security group.

For more information about how to query security groups, see Query security groups.

sg-bp15ed6xe1yxeycg7o****
Instance Type The instance type of the ECS instance.

Select a valid instance type. For more information, see Instance families.

ecs.e4.2xlarge