All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::RDS::Account

Last Updated:Feb 11, 2026

ALIYUN::RDS::Account creates accounts for managing databases.

Syntax

{
  "Type": "ALIYUN::RDS::Account",
  "Properties": {
    "AccountDescription": String,
    "DBInstanceId": String,
    "AccountPassword": String,
    "AccountType": String,
    "AccountName": String
  }
}

Properties

Property Name

Type

Required

Updatable

Description

Constraints

AccountDescription

String

No

Yes

Account description.

Length: 2 to 256 characters. Start with an English letter or Chinese character. Can contain English letters, Chinese characters, numbers, underscores (_), and hyphens (-).

DBInstanceId

String

Yes

No

Instance ID.

None

AccountPassword

String

Yes

No

Account password.

Length: 8 to 32 characters. Must contain at least three of the following: uppercase letters, lowercase letters, numbers, and special characters. Supported special characters are:

!@#$&%^*()_+-=

AccountType

String

No

No

Account type.

Values:

  • Normal (default): Standard account.

  • Super: Privileged account.

    Note

    You cannot delete privileged accounts for SQL Server databases.

AccountName

String

Yes

No

Account name.

None

Return Values

Fn::GetAtt

AccountName: The name of the account.

Examples

Scenario 1: Create a standard-permission database management account for an existing RDS instance.

Quick create

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create a standard-permission database management account for an existing RDS instance.
  en: Create a database management account with ordinary privileges for an existing RDS.
Parameters:
  RDSInstance:
    AssociationProperty: ALIYUN::RDS::Instance::InstanceId
    Type: String
    Label:
      zh-cn: RDS instance ID
      en: RDS ID
  RdsAccountName:
    Default: db_root
    Type: String
    Description:
      zh-cn: MySQL administrator username
      en: Account Name
    Label:
      zh-cn: Username
      en: Account Name
  RdsAccountPassword:
    Type: String
    NoEcho: true
    Description:
      zh-cn: |-
        Length: 8 to 32 characters. Must contain at least three of the following: uppercase letters, lowercase letters, numbers, and special characters. Supported special characters are:
        !@#$&%^*()_+-= .
      en: |-
        The length is 8 ~ 32 characters. It is composed of uppercase English letters, lowercase English letters, numbers and special characters. The special characters supported are as follows:
        !@#$& amp;%^* ()_+-=  .
    Label:
      zh-cn: DB Account Password
      en: DB Account Password
Outputs: {}
Resources:
  RdsAccount:
    Type: ALIYUN::RDS::Account
    Properties:
      DBInstanceId:
        Ref: RDSInstance
      AccountPassword:
        Ref: RdsAccountPassword
      AccountType: Normal
      AccountName:
        Ref: RdsAccountName
Metadata: {}
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "Create a standard-permission database management account for an existing RDS instance.",
    "en": "Create a standard-permission database management account for an existing RDS instance."
  },
  "Parameters": {
    "RDSInstance": {
      "AssociationProperty": "ALIYUN::RDS::Instance::InstanceId",
      "Type": "String",
      "Label": {
        "zh-cn": "RDS instance ID",
        "en": "RDS instance ID"
      }
    },
    "RdsAccountName": {
      "Default": "db_root",
      "Type": "String",
      "Description": {
        "zh-cn": "MySQL administrator username",
        "en": "MySQL administrator username"
      },
      "Label": {
        "zh-cn": "Username",
        "en": "Username"
      }
    },
    "RdsAccountPassword": {
      "Type": "String",
      "NoEcho": true,
      "Description": {
        "zh-cn": "长度为8~32个字符。由大写英文字母、小写英文字母、数字、特殊字符中的任意三种组成。支持的特殊字符如下: \n!@#$&%^*()_+-= 。",
        "en": "The password must be 8 to 32 characters long. It must contain at least three of the following character types: uppercase letters, lowercase letters, numbers, and special characters. Supported special characters include the following:\n!@#$&%^*()_+-= ."
      },
      "Label": {
        "zh-cn": "DB Account Password",
        "en": "DB Account Password"
      }
    }
  },
  "Outputs": {},
  "Resources": {
    "RdsAccount": {
      "Type": "ALIYUN::RDS::Account",
      "Properties": {
        "DBInstanceId": {
          "Ref": "RDSInstance"
        },
        "AccountPassword": {
          "Ref": "RdsAccountPassword"
        },
        "AccountType": "Normal",
        "AccountName": {
          "Ref": "RdsAccountName"
        }
      }
    }
  },
  "Metadata": {}
}

Scenario 2: Create a new RDS instance and a privileged database management account.

