All Products
Search
Document Center

Compute Nest:Configure parameter mapping

Last Updated:Jun 20, 2026

For a fully managed service, if dependencies exist between your template parameters, you can configure parameter mappings to automatically set certain parameters to fixed values under specific conditions. When you deploy a service instance, Compute Nest automatically uses the values you configured if the conditions are met. This topic describes how to configure parameter mappings.

Background

For a fully managed service, you can add parameter mappings in two ways: Add and Add by Using Stack Groups. After a mapping is configured, Compute Nest automatically hides the corresponding parameter from the user interface. When creating a service instance, users specify only the dependency parameter. The value of the hidden parameter is automatically populated based on the mapping that you configured.

  • Direct Add: This method is used to configure parameter mappings for a small number of regions. The service provider sets mapping relationships and sub-dependency mappings for the parameters in the template. Select a dependent parameter and a corresponding parameter, and then set their values.

  • Add parameter mappings by using a stack group: This method is used when you deploy a service to multiple zones across multiple regions and need to configure a parameter mapping for each region. You can use a stack group to add parameter mappings to simplify the configuration process.

Add parameter mappings directly

Procedure

  1. Log on to the Compute Nest console.

  2. In the left-side navigation pane, click My Services. On the Created Services tab of the My Services page, click Create Service.

  3. On the Create New Service page, configure the service information.

    This section describes only the parameters that are specific to parameter mappings. For more information about other parameters, see Create a fully managed service.

    1. In the Template Content box, enter the content of the template. For more information about the template content, see Sample template.

    2. Click Add Parameter Mapping. In the Add Parameter Mapping dialog box, select Add and configure the parameters.

      1. In the Configure Mapping and Sub-dependency Mapping Configuration sections, select a Dependency Parameter and a Parameter.

      2. Click Add Automatic Parameter Mapping and specify values for the Dependency Parameter and the Parameter.

        For the dependency parameter Region, select China (Hangzhou). For the corresponding parameter VpcId, select an existing VPC.

      3. Click Add Sub-dependency Parameter and specify values for the Sub-dependency Parameter and the Parameter.

        For the sub-dependency parameter ZoneId, select China (Hangzhou) Zone K. For the corresponding parameter vSwitchId, select an existing vSwitch. Repeat this step to add a mapping for China (Hangzhou) Zone J and a vSwitch in that zone.

      4. Click OK.

  4. Click Save Service.

Add parameter mappings with a stack group

Procedure

  1. Log on to the Compute Nest console.

  2. In the navigation pane on the left, select My Services. On the My Services page, select the Created Services tab and click Create Service.

  3. On the Create New Service page, configure the service information.

    This section describes only the parameters that are specific to adding parameter mappings by using a stack group. For more information about other parameters, see Create a fully managed service.

    Click Add Parameter Mapping. In the Add Parameter Mapping dialog box, configure the parameters.

    1. Click the Add by Using Stack Groups tab and add a stack group.

      • If you have an existing stack group, you can select the region and ID of the stack group.

      • If you do not have a stack group, you must create one and then select it. For more information, see Create a stack group.

      • To simplify the process, Compute Nest provides two best-practice templates that you can use to create a stack group. These templates create resources such as VPCs, vSwitches, and security groups in each zone of each region. You can click the name of a template to open the stack group creation page. Then, follow the on-screen instructions to specify the parameters and create the stack group.

        • When you use the Create a VPC, vSwitch, and security group in a region and specify the number of zones. template to create a stack, you must specify the number of zones. Ensure the number of zones you specify does not exceed the actual number of zones in the region.

        • When you use the Create VPCs, vSwitches, and security groups in all zones of a region template to create a stack, the template creates the resources in all zones of the region by default.

    2. Click OK.

      Compute Nest automatically generates the parameter mappings. This may take a few seconds.

  4. Click Create Service and then click OK in the confirmation dialog box.

Effect on service instance deployment

Service instance deployment page

