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 your template, enabling automated deployment and O&M. This topic demonstrates how to use ROS to query information about an RDS instance.
Supported resources
Resource Orchestration Service (ROS) is an Alibaba Cloud service that simplifies how you manage cloud resources. You can write a template to define the Alibaba Cloud resources that you need, such as ECS instances and RDS database instances, and their dependencies. The ROS orchestration engine then uses the template to automatically create and configure all the resources for you, enabling automated deployment and O&M. For more information, see What is Resource Orchestration Service?.
You can use ROS to orchestrate RDS. The orchestrated resources include standard resources and data sources.
-
Standard resources:
-
ALIYUN::RDS::Account: Creates an account for managing a database.
-
ALIYUN::RDS::AccountPrivilege: Grants an account permissions to access a database.
-
ALIYUN::RDS::ADInfo: Configures an Active Directory (AD) domain service.
-
ALIYUN::RDS::Connection: Creates a public endpoint.
-
ALIYUN::RDS::Database: Creates a database in an instance.
-
ALIYUN::RDS::DBInstance: Creates an RDS database instance.
-
ALIYUN::RDS::DBInstanceParameterGroup: Modifies the parameters of an RDS instance.
-
ALIYUN::RDS::DBInstanceSecurityIps: Modifies the IP address whitelist of an instance.
-
ALIYUN::RDS::DBInstanceClone: Restores historical data to a new instance, also known as a cloned instance.
-
ALIYUN::RDS::MigrateTask: Restores a backup file from OSS to an RDS for SQL Server instance to migrate 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 the account information of an instance.
-
DATASOURCE::RDS::DBInstance: Queries the information about an RDS instance.
-
DATASOURCE::RDS::Databases: Queries databases in an RDS instance.
-
DATASOURCE::RDS::DBInstances: Queries a list of RDS instances.
-
DATASOURCE::RDS::Zones: Queries available RDS resources in a zone.
-
Configure permissions
To ensure the security of your Alibaba Cloud account and cloud resources, avoid using your primary Alibaba Cloud account's AccessKey to access RDS. We recommend that you create a RAM user and grant it the required permissions to access RDS.
-
Create a RAM user:
-
Go to the RAM Users page and click Create User.
-
Set Logon Name to rds-test-operator and for Access Method, select Programmatic Access.
-
Click OK to create the RAM user.
-
-
Grant permissions:
-
Go to the RAM Users page. In the Actions column for the target RAM user, click Add Permissions.
-
Attach the following permission policies to the RAM user:
-
AliyunRDSFullAccess: Grants full control over RDS instances, including permissions to query and modify them.
NoteYou can also select AliyunRDSReadOnlyAccess, which grants read-only permissions for RDS instances, or create a custom policy based on your needs. For more information, see Create a custom permission policy.
-
AliyunROSFullAccess: Grants full permissions to manage all ROS operations.
-
-
Click Confirm Authorization to grant the permissions.
-
Procedure
-
Log on to the ROS console.
-
In the upper-left corner of the top navigation bar, select a region.
-
In the navigation pane on the left, click Stack. Then, click Create Stack.
-
Select a template and click Next.
This topic uses a custom template to demonstrate how to query information about an RDS instance. For more information about how to use templates, see Create a stack.
-
In the Specify Template section, select Select an Existing Template.
-
For Template Import Method, select Enter Template Content.
-
In the Template Content section, select ROS and enter the template code.
The following code provides a template for a ROS data source that queries information about an RDS instance. You can use either the JSON or YAML format. For more information, see DATASOURCE::RDS::DBInstance.
-
-
Configure the parameters.
Parameter
Required
Description
Example
Stack name
Yes
The name of the stack.
Rds_TestDBInstanceId
Yes
The ID of the RDS instance.
rm-bp1tuz16pa5x8****
Configure Stack Settings
No
Stack configuration parameters.
-
Click Create.
-
After the stack is created, click the Output tab to view the instance details.