forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ram-create-user-and-authorize.yml
93 lines (93 loc) · 3.27 KB
/
ram-create-user-and-authorize.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建RAM用户,设置密码策略与登录凭证,附加管理员访问策略,输出用户登录信息与授权策略名。
en: Create RAM users, configure password policies and login credentials, attach
an administrator access policy, and output user login information along with the
names of authorized policies.
Parameters:
RAMUserName:
Type: String
Label:
en: RAM user name
zh-cn: RAM用户的名称
Description:
en: The length is 1~64 characters, and can contain English letters, numbers,
half-width periods (.), dashes (-) and underscores (_).
zh-cn: 长度为1~64个字符,可包含英文字母、数字、半角句号(.)、短划线(-)和下划线(_)。
AllowedPattern: ^[a-zA-Z0-9._-]{1,64}$
RAMUserPassword:
Type: String
Label:
en: RAM user password
zh-cn: RAM用户的密码
Description:
en: |-
The password must be 8 to 32 characters in length. <br>
It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. <br>
Special characters include <span style="background:#E7E9EB;"><b>!@#$%^&*()_+-=</b></span>.
zh-cn: 长度为8~32位,需包含大写字母、小写字母、特殊字符和数字中的至少三种,允许的特殊字符包括<span style="background:#E7E9EB;"><b>!@#$%^&*()_+-=</b></span>。
AllowedPattern: ^(?=.*[a-zA-Z])(?=.*[a-z0-9])(?=.*[a-z!@#$%^&*()_+=-])(?=.*[A-Z0-9])(?=.*[A-Z!@#$%^&*()_+=-])(?=.*[0-9!@#$%^&*()_+=-])[a-zA-Z0-9!@#$%^&*()_+=-]{8,32}$
NoEcho: true
Confirm: true
PolicyName:
Type: String
Label:
en: Authorization policy name for RAM users
zh-cn: 为RAM用户授权的权限策略名称
Description:
en: The current authorized application scope is the entire cloud account.
zh-cn: 当前授权应用范围为整个云账号。
Default: AdministratorAccess
AllowedValues:
- AdministratorAccess
Resources:
User:
Type: ALIYUN::RAM::User
Properties:
UserName:
Ref: RAMUserName
LoginProfile:
MFABindRequired: 'False'
Password:
Ref: RAMUserPassword
PasswordResetRequired: 'False'
AttachPolicyToUser:
Type: ALIYUN::RAM::AttachPolicyToUser
Properties:
PolicyType: System
UserName:
Ref: RAMUserName
PolicyName:
Ref: PolicyName
DependsOn: User
Outputs:
RAMLoginName:
Description:
en: Login name
zh-cn: 登录名称(使用RAM用户登录阿里云控制台,登录链接:https://signin.aliyun.com/)
Value:
Fn::Sub:
- ${RAMUserName}@${ALIYUN::TenantId}.onaliyun.com
- RAMUserName:
Ref: RAMUserName
RAMLoginPassword:
Description:
en: Login password
zh-cn: 登录密码
Value:
Ref: RAMUserPassword
PolicyName:
Description:
en: Authorization policy name for RAM users
zh-cn: 为RAM用户授权的权限策略名称
Value:
Ref: PolicyName
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- RAMUserName
- RAMUserPassword
- PolicyName
TemplateTags:
- acs:document:试用教程:创建RAM用户并授权