After the service is created, on the service instance deployment page, users only need to select the Region and Zone that you configured in the parameter mapping. The VPC and vSwitch parameters are hidden.

After service instance deployment

After the service instance is deployed, the VPC and vSwitch parameters remain hidden. You can view the created service instance on the My Service Instances > Fully Managed Services tab. Click an instance to view its configuration parameters, such as ZoneId, InstanceType, SystemDiskSize, DataDiskSize, and InstanceChargeType. The VPC and vSwitch parameters are hidden.

Sample template

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 此模板为单实例自定义镜像模板示例,支持选择已有基础资源配置,支持配置ECS的付费模式为预付费或者后付费
  en: >-
    This is a sample template for creating a single ECS instance from a custom image. It supports using existing infrastructure resources and allows you to configure the billing method for the ECS instance as either subscription or pay-as-you-go.
Parameters:
  SystemDiskCategory:
    AssociationProperty: 'ALIYUN::ECS::Disk::SystemDiskCategory'
    AssociationPropertyMetadata:
      InstanceType: InstanceType
      ZoneId: ZoneId
    Type: String
    Description:
      zh-cn: >-
        <font color='blue'><b>可选值:</b></font><br>[cloud_efficiency: <font
        color='green'>高效云盘</font>]<br>[cloud_ssd: <font
        color='green'>SSD云盘</font>]<br>[cloud_essd: <font
        color='green'>ESSD云盘</font>]<br>[cloud: <font color='green'>普通云盘</font>]
      en: >-
        <font color='blue'><b>Valid values:</b></font><br>[cloud_efficiency: <font color='green'>Ultra Disk</font>]<br>[cloud_ssd: <font color='green'>Standard SSD</font>]<br>[cloud_essd: <font color='green'>ESSD</font>]<br>[cloud: <font color='green'>Basic Disk</font>]
    Label:
      zh-cn: 系统盘类型
      en: System Disk Type
  ECSPeriodUnit:
    AssociationPropertyMetadata:
      Visible:
        Condition:
          'Fn::Not':
            'Fn::Equals':
              - '${InstanceChargeType}'
              - PostPaid
    Description:
      zh-cn: '云服务器预付费资源的购买时长周期,取值:[Week(周), Month(月)],<br>'
      en: 'The unit of the subscription duration. This parameter is required only when you set the billing method to subscription. Valid values: Week and Month.<br>'
    Default: Week
    AllowedValues:
      - Week
      - Month
    Label:
      zh-cn: 云服务器预付费资源的购买周期
      en: Unit of Subscription Duration
    Type: String
  ECSPeriod:
    AssociationPropertyMetadata:
      Visible:
        Condition:
          'Fn::Not':
            'Fn::Equals':
              - '${InstanceChargeType}'
              - PostPaid
    Description:
      zh-cn: >-
        云服务器预付费资源的购买时长,当预付费资源的购买周期为Week时,取值范围:[1,2,3,4];
        当预付费资源的购买周期为Month时,取值:[1,2,3,4,5,6,7,8,9,12,24,36,48,60]<br>
      en: >-
        The subscription duration. The valid values depend on the Unit of Subscription Duration. If the unit is Week, the valid values are 1, 2, 3, and 4. If the unit is Month, the valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60.<br>
    Default: 1
    Label:
      zh-cn: 云服务器预付费资源的购买时长
      en: Subscription Duration
    AllowedValues:
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
      - 12
      - 24
      - 36
      - 48
      - 60
    Type: Number
  SecurityGroupId:
    AssociationPropertyMetadata:
      VpcId: VpcId
    Description:
      zh-cn: 现有安全组的实例ID
      en: The ID of an existing security group.
    Default: null
    Label:
      zh-cn: 安全组ID
      en: Security Group ID
    AssociationProperty: 'ALIYUN::ECS::SecurityGroup::SecurityGroupId'
    Type: String
  SystemDiskSize:
    Default: 40
    Type: Number
    Description:
      zh-cn: '系统盘大小, 取值范围:[40, 500], 单位:GB。'
      en: 'The size of the system disk. Unit: GiB. Valid values: 40 to 500.'
    Label:
      zh-cn: 系统盘空间
      en: System Disk Size
  ZoneId:
    AssociationProperty: 'ALIYUN::ECS::Instance::ZoneId'
    Type: String
    Description:
      zh-cn: 可用区配置决定了新建ECS实例的可用区。此外,如果您选择已有基础资源配置,仅能选到该可用区下的交换机。
      en: >-
        The zone in which to create the ECS instance. If you use existing infrastructure resources, you can select only vSwitches that are in the specified zone.
    Label:
      zh-cn: ECS交换机可用区
      en: Zone
  DataDiskCategory:
    AssociationProperty: 'ALIYUN::ECS::Disk::DataDiskCategory'
    AssociationPropertyMetadata:
      InstanceType: InstanceType
      ZoneId: ZoneId
    Type: String
    Description:
      zh-cn: >-
        <font color='blue'><b>可选值:</b></font><br>[cloud_efficiency: <font
        color='green'>高效云盘</font>]<br>[cloud_ssd: <font
        color='green'>SSD云盘</font>]<br>[cloud_essd: <font
        color='green'>ESSD云盘</font>]<br>[cloud: <font color='green'>普通云盘</font>]
      en: >-
        <font color='blue'><b>Valid values:</b></font><br>[cloud_efficiency: <font color='green'>Ultra Disk</font>]<br>[cloud_ssd: <font color='green'>Standard SSD</font>]<br>[cloud_essd: <font color='green'>ESSD</font>]<br>[cloud: <font color='green'>Basic Disk</font>]
    Label:
      zh-cn: 数据盘类型
      en: Data Disk Type
  InstanceChargeType:
    Default: PostPaid
    Label:
      zh-cn: ECS实例的付费模式
      en: ECS Instance Billing Method
    Type: String
    Description:
      zh-cn: >-
        <font color='blue'><b>可选值:</b></font><br>[PostPaid: <font
        color='green'>按量付费。</font>]<br>[PrePaid: <font
        color='green'>预付费,包年包月。</font>]
      en: >-
        <font color='blue'><b>Valid values:</b></font><br>[PostPaid: <font color='green'>pay-as-you-go.</font>]<br>[PrePaid: <font color='green'>subscription.</font>]
    AllowedValues:
      - PostPaid
      - PrePaid
  VpcId:
    Default: null
    AssociationProperty: 'ALIYUN::ECS::VPC::VPCId'
    Type: String
    Description:
      zh-cn: '请选择已有的VPC<br><b><font color=''blue''>如找不到VPC,请切换地域。</font></b>'
      en: >-
        Select an existing VPC.<br><b><font color='blue'>If you cannot find a VPC, switch to another region.</font></b>
    Label:
      zh-cn: 现有VPC的实例ID
      en: Existing VPC ID
  DataDiskSize:
    Description:
      zh-cn: ECS实例数据盘大小,单位为GiB。取值范围:20~32768
      en: 'The size of the data disk. Unit: GiB. Valid values: 20 to 32768.'
    Default: 100
    MaxValue: 32768
    MinValue: 20
    Label:
      zh-cn: 数据盘空间
      en: Data Disk Size
    Type: Number
  VSwitchId:
    AssociationPropertyMetadata:
      VpcId: VpcId
      ZoneId: ZoneId
    Description:
      zh-cn: 现有网络交换机的实例ID
      en: The ID of an existing vSwitch.
    Default: null
    Label:
      zh-cn: 网络交换机ID
      en: VSwitch ID
    AssociationProperty: 'ALIYUN::ECS::VSwitch::VSwitchId'
    Type: String
  Password:
    ConstraintDescription:
      zh-cn: '长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ 中的特殊符号)。'
      en: >-
        The password must be 8 to 30 characters in length and contain characters from at least three of the following categories: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported: ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
    Description:
      zh-cn: >-
        服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
        中的特殊符号)。
      en: >-
        The logon password for the instance. The password must be 8 to 30 characters in length and contain characters from at least three of the following categories: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported: ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
    MinLength: 8
    Label:
      zh-cn: 实例密码
      en: Instance Password
    AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
    NoEcho: true
    MaxLength: 30
    Type: String
  InstanceType:
    AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
    AssociationPropertyMetadata:
      InstanceChargeType: '${InstanceChargeType}'
      ZoneId: ZoneId
    Type: String
    Label:
      zh-cn: 实例类型
      en: Instance Type
  InternetChargeType:
    Type: String
    Description:
      zh-cn: >-
        <font color='blue'><b>可选值:</b></font><br>[PayByBandwidth: <font
        color='green'>按带宽付费。</font>]<br>[PayByTraffic: <font
        color='green'>按流量付费。</font>],<br>默认为PayByTraffic
      en: >-
        <font color='blue'><b>Valid values:</b></font><br>[PayByBandwidth: <font color='green'>Pay-by-bandwidth.</font>]<br>[PayByTraffic: <font color='green'>Pay-by-traffic.</font>]<br>The default value is PayByTraffic.
    Label:
      en: Internet Billing Method
      zh-cn: 流量付费类型
    AllowedValues:
      - PayByBandwidth
      - PayByTraffic
    Default: PayByTraffic
  InternetMaxBandwidthOut:
    Type: Number
    Description:
      en: >-
        The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. Default value: 0.
      zh-cn: ECS最大出带宽。取值范围:0~100。单位:Mbps。默认值:0。
    Label:
      en: Maximum Public Bandwidth
      zh-cn: 实例公网带宽
    Default: 0
    MaxValue: 100
    MinValue: 0
