When a user purchases a Compute Nest service from Alibaba Cloud Marketplace, they get both the software and the cloud resources it requires. Without explicit binding, the software billing period and the resource billing period are independent — a subscription user could end up with pay-as-you-go resources, or vice versa. This guide shows you how to bind those settings in your Resource Orchestration Service (ROS) template before publishing your service.
What you want to configure
| Goal | Template setting |
|---|---|
| Resource charge type matches software charge type | Add ChargeType, PayPeriodUnit, and PayPeriod parameters and set MapOrderParameterToMarket: true |
| Resource auto-renewal syncs with software auto-renewal | Also add the AutoRenew parameter and wire it to your resource's renewal property |
| Hide billing fields from the service instance UI | Add the Hidden list and set HiddenSaleConfig: true |
Prerequisites
Before you begin, ensure that you have:
-
A Compute Nest console account with service provider access
-
Familiarity with ROS template syntax
Create a service with billing binding
Configure the template
In your ROS template, add billing parameters to both the Parameters and Metadata sections.
Required parameters — add all three to Parameters:
Parameters:
PayType:
AssociationProperty: ChargeType
PayPeriodUnit:
AssociationProperty: PayPeriodUnit
PayPeriod:
AssociationProperty: PayPeriod
Optional parameter — add AutoRenew if you want resource auto-renewal to follow software auto-renewal:
AutoRenew:
AssociationProperty: AutoRenew
Also wire AutoRenew into the resource's renewal property in the Resources section:
Resources:
EcsInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
AutoRenew:
Ref: AutoRenew
InstanceChargeType:
Ref: PayType
PeriodUnit:
Ref: PayPeriodUnit
Period:
Ref: PayPeriod
In Metadata, set MapOrderParameterToMarket: true under ALIYUN::ROS::Interface. This is the key that binds resource billing to software billing:
Metadata:
ALIYUN::ROS::Interface:
MapOrderParameterToMarket: true
Optional — to hide billing fields from the service instance UI, add the Hidden list and set HiddenSaleConfig: true:
Metadata:
ALIYUN::ROS::Interface:
MapOrderParameterToMarket: true
Hidden:
- PayType
- PayPeriodUnit
- PayPeriod
- AutoRenew
HiddenSaleConfig: true
Hidden removes the parameters from view on the service instance page. The billing binding still applies — the fields are grayed out and not shown to the buyer.
The service instance creation page displays the Software Billing Configuration section, which includes Billing Method (subscription), Billing Duration (1 year/2 years/3 years), and the Auto-Renewal toggle.
The Software Billing Configuration section is hidden on the service instance creation page. Only basic configurations such as Service Instance Name and Region are displayed.
Create, test, and publish the service
-
Log in to the Compute Nest console.
-
In the left-side navigation pane, click My Services. On the Created Services tab, click Create Service.
-
On the Create Service page, configure service information and paste your template with the billing parameters above. For all other parameters, see Create a private service or Create a fully managed service.
-
Click Create Service.
-
Test the service to confirm it works correctly. For details, see Test a service.
-
Submit the service for review. After the review passes, publish the service. For details, see Publish a service.
List the service on Alibaba Cloud Marketplace
After the service is published 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 binding
-
Find the product in Alibaba Cloud Marketplace:
-
Go to the Alibaba Cloud Marketplace home page and click Search to find your product, or
-
Open the Alibaba Cloud Marketplace product link you received from the service provider.
-
-
On the product page, select purchase options and click Purchase Now.
-
On the Confirm Order page, review the resource configuration. With
MapOrderParameterToMarket: truein effect, the resource charge type follows the software charge type, and the auto-renewal toggle follows the software auto-renewal toggle. If you configuredHidden, those billing fields appear grayed out and are not editable by the buyer.
Sample template
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
AutoRenew:
Type: Boolean
Label:
en: AutoRenew
zh-cn: AutoRenew
AssociationProperty: AutoRenew
PayType:
Type: String
Label:
en: ECS Instance Charge Type
zh-cn: Billing Method
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