Quick create

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create a pay-as-you-go RDS Serverless MySQL instance and attach a database and database account.
  en: Create a pay-as-you-go RDS Serverless MySQL instance and bind it to a database and a database user.
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      zh-cn: Instance ID of an existing virtual private cloud.
      en: Please search the ID starting with (vpc-xxx) from console-Virtual Private Cloud
    Label:
      zh-cn: VPC instance ID
      en: VPC ID
  RdsAccountName:
    Default: db_root
    Type: String
    Description:
      zh-cn: MySQL administrator username
      en: Account Name
    Label:
      zh-cn: Username
      en: Account Name
  ZoneId:
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    Type: String
    Label:
      zh-cn: Primary zone
      en: Primary Availability Zone
  VSwitch:
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
      ZoneId: ${ZoneId}
    Type: String
    Description:
      zh-cn: Instance ID of an existing business network vSwitch.
      en: Instance ID of existing business network switches, console-Virtual Private Cloud-VSwitches under query
    Label:
      zh-cn: vSwitch instance ID
      en: VSwitch ID
  DBInstanceClass:
    Default: mysql.n2.serverless.1c
    AssociationProperty: ALIYUN::RDS::Instance::InstanceType
    AssociationPropertyMetadata:
      Engine: MySQL
      EngineVersion: '8.0'
      InstanceChargeType: Serverless
      DBInstanceStorageType: cloud_essd
      ZoneId: ${ZoneId}
    Type: String
    Label:
      zh-cn: Instance type
      en: Instance Class
  RdsAccountPassword:
    Type: String
    NoEcho: true
    Description:
      zh-cn: |-
        Length: 8 to 32 characters. Must contain at least three of the following: uppercase letters, lowercase letters, numbers, and special characters. Supported special characters are:
        !@#$&%^*()_+-= .
      en: |-
        The length is 8 ~ 32 characters. It is composed of uppercase English letters, lowercase English letters, numbers and special characters. The special characters supported are as follows:
        !@#$& amp;%^* ()_+-=  .
    Label:
      zh-cn: DB Account Password
      en: DB Account Password
Outputs:
  PublicConnectionString:
    Value:
      Fn::GetAtt:
        - RDSInstance
        - PublicConnectionString
  InnerIPAddress:
    Value:
      Fn::GetAtt:
        - RDSInstance
        - InnerIPAddress
  AccountName:
    Value:
      Fn::GetAtt:
        - RdsAccount
        - AccountName
  PublicIPAddress:
    Value:
      Fn::GetAtt:
        - RDSInstance
        - PublicIPAddress
  DBName:
    Value:
      Fn::GetAtt:
        - Database
        - DBName
  InnerConnectionString:
    Value:
      Fn::GetAtt:
        - RDSInstance
        - InnerConnectionString
