すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::RDS::Account

最終更新日:Feb 07, 2026

ALIYUN::RDS::Account は、データベースを管理するためのアカウントを作成します。

構文

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

プロパティ

プロパティ名

必須

更新可能

説明

制約

AccountDescription

String

いいえ

はい

アカウントの説明です。

長さ: 2 ~ 256 文字。英字または漢字で始まります。英字、漢字、数字、アンダースコア (_)、ハイフン (-) を含めることができます。

DBInstanceId

String

はい

いいえ

インスタンス ID です。

なし

AccountPassword

String

はい

いいえ

アカウントパスワードです。

長さ: 8 ~ 32 文字。大文字、小文字、数字、特殊文字のうち、少なくとも 3 種類を含める必要があります。サポートされている特殊文字は次のとおりです。

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

AccountType

String

いいえ

いいえ

アカウントタイプです。

値:

  • Normal (デフォルト): 標準アカウントです。

  • Super: 特権アカウントです。

    説明

    SQL Server データベースの特権アカウントは削除できません。

AccountName

String

はい

いいえ

アカウント名です。

なし

戻り値

Fn::GetAtt

AccountName: アカウント名です。

シナリオ 1: 既存の RDS インスタンスに標準権限のデータベース管理アカウントを作成

クイック作成

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create a standard-permission database management account for an existing RDS instance.
  en: 既存の 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: アカウント名
    Label:
      zh-cn: Username
      en: ユーザー名
  RdsAccountPassword:
    Type: String
    NoEcho: true
    Description:
      zh-cn: |-
        长度为8~32个字符。由大写英文字母、小写英文字母、数字、特殊字符中的任意三种组成。支持的特殊字符如下:
        !@#$&%^*()_+-= .
      en: |-
        パスワードは 8 ~ 32 文字の長さである必要があります。大文字、小文字、数字、特殊文字のうち、少なくとも 3 種類の文字を含める必要があります。サポートされている特殊文字は次のとおりです。
        !@#$& amp;%^* ()_+-=  .
    Label:
      zh-cn: DB Account Password
      en: DB アカウントパスワード
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": "既存の 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": "MySQL 管理者ユーザー名"
      },
      "Label": {
        "zh-cn": "Username",
        "en": "ユーザー名"
      }
    },
    "RdsAccountPassword": {
      "Type": "String",
      "NoEcho": true,
      "Description": {
        "zh-cn": "长度为8~32个字符。由大写英文字母、小写英文字母、数字、特殊字符中的任意三种组成。支持的特殊字符如下: \n!@#$&%^*()_+-= 。",
        "en": "パスワードは 8 ~ 32 文字の長さである必要があります。大文字、小文字、数字、特殊文字のうち、少なくとも 3 種類の文字を含める必要があります。サポートされている特殊文字は次のとおりです。\n!@#$&%^*()_+-= 。"
      },
      "Label": {
        "zh-cn": "DB Account Password",
        "en": "DB アカウントパスワード"
      }
    }
  },
  "Outputs": {},
  "Resources": {
    "RdsAccount": {
      "Type": "ALIYUN::RDS::Account",
      "Properties": {
        "DBInstanceId": {
          "Ref": "RDSInstance"
        },
        "AccountPassword": {
          "Ref": "RdsAccountPassword"
        },
        "AccountType": "Normal",
        "AccountName": {
          "Ref": "RdsAccountName"
        }
      }
    }
  },
  "Metadata": {}
}

シナリオ 2: 新しい RDS インスタンスと特権データベース管理アカウントを作成

クイック作成

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: 従量課金 RDS サーバーレス MySQL インスタンスを作成し、データベースとデータベースユーザーにバインドします。
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      zh-cn: Instance ID of an existing virtual private cloud.
      en: コンソール - Virtual Private Cloud から (vpc-xxx) で始まる ID を検索してください。
    Label:
      zh-cn: VPC instance ID
      en: VPC ID
  RdsAccountName:
    Default: db_root
    Type: String
    Description:
      zh-cn: MySQL administrator username
      en: アカウント名
    Label:
      zh-cn: Username
      en: ユーザー名
  ZoneId:
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    Type: String
    Label:
      zh-cn: Primary zone
      en: プライマリ可用性ゾーン
  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: 既存のビジネスネットワーク vSwitch のインスタンス ID。コンソール - Virtual Private Cloud - vSwitch からクエリしてください。
    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: インスタンスクラス
  RdsAccountPassword:
    Type: String
    NoEcho: true
    Description:
      zh-cn: |-
        长度为8~32个字符。由大写英文字母、小写英文字母、数字、特殊字符中的任意三种组成。支持的特殊字符如下:
        !@#$&%^*()_+-= .
      en: |-
        パスワードは 8 ~ 32 文字の長さである必要があります。大文字、小文字、数字、特殊文字のうち、少なくとも 3 種類の文字を含める必要があります。サポートされている特殊文字は次のとおりです。
        !@#$& amp;%^* ()_+-=  .
    Label:
      zh-cn: DB Account Password
      en: DB アカウントパスワード
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: ネットワーク設定
      - Parameters:
          - DBInstanceClass
          - RdsAccountName
          - RdsAccountPassword
        Label:
          default:
            zh-cn: RDS Configuration
            en: RDS 設定
{
  "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": "従量課金 RDS サーバーレス MySQL インスタンスを作成し、データベースとデータベースアカウントをアタッチします。"
  },
  "Parameters": {
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "zh-cn": "Instance ID of an existing virtual private cloud.",
        "en": "既存の仮想プライベートクラウドのインスタンス ID。"
      },
      "Label": {
        "zh-cn": "VPC instance ID",
        "en": "VPC インスタンス ID"
      }
    },
    "RdsAccountName": {
      "Default": "db_root",
      "Type": "String",
      "Description": {
        "zh-cn": "MySQL administrator username",
        "en": "MySQL 管理者ユーザー名"
      },
      "Label": {
        "zh-cn": "Username",
        "en": "ユーザー名"
      }
    },
    "ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "Type": "String",
      "Label": {
        "zh-cn": "Primary zone",
        "en": "プライマリゾーン"
      }
    },
    "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": "既存のビジネスネットワーク vSwitch のインスタンス ID。"
      },
      "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": "インスタンスタイプ"
      }
    },
    "RdsAccountPassword": {
      "Type": "String",
      "NoEcho": true,
      "Description": {
        "zh-cn": "长度为8~32个字符。由大写英文字母、小写英文字母、数字、特殊字符中的任意三种组成。支持的特殊字符如下: \n!@#$&%^*()_+-= 。",
        "en": "パスワードは 8 ~ 32 文字の長さである必要があります。大文字、小文字、数字、特殊文字のうち、少なくとも 3 種類の文字を含める必要があります。サポートされている特殊文字は次のとおりです。\n!@#$&%^*()_+-= 。"
      },
      "Label": {
        "zh-cn": "DB Account Password",
        "en": "DB アカウントパスワード"
      }
    }
  },
  "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": "ネットワーク設定"
            }
          }
        },
        {
          "Parameters": [
            "DBInstanceClass",
            "RdsAccountName",
            "RdsAccountPassword"
          ],
          "Label": {
            "default": {
              "zh-cn": "RDS Configuration",
              "en": "RDS 設定"
            }
          }
        }
      ]
    }
  }
}

その他の例については、このリソースを含む公開テンプレートをご参照ください。