Resource Orchestration Service (ROS) lets you activate one or more Alibaba Cloud services through a stack template. Define an ALIYUN::ROS::AutoEnableService resource in your template and let the stack handle activation, instead of manually enabling each service in its own console.
Prerequisites
Before you begin, make sure that you have:
An Alibaba Cloud account with access to the ROS console
An understanding of the billing method of each cloud service to activate
Supported services
The ServiceName parameter in ALIYUN::ROS::AutoEnableService accepts a specific set of values. Each value maps to a cloud service. For the full list, see ALIYUN::ROS::AutoEnableService.
Activate a single service
This example activates Simple Log Service (SLS). To activate a different service, change the Default value under ServiceName to the target service code, such as OSS for Object Storage Service.
Log on to the ROS console.
In the navigation pane on the left, click Stacks.
In the top menu bar, select a region for the stack from the region drop-down list. For example, select China (Hangzhou).
On the Stacks page, click Create Stack. In the Specify Template section, click Select an Existing Template.
NoteIf you select Create a New Template or ROS Infrastructure Composer, you are redirected to the corresponding page.
-
In the Select Template step, select Select an Existing Template in the Specify Template section. Set Template Import Method to Enter Template Content, paste the following YAML template into the Template Content code editor, and then click Next.
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, log on to the Simple Log Service console and confirm that the service is available.
Activate multiple services
This example activates Simple Log Service and Object Storage Service (OSS). The ServiceName parameter holds a JSON array of service codes. The template iterates over them using built-in functions.
Log on to the ROS console.
In the navigation pane on the left, click Stacks.
In the top menu bar, select a region for the stack from the region drop-down list. For example, select China (Hangzhou).
On the Stacks page, click Create Stack. In the Specify Template section, click Select an Existing Template.
NoteIf you select Create a New Template or ROS Infrastructure Composer, you are redirected to the corresponding page.
-
In the Select Template step, select Select an Existing Template in the Specify Template section, set Template Import Method to Enter Template Content, paste the following YAML template into the Template Content code editor, and then click Next.
The following table describes the template functions used in this example.
Function Purpose Fn::LengthReturns the number of items in the ServiceNamearray.Countuses this value to create oneAutoEnableServiceresource per service.ALIYUN::IndexA pseudo parameter that resolves to the current iteration index (0, 1, 2, ...). Fn::SelectPicks the service code at the current index from the ServiceNamearray.For details on all template 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, log on to each service console and confirm that the services are available: