DATASOURCE::RDS::Accounts类型用于查询实例的账号信息。
语法
{
  "Type": "DATASOURCE::RDS::Accounts",
  "Properties": {
    "DBInstanceId": String,
    "AccountName": String,
    "RefreshOptions": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| DBInstanceId | String | 是 | 是 | 实例ID。 | 说明  暂不支持SQL Server 2017集群版和PostgreSQL实例。 | 
| AccountName | String | 否 | 是 | 数据库账号名称。 | 无 | 
| RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值: 
 | 
返回数据(Fn::GetAtt)
- AccountNames:数据库账号名称列表。 
- Accounts:数据库账号详情列表。 
| 属性名称 | 类型 | 描述 | 约束 | 
| AccountNames | List | 数据库账号名称列表。 | 无 | 
| Accounts | List | 数据库账号详情列表。 | 无 | 
| AccountStatus | String | 账号状态。 | 取值: 
 | 
| AccountDescription | String | 账号描述。 | 无 | 
| DBInstanceId | String | 账号所属实例ID。 | 无 | 
| PrivExceeded | String | 账号管理的数据库是否超过最大数量限制。 | 取值: 
 | 
| AccountType | String | 账号类型。 | 取值: 
 | 
| AccountName | String | 数据库账号名称。 | 无 | 
| DatabasePrivileges | Map | 账号拥有的数据库权限列表。 | 例如:  | 
示例
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBInstanceId": {
      "Type": "String",
      "Description": "The ID of the RDS instance."
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::RDS::Accounts",
      "Properties": {
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        }
      }
    }
  },
  "Outputs": {
    "AccountNames": {
      "Description": "The list of The RDS account names.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "AccountNames"
        ]
      }
    },
    "Accounts": {
      "Description": "The list of The RDS accounts.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Accounts"
        ]
      }
    }
  }
}ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DBInstanceId:
    Type: String
    Description: The ID of the RDS instance.
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::RDS::Accounts
    Properties:
      DBInstanceId:
        Ref: DBInstanceId
Outputs:
  AccountNames:
    Description: The list of The RDS account names.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - AccountNames
  Accounts:
    Description: The list of The RDS accounts.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Accounts
                    该文章对您有帮助吗?