create_db_instance_account
Create new user accounts for Alibaba Cloud RDS database instances to manage access permissions and authentication for database operations.
Instructions
Create a new account for an RDS instance.
Args:
region_id: The region ID of the RDS instance.
db_instance_id: The ID of the RDS instance.
account_name: The name of the new account.
account_password: The password for the new account.
account_description: The description for the new account.
account_type: The type of the new account. (e.g. Normal,Super)
Returns:
dict[str, Any]: The response.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region_id | Yes | ||
| db_instance_id | Yes | ||
| account_name | Yes | ||
| account_password | Yes | ||
| account_description | No | ||
| account_type | No | Normal |
Implementation Reference
- The main handler function that implements the 'create_db_instance_account' MCP tool. It uses the Alibaba Cloud RDS OpenAPI client to create a database account on a specified DB instance.@mcp.tool() async def create_db_instance_account( region_id: str, db_instance_id: str, account_name: str, account_password: str, account_description: str = None, account_type: str = "Normal" ) -> dict: """ Create a new account for an RDS instance. Args: region_id: The region ID of the RDS instance. db_instance_id: The ID of the RDS instance. account_name: The name of the new account. account_password: The password for the new account. account_description: The description for the new account. account_type: The type of the new account. (e.g. Normal,Super) Returns: dict[str, Any]: The response. """ try: client = get_rds_client(region_id) request = rds_20140815_models.CreateAccountRequest( dbinstance_id=db_instance_id, account_name=account_name, account_password=account_password, account_description=account_description, account_type=account_type ) response = await client.create_account_async(request) return response.body.to_map() except Exception as e: raise e