全部產品
Search
文件中心

Resource Orchestration Service:ALIYUN::ADB::Account

更新時間:Jun 14, 2024

ALIYUN::ADB::Account類型用於建立資料庫叢集帳號。

文法

{
  "Type": "ALIYUN::ADB::Account",
  "Properties": {
    "AccountDescription": String,
    "DBClusterId": String,
    "AccountType": String,
    "AccountPassword": String,
    "AccountName": String
  }
}

屬性

屬性名稱

類型

必須

允許更新

描述

約束

AccountName

String

資料庫帳號名稱。

AccountPassword

String

資料庫帳號名稱的密碼。

限制:

  • 密碼由大寫字母、小寫字母、數字以及特殊符號組成。

    特殊符號包含:(!)、(@)、(#)、($)、(%)、(^)、(&)、(*)(())、(_)、(+)、(-)、(=)

  • 密碼長度為8~32個字元。

DBClusterId

String

資料庫執行個體ID。

AccountDescription

String

資料庫帳號描述。

限制:

  • 不能以http://或者https://開頭。

  • 長度不超過256個字元。

AccountType

String

資料庫帳號類型。

取值:

  • Normal:普通帳號。

  • Super:高許可權帳號。

傳回值

Fn::GetAtt

  • DBClusterId:資料庫叢集ID。

  • AccountType:資料庫叢集帳號類型。

  • AccountName:資料庫叢集帳號名稱。

樣本

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DBClusterId:
    Type: String
    Description: The ID of the cluster.
  AccountPassword:
    Type: String
    Description: |-
      The password of the account.
      The password must contain uppercase letters, lowercase letters, digits, and special
      characters.
      Special characters include ! @ # $ % ^ * ()  _ + - and =
      The password must be 8 to 32 characters in length.
  AccountName:
    Type: String
    Description: The name of the account.
Resources:
  Account:
    Type: ALIYUN::ADB::Account
    Properties:
      DBClusterId:
        Ref: DBClusterId
      AccountPassword:
        Ref: AccountPassword
      AccountName:
        Ref: AccountName
Outputs:
  DBClusterId:
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
        - Account
        - DBClusterId
  AccountType:
    Description: The type of the account.
    Value:
      Fn::GetAtt:
        - Account
        - AccountType
  AccountName:
    Description: The name of the account.
    Value:
      Fn::GetAtt:
        - Account
        - AccountName

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBClusterId": {
      "Type": "String",
      "Description": "The ID of the cluster."
    },
    "AccountPassword": {
      "Type": "String",
      "Description": "The password of the account.\nThe password must contain uppercase letters, lowercase letters, digits, and special\ncharacters.\nSpecial characters include ! @ # $ % ^ * ()  _ + - and =\nThe password must be 8 to 32 characters in length."
    },
    "AccountName": {
      "Type": "String",
      "Description": "The name of the account."
    }
  },
  "Resources": {
    "Account": {
      "Type": "ALIYUN::ADB::Account",
      "Properties": {
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "AccountPassword": {
          "Ref": "AccountPassword"
        },
        "AccountName": {
          "Ref": "AccountName"
        }
      }
    }
  },
  "Outputs": {
    "DBClusterId": {
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "DBClusterId"
        ]
      }
    },
    "AccountType": {
      "Description": "The type of the account.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "AccountType"
        ]
      }
    },
    "AccountName": {
      "Description": "The name of the account.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "AccountName"
        ]
      }
    }
  }
}