ALIYUN::KAFKA::SaslUser

ALIYUN::KAFKA::SaslUser类型用于创建SASL用户。

语法

{
  "Type": "ALIYUN::KAFKA::SaslUser",
  "Properties": {
    "InstanceId": String,
    "Password": String,
    "Username": String,
    "Mechanism": String,
    "Type": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

InstanceId

String

实例 ID。

Password

String

密码。

Username

String

用户名。

Mechanism

String

加密方式。

取值:

  • SCRAM-SHA-512 (默认选中)。

  • SCRAM-SHA-256。

说明

该参数仅支持 V3 系列(Serverless)实例。

Type

String

类型。取值:

  • plain:一种简单的用户名密码校验机制。消息队列 Kafka 版优化了 PLAIN 机制,支持不重启实例的情况下动态增加 SASL 用户。

  • scram:一种用户名密码校验机制,安全性比 PLAIN 更高。消息队列 Kafka 版使用 SCRAM-SHA-256。

  • LDAP:仅适应于创建 Confluent 实例用户。

默认值为plain

返回值

Fn::GetAtt

  • InstanceId:实例 ID。

  • Username:用户名。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Username:
        Type: String
        Description:
          en: The name of the SASL user.
        AllowedPattern: ^[a-zA-Z][a-zA-Z0-9_]{2,63}$
        Required: true
      InstanceId:
        Type: String
        Description:
          en: The instance ID.
        Required: true
        MinLength: 1
        MaxLength: 64
      Password:
        Type: String
        Description:
          en: The password of the SASL user.
        Required: true
    Resources:
      SaslUser:
        Type: ALIYUN::KAFKA::SaslUser
        Properties:
          Username:
            Ref: Username
          InstanceId:
            Ref: InstanceId
          Password:
            Ref: Password
    Outputs:
      InstanceId:
        Description: The instance ID.
        Value:
          Fn::GetAtt:
            - SaslUser
            - InstanceId
      Username:
        Description: The user name of the instance.
        Value:
          Fn::GetAtt:
            - SaslUser
            - Username
    
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Username": {
          "Type": "String",
          "Description": {
            "en": "The name of the SASL user."
          },
          "AllowedPattern": "^[a-zA-Z][a-zA-Z0-9_]{2,63}$",
          "Required": true
        },
        "InstanceId": {
          "Type": "String",
          "Description": {
            "en": "The instance ID."
          },
          "Required": true,
          "MinLength": 1,
          "MaxLength": 64
        },
        "Password": {
          "Type": "String",
          "Description": {
            "en": "The password of the SASL user."
          },
          "Required": true
        }
      },
      "Resources": {
        "SaslUser": {
          "Type": "ALIYUN::KAFKA::SaslUser",
          "Properties": {
            "Username": {
              "Ref": "Username"
            },
            "InstanceId": {
              "Ref": "InstanceId"
            },
            "Password": {
              "Ref": "Password"
            }
          }
        }
      },
      "Outputs": {
        "InstanceId": {
          "Description": "The instance ID.",
          "Value": {
            "Fn::GetAtt": [
              "SaslUser",
              "InstanceId"
            ]
          }
        },
        "Username": {
          "Description": "The user name of the instance.",
          "Value": {
            "Fn::GetAtt": [
              "SaslUser",
              "Username"
            ]
          }
        }
      }
    }