Resource Orchestration Service (ROS) integration example
You can use templates from Alibaba Cloud Resource Orchestration Service (ROS) to define your cloud resources and their dependencies. The ROS orchestration engine automatically creates and configures all resources based on the template, enabling automated deployment and operations. This topic describes how to use ROS to query information about an ApsaraDB for RDS instance.
Supported resources
ROS simplifies cloud resource management. You create templates to define Alibaba Cloud resources, such as ECS and ApsaraDB for RDS instances, and their dependencies. The ROS orchestration engine then uses the template to automatically create, configure, and deploy the resources. For more information, see What is Resource Orchestration Service?
You can use ROS to orchestrate ApsaraDB for RDS. These operations involve two types of items: resources and data sources.
-
Resources:
-
ALIYUN::RDS::Account: creates an account to manage a database.
-
ALIYUN::RDS::AccountPrivilege: grants permissions to an account to access a database.
-
ALIYUN::RDS::ADInfo: configures the AD domain service.
-
ALIYUN::RDS::Connection: creates a public endpoint.
-
ALIYUN::RDS::Database: creates a database in an instance.
-
ALIYUN::RDS::DBInstance: creates an ApsaraDB for RDS instance.
-
ALIYUN::RDS::DBInstanceParameterGroup: modifies the parameters of an ApsaraDB for RDS instance.
-
ALIYUN::RDS::DBInstanceSecurityIps: modifies the IP whitelist of an instance.
-
ALIYUN::RDS::DBInstanceClone: restores data from a point in time to a new clone instance.
-
ALIYUN::RDS::MigrateTask: restores a backup file from OSS to an ApsaraDB for RDS for SQL Server instance, migrating data to the cloud.
-
ALIYUN::RDS::PostgresExtensions: installs specified extensions in the destination database.
-
ALIYUN::RDS::PrepayDBInstance: creates a subscription database instance.
-
ALIYUN::RDS::ReadOnlyDBInstance: creates a read-only instance.
-
-
Data sources:
-
DATASOURCE::RDS::Accounts: queries information about the accounts of an instance.
-
DATASOURCE::RDS::DBInstance: queries information about an ApsaraDB for RDS instance.
-
DATASOURCE::RDS::Databases: queries information about databases in an ApsaraDB for RDS instance.
-
DATASOURCE::RDS::DBInstances: queries a list of ApsaraDB for RDS instances.
-
DATASOURCE::RDS::Zones: queries ApsaraDB for RDS resources in a specified zone.
-
Configure permissions
For security, do not use your Alibaba Cloud account to access ApsaraDB for RDS. Instead, create a RAM user, obtain its AccessKey pair, and grant it the required permissions.
-
Create a RAM user:
-
Go to the RAM Users page and click Create User.
-
Set Logon Name to rds-test-operator and select Programmatic Access for Access Method.
-
Click OK to create the RAM user.
-
-
Grant permissions to the RAM user:
-
Go to the RAM Users page. Find the RAM user and click Add Permissions in the Actions column.
-
Add the following permission policies to the RAM user:
-
AliyunRDSFullAccess: grants permissions to query and modify ApsaraDB for RDS instances.
NoteYou can also select AliyunRDSReadOnlyAccess for read-only permissions on ApsaraDB for RDS instances, or create a custom policy based on your business requirements. For more information, see Create a custom permission policy.
-
AliyunROSFullAccess: grants permissions to manage all ROS operations.
-
-
Click OK to grant the permissions.
-
Procedure
-
Log on to the Resource Orchestration Service (ROS) console.
-
In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Stack. On the page that appears, click Create Stack.
-
Specify a template and click Next.
This topic shows how to use a custom template to query information about an ApsaraDB for RDS instance. For more information about how to use templates, see Create a stack.
-
In the Specify Template section, select Select an Existing Template.
-
Set Template Import Method to Enter Template Content.
-
In the Template Content section, select ROS and enter the template code.
The following template shows how to use a
DATASOURCE::RDS::DBInstancedata source to query information about an ApsaraDB for RDS instance. You can use the template in the JSON or YAML format. For more information, see DATASOURCE::RDS::DBInstance.
-
-
Configure parameters.
Parameter
Required
Description
Example
Stack Name
Yes
The name of the stack.
Rds_TestDBInstanceId
Yes
The ID of the ApsaraDB for RDS instance.
rm-bp1tuz16pa5x8****
Configure Stack Settings
No
The configuration parameters of the stack.
-
Click Create.
-
After the stack is created, click the Output tab to view the instance information.