ALIYUN::TSDB::InfluxDBUser类型用于创建时间序列数据库账号。
语法
{
  "Type": "ALIYUN::TSDB::InfluxDBUser",
  "Properties": {
    "UserName": String,
    "DatabasePermissions": List,
    "InstanceId": String,
    "UserType": String,
    "Password": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|---|---|---|---|---|
| UserName | String | 是 | 否 | 用户名。 | 长度为1~16个字符,比须以小写英文字母开头,以小写英文字母或数字结尾。可包含小写英文字母、数字和下划线(_)。 | 
| DatabasePermissions | List | 否 | 是 | 用户可以访问的时间序列数据库列表。 | 当UserType取值为normal时,该参数有效。 更多信息,请参见DatabasePermissions属性。 | 
| InstanceId | String | 是 | 否 | 时间序列数据库实例ID。 | 无 | 
| UserType | String | 是 | 否 | 用户类型。 | 取值: 
 | 
| Password | String | 是 | 是 | 密码。 | 长度为8~32个字符,可包含英文字母、数字和特殊字符 !@#$%^*()_+-=。 | 
DatabasePermissions语法
"DatabasePermissions": [
  {
    "Permission": String,
    "DBName": String
  }
]DatabasePermissions属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|---|---|---|---|---|
| Permission | String | 是 | 是 | 时间序列数据库的权限。 | 取值: 
 | 
| DBName | String | 是 | 是 | 时间序列数据库的名称。 | 长度为1~64个字符。以小写英文字母开头,以小写英文字母或数字结尾。可包含小写英文字母、数字和下划线(_)。 | 
返回值
Fn::GetAtt
- UserName:用户名。
- InstanceId:时间序列数据库实例ID。
- UserType:用户类型。
示例
JSON格式
                  
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "UserName": {
      "Type": "String",
      "Description": "The name of user. The name can at must be 16 characters in length and can contain lowercase letters, digits, and underscores (_). It must start with a letter and end with a letter or digit.",
      "MinLength": 1,
      "MaxLength": 16,
      "Default": "test"
    },
    "DatabasePermissions": {
      "Type": "Json",
      "Description": "The list of databases that the user can access. If the user type is admin, do not specify this parameter.",
      "Default": [
        {
          "Permission": "all",
          "DBName": "testDB"
        }
      ]
    },
    "InstanceId": {
      "Type": "String",
      "Description": "The ID of TSDB for InfluxDB.",
      "Default": "ts-wz99vz6u8jg39****"
    },
    "UserType": {
      "Type": "String",
      "Description": "The type of user. Valid values:\nnormal: normal user\nadmin: administrator user.",
      "AllowedValues": [
        "normal",
        "admin"
      ],
      "Default": "normal"
    },
    "Password": {
      "Type": "String",
      "Description": "The password must be 8 to 32 characters in length and contain letters, digits, and special characters.!@#$%^*()_+-=",
      "MinLength": 8,
      "MaxLength": 32,
      "Default": "Test_Pwd"
    }
  },
  "Resources": {
    "InfluxDBUser": {
      "Type": "ALIYUN::TSDB::InfluxDBUser",
      "Properties": {
        "UserName": {
          "Ref": "UserName"
        },
        "DatabasePermissions": {
          "Ref": "DatabasePermissions"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "UserType": {
          "Ref": "UserType"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "UserName": {
      "Description": "The name of user.",
      "Value": {
        "Fn::GetAtt": [
          "InfluxDBUser",
          "UserName"
        ]
      }
    },
    "InstanceId": {
      "Description": "The ID of TSDB for InfluxDB.",
      "Value": {
        "Fn::GetAtt": [
          "InfluxDBUser",
          "InstanceId"
        ]
      }
    },
    "UserType": {
      "Description": "The type of user.",
      "Value": {
        "Fn::GetAtt": [
          "InfluxDBUser",
          "UserType"
        ]
      }
    }
  }
}