Outputs:
  InstanceIds:
    Value:
      'Fn::GetAtt':
        - ECSInstances
        - InstanceIds
Conditions: {}
Resources:
  ECSInstances:
    Type: 'ALIYUN::ECS::InstanceGroup'
    Properties:
      SystemDiskCategory:
        Ref: SystemDiskCategory
      VpcId:
        Ref: VpcId
      InstanceChargeType:
        Ref: InstanceChargeType
      AllocatePublicIP: true
      SecurityGroupId:
        Ref: SecurityGroupId
      InternetChargeType:
        Ref: InternetChargeType
      InternetMaxBandwidthOut:
        Ref: InternetMaxBandwidthOut
      DiskMappings:
        - Category:
            Ref: DataDiskCategory
          Size:
            Ref: DataDiskSize
      SystemDiskSize:
        Ref: SystemDiskSize
      ImageId: centos_7
      PeriodUnit:
        Ref: ECSPeriodUnit
      VSwitchId:
        Ref: VSwitchId
      Period:
        Ref: ECSPeriod
      Password:
        Ref: Password
      InstanceType:
        Ref: InstanceType
      ZoneId:
        Ref: ZoneId
      MaxAmount: 1
    Metadata:
      'ALIYUN::ROS::Designer':
        id: 3d97f557-f6c2-475f-bdca-942c45e583b5
Metadata:
  'ALIYUN::ROS::Interface':
    ParameterGroups:
      - Parameters:
          - ZoneId
        Label:
          default:
            zh-cn: 可用区配置
            en: Zone Configuration
      - Parameters:
          - VpcId
          - VSwitchId
          - SecurityGroupId
        Label:
          default:
            zh-cn: 选择已有基础资源配置
            en: Select Existing Infrastructure Resources
      - Parameters:
          - InstanceChargeType
          - ECSPeriodUnit
          - ECSPeriod
          - InstanceType
          - SystemDiskCategory
          - SystemDiskSize
          - DataDiskCategory
          - DataDiskSize
          - InternetChargeType
          - InternetMaxBandwidthOut
          - Password
        Label:
          default:
            zh-cn: ECS 配置(必填)
            en: ECS Configuration (Required)
    TemplateTags:
      - 'acs:example:ISV Software Deployment:Create a single ECS instance from a custom image'