All Products
Search
Document Center

Compute Nest:Link software and resource billing

Last Updated:Apr 25, 2026

This topic describes how to link the billing configurations between Compute Nest service software and its underlying resources for products you publish to Alibaba Cloud Marketplace.

Background

When customers purchase a Compute Nest service from Alibaba Cloud Marketplace, they purchase both the software and its required resources.

  • To ensure that the subscription period for your product matches the billing cycle of its underlying resources, you must define and link the billing parameters in your template. This synchronizes the billing cycles, whether the billing method is subscription or pay-as-you-go.

  • You can also link the auto-renewal settings. This ensures that when a customer enables or disables auto-renewal for the software, the setting is automatically applied to the underlying resources.

  • If you want to hide these billing details from the service instance creation page, you can add settings to your template.

Create a service

Create a service that links the lifecycles of the software and its underlying resources.

  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 Service page, configure the service information.

    This section describes only the parameters that require special configuration. For information about other parameters, see Create a private service or Create a fully managed service.

    When you define a template, you need to add the following parameters to Parameters and Metadata. For the complete template, see Template example.

    Parameters:
      PayType:
        AssociationProperty: ChargeType
      PayPeriodUnit:
        AssociationProperty: PayPeriodUnit
      PayPeriod:
        AssociationProperty: PayPeriod
      AutoRenew:
        AssociationProperty: AutoRenew
    Metadata:
      ALIYUN::ROS::Interface:
        MapOrderParameterToMarket: true
        Hidden:   
          - PayType
          - PayPeriodUnit
          - PayPeriod
          - AutoRenew
        HiddenSaleConfig: true
    • In the Parameters section, you must add the AssociationProperty for each billing parameter that you define, such as charge type (ChargeType), subscription duration unit (PayPeriodUnit), subscription duration (PayPeriod), and auto-renewal (AutoRenew).

      Note

      The AutoRenew parameter is optional. If you want to link the auto-renewal settings of the software and its resources, you must set AssociationProperty:AutoRenew for the renewal parameter and reference this parameter in the renewal properties of the resources in the Resources section.

    • In the Metadata section, you must add ALIYUN::ROS::Interface and set the MapOrderParameterToMarket field to true.

    • (Optional) Hide billing-related parameters in the template.

      • In Metadata, add the Hidden attribute and specify the parameters that you want to hide.

      • In Metadata, add the HiddenSaleConfig parameter and set its value to true.

        The service instance creation page displays the Software Billing Configuration section, which includes settings such as Billing Method (Subscription), Subscription Duration (1 Year/2 Years/3 Years), and an Auto-renewal switch.

        The Software Billing Configuration section is hidden from the service instance creation page, which now shows only basic settings such as Service Instance Name and Region.

  4. Click Create Service.

  5. Test the service.

    After you save the service, you must test it to ensure that it functions correctly. For more information, see Test a service.

  6. Publish the service.

    After the service passes the test, submit the service for review. After the review is passed, publish the service. For more information, see Publish a service.

Publish to Alibaba Cloud Marketplace

After you publish the service in the Compute Nest console, list it on Alibaba Cloud Marketplace. For instructions, see Publish a service as an Alibaba Cloud Marketplace product.

Verify the billing linkage

  1. Go to the product details page.

    • Find the product in Alibaba Cloud Marketplace:

      1. Go to the Alibaba Cloud Marketplace home page.

      2. Enter the name of the product that you want to purchase and click Search.

      3. Find the product and click it.

    • Open the product link provided by the service provider.

  2. On the product details page, select the purchase options and click Purchase Now.

  3. On the Confirm Order page, confirm the product information and configure the cloud resources.

    • After you link the configurations by setting MapOrderParameterToMarket: true, the resource billing settings are automatically synchronized with the software billing settings. The resource auto-renewal setting also synchronizes with the software's auto-renewal setting.

      To hide this grayed-out section from customers, set the Hidden parameter.

      For example, if you select a Subscription Duration of 3 Months in the Software Billing Configuration, the Subscription Duration in the Resource Billing Configuration is automatically set to 3, the Charge Type automatically changes to Subscription, and the entire Resource Billing Configuration section is grayed out and cannot be modified. Similarly, if you enable Auto-renewal in the Software Billing Configuration, the Auto-renewal setting for the resource is also automatically enabled.

Sample template

The following code provides a complete sample template.

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  AutoRenew:
    Type: Boolean
    Label:
      en: AutoRenew
      zh-cn: Auto-renewal
    AssociationProperty: AutoRenew
  PayType:
    Type: String
    Label:
      en: ECS Instance Charge Type
      zh-cn: Charge Type
    AssociationProperty: ChargeType
    AssociationPropertyMetadata:
      LocaleKey: InstanceChargeType
    Default: PostPaid
    AllowedValues:
      - PostPaid
      - PrePaid
  PayPeriodUnit:
    Type: String
    Label:
      en: Pay Period Unit
      zh-cn: Subscription Duration Unit
    AssociationProperty: PayPeriodUnit
    AssociationPropertyMetadata:
      Visible:
        Condition:
          Fn::Not:
            Fn::Equals:
              - ${PayType}
              - PostPaid
    Default: Month
    AllowedValues:
      - Month
      - Year
  PayPeriod:
    Type: Number
    Label:
      en: Period
      zh-cn: Subscription Duration
    AssociationProperty: PayPeriod
    AssociationPropertyMetadata:
      Visible:
        Condition:
          Fn::Not:
            Fn::Equals:
              - ${PayType}
              - PostPaid
    Default: 1
    AllowedValues:
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
  ……
Resources:
  EcsInstanceGroup:
    Type: ALIYUN::ECS::InstanceGroup
    Properties:
      AutoRenew:
        Ref: AutoRenew
      InstanceChargeType:
        Ref: PayType
      PeriodUnit:
        Ref: PayPeriodUnit
      Period:
        Ref: PayPeriod
      ……
  ……
Metadata:
  ALIYUN::ROS::Interface:
    MapOrderParameterToMarket: true
    Hidden:   
      - ChargeType
      - PeriodUnit
      - Period
      - AutoRenew
    HiddenSaleConfig: true