Resources:
  RDSInstance:
    Type: ALIYUN::RDS::DBInstance
    Properties:
      Category: serverless_basic
      Engine: MySQL
      DBInstanceStorage: 20
      ServerlessConfig:
        MinCapacity: 0.5
        AutoPause: false
        MaxCapacity: 8
        SwitchForce: false
      DBInstanceStorageType: cloud_essd
      PayType: Serverless
      ZoneId:
        Ref: ZoneId
      VpcId:
        Ref: VpcId
      VSwitchId:
        Ref: VSwitch
      EngineVersion: '8.0'
      DBInstanceClass:
        Ref: DBInstanceClass
      SecurityIPList: 0.0.0.0/0
  RdsAccount:
    Type: ALIYUN::RDS::Account
    Properties:
      DBInstanceId:
        Ref: RDSInstance
      AccountPassword:
        Ref: RdsAccountPassword
      AccountType: Super
      AccountName:
        Ref: RdsAccountName
  Database:
    Type: ALIYUN::RDS::Database
    Properties:
      CharacterSetName: UTF8
      DBInstanceId:
        Ref: RDSInstance
      DBName: springboot_demo
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - VpcId
          - ZoneId
          - VSwitch
        Label:
          default:
            zh-cn: Network Configuration
            en: Network Configuration
      - Parameters:
          - DBInstanceClass
          - RdsAccountName
          - RdsAccountPassword
        Label:
          default:
            zh-cn: RDS Configuration
            en: RDS Configuration
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "Create a pay-as-you-go RDS Serverless MySQL instance and attach a database and database account.",
    "en": "Create a pay-as-you-go RDS Serverless MySQL instance and attach a database and database account."
  },
  "Parameters": {
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "zh-cn": "Instance ID of an existing virtual private cloud.",
        "en": "Instance ID of an existing virtual private cloud."
      },
      "Label": {
        "zh-cn": "VPC instance ID",
        "en": "VPC instance ID"
      }
    },
    "RdsAccountName": {
      "Default": "db_root",
      "Type": "String",
      "Description": {
        "zh-cn": "MySQL administrator username",
        "en": "MySQL administrator username"
      },
      "Label": {
        "zh-cn": "Username",
        "en": "Username"
      }
    },
    "ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "Type": "String",
      "Label": {
        "zh-cn": "Primary zone",
        "en": "Primary zone"
      }
    },
    "VSwitch": {
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}",
        "ZoneId": "${ZoneId}"
      },
      "Type": "String",
      "Description": {
        "zh-cn": "Instance ID of an existing business network vSwitch.",
        "en": "Instance ID of an existing business network vSwitch."
      },
      "Label": {
        "zh-cn": "vSwitch instance ID",
        "en": "vSwitch instance ID"
      }
    },
    "DBInstanceClass": {
      "Default": "mysql.n2.serverless.1c",
      "AssociationProperty": "ALIYUN::RDS::Instance::InstanceType",
      "AssociationPropertyMetadata": {
        "Engine": "MySQL",
        "EngineVersion": "8.0",
        "InstanceChargeType": "Serverless",
        "DBInstanceStorageType": "cloud_essd",
        "ZoneId": "${ZoneId}"
      },
      "Type": "String",
      "Label": {
        "zh-cn": "Instance type",
        "en": "Instance type"
      }
    },
    "RdsAccountPassword": {
      "Type": "String",
      "NoEcho": true,
      "Description": {
        "zh-cn": "长度为8~32个字符。由大写英文字母、小写英文字母、数字、特殊字符中的任意三种组成。支持的特殊字符如下: \n!@#$&%^*()_+-= 。",
        "en": "The password must be 8 to 32 characters long. It must contain at least three of the following character types: uppercase letters, lowercase letters, numbers, and special characters. Supported special characters include the following:\n!@#$&%^*()_+-= ."
      },
      "Label": {
        "zh-cn": "DB Account Password",
        "en": "DB Account Password"
      }
    }
  },
  "Outputs": {
    "PublicConnectionString": {
      "Value": {
        "Fn::GetAtt": [
          "RDSInstance",
          "PublicConnectionString"
        ]
      }
    },
    "InnerIPAddress": {
      "Value": {
        "Fn::GetAtt": [
          "RDSInstance",
          "InnerIPAddress"
        ]
      }
    },
    "AccountName": {
      "Value": {
        "Fn::GetAtt": [
          "RdsAccount",
          "AccountName"
        ]
      }
    },
    "PublicIPAddress": {
      "Value": {
        "Fn::GetAtt": [
          "RDSInstance",
          "PublicIPAddress"
        ]
      }
    },
    "DBName": {
      "Value": {
        "Fn::GetAtt": [
          "Database",
          "DBName"
        ]
      }
    },
    "InnerConnectionString": {
      "Value": {
        "Fn::GetAtt": [
          "RDSInstance",
          "InnerConnectionString"
        ]
      }
    }
  },
  "Resources": {
    "RDSInstance": {
      "Type": "ALIYUN::RDS::DBInstance",
      "Properties": {
        "Category": "serverless_basic",
        "Engine": "MySQL",
        "DBInstanceStorage": 20,
        "ServerlessConfig": {
          "MinCapacity": 0.5,
          "AutoPause": false,
          "MaxCapacity": 8,
          "SwitchForce": false
        },
        "DBInstanceStorageType": "cloud_essd",
        "PayType": "Serverless",
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "VSwitchId": {
          "Ref": "VSwitch"
        },
        "EngineVersion": "8.0",
        "DBInstanceClass": {
          "Ref": "DBInstanceClass"
        },
        "SecurityIPList": "0.0.0.0/0"
      }
    },
    "RdsAccount": {
      "Type": "ALIYUN::RDS::Account",
      "Properties": {
        "DBInstanceId": {
          "Ref": "RDSInstance"
        },
        "AccountPassword": {
          "Ref": "RdsAccountPassword"
        },
        "AccountType": "Super",
        "AccountName": {
          "Ref": "RdsAccountName"
        }
      }
    },
    "Database": {
      "Type": "ALIYUN::RDS::Database",
      "Properties": {
        "CharacterSetName": "UTF8",
        "DBInstanceId": {
          "Ref": "RDSInstance"
        },
        "DBName": "springboot_demo"
      }
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "VpcId",
            "ZoneId",
            "VSwitch"
          ],
          "Label": {
            "default": {
              "zh-cn": "Network Configuration",
              "en": "Network Configuration"
            }
          }
        },
        {
          "Parameters": [
            "DBInstanceClass",
            "RdsAccountName",
            "RdsAccountPassword"
          ],
          "Label": {
            "default": {
              "zh-cn": "RDS Configuration",
              "en": "RDS Configuration"
            }
          }
        }
      ]
    }
  }
}

For more examples, see the public templates that include this resource.