Resource Orchestration Service (ROS) supports automated activation of one or more Alibaba Cloud services.
Prerequisites
Before you configure automated activation for a cloud service, make sure that you are familiar with the billing method of the cloud service.
Cloud services that support automated activation
For more information, see the valid values of the ServiceName parameter in ALIYUN::ROS::AutoEnableService.
Automatically activate a cloud service
The following section provides an example on how to automatically activate a cloud service. In this example, Simple Log Service is activated.
Log on to the ROS console.
In the left-side navigation pane, click Stacks.
In the top navigation bar, select the region where you want to create a stack from the region drop-down list. For example, you can select China (Hangzhou).
On the Stacks page, click Create Stack and select Use ROS from the drop-down list.
In the Select Template step, select Select an Existing Template in the Specify Template section, set Template Import Method to Enter Template Content, enter the following sample YAML template in the Template Content code editor, and then click Next.
In the following sample template, the ServiceName parameter is set to SLS and is referenced in ALIYUN::ROS::AutoEnableService. This way, Simple Log Service can be automatically activated.
ROSTemplateFormatVersion: '2015-09-01' Parameters: ServiceName: Type: String Default: SLS Resources: AutoEnableService: Type: ALIYUN::ROS::AutoEnableService Properties: ServiceName: Ref: ServiceName
In the Configure Parameters step, specify Stack Name.
Click Create.
After the stack is created, you can log on to the Simple Log Service console to check whether Simple Log Service is activated as expected.
Automatically activate multiple cloud services
The following section provides an example on how to automatically activate multiple cloud services. In this example, Simple Log Service and Object Storage Service (OSS) are activated.
Log on to the ROS console.
In the left-side navigation pane, click Stacks.
In the top navigation bar, select the region where you want to create a stack from the region drop-down list. For example, you can select China (Hangzhou).
On the Stacks page, click Create Stack and select Use ROS from the drop-down list.
In the Select Template step, select Select an Existing Template in the Specify Template section, set Template Import Method to Enter Template Content, enter the following sample YAML template in the Template Content code editor, and then click Next.
In the following sample template, the ServiceName parameter is set to SLS and OSS, and is referenced in ALIYUN::ROS::AutoEnableService by using Count, Fn:Select, and Fn:Index. This way, Simple Log Service and OSS can be automatically activated.
For more information about functions, see Functions.
ROSTemplateFormatVersion: '2015-09-01' Parameters: ServiceName: Type: Json Default: - SLS - OSS Resources: AutoEnableService: Type: ALIYUN::ROS::AutoEnableService Properties: ServiceName: Fn::Select: - Ref: ALIYUN::Index - Ref: ServiceName Count: Fn::Length: Ref: ServiceName
In the Configure Parameters step, specify Stack Name.
Click Create.
After the stack is created, you can log on to the Simple Log Service console and the OSS console to check whether the cloud services are activated.