create_db_instance_account
Set up a new account for an Alibaba Cloud RDS instance by specifying region ID, instance ID, account details, and password. Enables secure database access management.
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
| Name | Required | Description | Default |
|---|---|---|---|
| account_description | No | ||
| account_name | Yes | ||
| account_password | Yes | ||
| account_type | No | Normal | |
| db_instance_id | Yes | ||
| region_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"account_description": {
"default": null,
"title": "Account Description",
"type": "string"
},
"account_name": {
"title": "Account Name",
"type": "string"
},
"account_password": {
"title": "Account Password",
"type": "string"
},
"account_type": {
"default": "Normal",
"title": "Account Type",
"type": "string"
},
"db_instance_id": {
"title": "Db Instance Id",
"type": "string"
},
"region_id": {
"title": "Region Id",
"type": "string"
}
},
"required": [
"region_id",
"db_instance_id",
"account_name",
"account_password"
],
"title": "create_db_instance_accountArguments",
"type": "object"
}
Implementation Reference
- The handler function implementing the 'create_db_instance_account' MCP tool. It creates a database account for an RDS instance using the Alibaba Cloud RDS OpenAPI CreateAccount API via the SDK.@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