全部产品
Search
文档中心

资源编排:ALIYUN::EHPC::Users

更新时间:Nov 23, 2023

ALIYUN::EHPC::Users类型用于为指定集群新增一个或多个用户。

语法

{
  "Type": "ALIYUN::EHPC::Users",
  "Properties": {
    "ClusterId": String,
    "Users": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ClusterId

String

集群ID。

Users

List

用户信息。

添加的用户数量小于100。更多信息,请参见Users属性

Users语法

"Users": [
  {
    "Group": String,
    "Password": String,
    "Name": String
  }
]

Users属性

属性名称

类型

必须

允许更新

描述

约束

Group

String

新增用户的用户组。

取值:

  • users:普通权限组,适用于只有提交、调试作业需求的普通用户。

  • wheel:sudo权限组,适用于需要管理集群的管理员,除提交、调试作业外,还可以执行sudo命令进行安装软件、重启节点等操作。

Password

String

新增用户的密码。

长度为8~30个字符,必须同时包含以下四项中的三项:

  • 大写英文字母。

  • 小写英文字母。

  • 数字。

  • 特殊字符:()~!@#$%^&*-_+=|{}[]:;'/<>,.?/

Name

String

新增的用户名。

长度为6~30个字符,必须以英文字母开头,可以包含数字、特殊字符(.)。

返回值

Fn::GetAtt

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ClusterId:
        Type: String
        Description:
          en: The cluster ID.
        Default: ehpc-hz-FYUr32****
      Users:
        AssociationPropertyMetadata:
          Parameter:
            AssociationPropertyMetadata:
              Parameters:
                Group:
                  Type: String
                  Description:
                    en: |-
                      The permission group to which the user N belongs. Valid values:
                      - **users**: an ordinary permission group. It is applicable to ordinary users that need only to submit and debug jobs.
                      - **wheel**: a sudo permission group. It is applicable to the administrator who needs to manage the cluster. In addition to submitting and debugging jobs, users who have sudo permissions can run sudo commands to install software and restart nodes.
                      Valid values of N: 1 to 100.
                Password:
                  Type: String
                  Description:
                    en: |-
                      The password of the Nth user. The password must be 8 to 30 characters in length and contain three of the following items:
                      - Uppercase letter
                      - Lowercase letter
                      - Digit
                      - Special character: ()~!@#$%^&*-_+=|{}[]:;'/<>,.?/
                      Valid values of N: 1 to 100.
                Name:
                  Type: String
                  Description:
                    en: |-
                      The name of the user that you want to add. The name must be 6 to 30 characters in length and can contain letters, digits, and periods (.). It must start with a letter. 
                      Valid values of N: 1 to 100.
            Type: Json
        AssociationProperty: List[Parameter]
        Type: Json
        Description:
          en: The information about the users.
        MaxLength: 100
        Default:
          - Group: user1
            Password: 1@a2****
            Name: users
    Resources:
      EHPCUsers:
        Type: ALIYUN::EHPC::Users
        Properties:
          ClusterId:
            Ref: ClusterId
          Users:
            Ref: Users
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ClusterId": {
          "Type": "String",
          "Description": {
            "en": "The cluster ID."
          },
          "Default": "ehpc-hz-FYUr32****"
        },
        "Users": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "AssociationPropertyMetadata": {
                "Parameters": {
                  "Group": {
                    "Type": "String",
                    "Description": {
                      "en": "The permission group to which the user N belongs. Valid values:\n- **users**: an ordinary permission group. It is applicable to ordinary users that need only to submit and debug jobs.\n- **wheel**: a sudo permission group. It is applicable to the administrator who needs to manage the cluster. In addition to submitting and debugging jobs, users who have sudo permissions can run sudo commands to install software and restart nodes.\nValid values of N: 1 to 100."
                    }
                  },
                  "Password": {
                    "Type": "String",
                    "Description": {
                      "en": "The password of the Nth user. The password must be 8 to 30 characters in length and contain three of the following items:\n- Uppercase letter\n- Lowercase letter\n- Digit\n- Special character: ()~!@#$%^&*-_+=|{}[]:;'/<>,.?/\nValid values of N: 1 to 100."
                    }
                  },
                  "Name": {
                    "Type": "String",
                    "Description": {
                      "en": "The name of the user that you want to add. The name must be 6 to 30 characters in length and can contain letters, digits, and periods (.). It must start with a letter. \nValid values of N: 1 to 100."
                    }
                  }
                }
              },
              "Type": "Json"
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "The information about the users."
          },
          "MaxLength": 100,
          "Default": [
      {
        "Group": "user1",
        "Password": "1@a2****",
        "Name": "users"
      }
    ]
        }
      },
      "Resources": {
        "EHPCUsers": {
          "Type": "ALIYUN::EHPC::Users",
          "Properties": {
            "ClusterId": {
              "Ref": "ClusterId"
            },
            "Users": {
              "Ref": "Users"
            }
          }
        }
      }
    }