forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
redis-game-player-leaderboard.yml
183 lines (183 loc) · 6.5 KB
/
redis-game-player-leaderboard.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
ROSTemplateFormatVersion: '2015-09-01'
Conditions:
IsAccountPasswordEmpty1:
Fn::Equals:
- Ref: AccountPassword
- ''
IsAccountPasswordEmpty2:
Fn::Equals:
- Ref: AccountPassword
- null
WillSetAccountPassword:
Fn::Not:
Fn::Or:
- IsAccountPasswordEmpty1
- IsAccountPasswordEmpty2
Parameters:
InstanceId:
Type: String
Label:
en: Redis Instance ID
zh-cn: Redis实例ID
AssociationProperty: ALIYUN::Redis::Instance::InstanceId
AssociationPropertyMetadata:
EditionType: Community
SecurityIps:
Type: String
Label:
en: IP Whitelist
zh-cn: IP白名单
Description:
en: "By default, a Redis instance prohibits access from all IP addresses. \n\
Before starting to use, you need to add the public network address of the\
\ Redis instance to be accessed to the IP whitelist. <br>\nDefault value of\
\ IP whitelist: 0.0.0.0/0, which means that all addresses are allowed to access.\
\ <br>\nYou can also modify the IP whitelist to the public network address\
\ of the local device. \n<a href=\"https://ip.taobao.com/ipSearch.html\" target=\"\
_blank\">Get the public network address of the local device</a>. <br>\nIf\
\ you want to set multiple IP addresses or network segments, please separate\
\ them with commas. \nUp to 1000 can be set. <br>"
zh-cn: |-
Redis实例默认禁止所有IP地址访问。在开始使用前,您需要将待访问Redis实例的公网地址添加到IP白名单中。 <br>
IP白名单默认值:0.0.0.0/0,代表允许所有地址访问。 <br>
您也可以将IP白名单修改为本地设备的公网地址。<a href="https://ip.taobao.com/ipSearch.html" target="_blank">获取本地设备的公网地址</a>。 <br>
如果要设置多个IP地址或网段,请使用英文逗号隔开,最多设置1000个。
AllowedPattern: ^(((2(5[0-5]|[0-4]\d))|(1\d{2})|([1-9]\d)|\d)([.]((2(5[0-5]|[0-4]\d))|(1\d{2})|([1-9]\d)|\d)){3}([/]((3[0-2])|([1-2]\d)|\d))?)(,((2(5[0-5]|[0-4]\d))|(1\d{2})|([1-9]\d)|\d)([.]((2(5[0-5]|[0-4]\d))|(1\d{2})|([1-9]\d)|\d)){3}([/]((3[0-2])|([1-2]\d)|\d))?){0,999}$
AccountPassword:
Type: String
Label:
en: Instance Account Password
zh-cn: 实例账号密码
Description:
en: "If a password has been configured when creating a Redis instance, set this\
\ parameter to reset the password. <br>\nIf no password is configured when\
\ creating a Redis instance, you need to configure a password for the Tair\
\ instance here. <br>\nThe password must be 8 to 32 characters in length.\
\ <br>\nIt must contain at least three of the following character types: uppercase\
\ letters, lowercase letters, digits, and special characters. <br> \nSpecial\
\ characters include <span style=\"background:#E7E9EB;\"><b>!@#$%^&*()_+-=</b></span>."
zh-cn: |-
如果创建Redis实例时已配置密码,设置该参数为重置密码。 <br>
如果创建Redis实例时未配置密码,此处需要为Tair实例配置密码。 <br>
长度为8~32位,需包含大写字母、小写字母、特殊字符和数字中的至少三种,允许的特殊字符包括<span style="background:#E7E9EB;"><b>!@#$%^&*()_+-=</b></span>。
Default: ''
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
Resources:
Connection:
Type: ALIYUN::REDIS::Connection
Properties:
InstanceId:
Ref: InstanceId
ConnectionType: Public
ConnectionStringPrefix:
Fn::Sub: ${InstanceId}-public
Port: 6379
Whitelist:
Type: ALIYUN::REDIS::Whitelist
Properties:
InstanceId:
Ref: InstanceId
SecurityIps:
Ref: SecurityIps
SecurityIpGroupName:
Fn::Sub:
- ros_${suffix}
- suffix:
Fn::Select:
- 0
- Fn::Split:
- '-'
- Ref: ALIYUN::StackId
DependsOn: Connection
Template:
Type: ALIYUN::OOS::Template
Condition: WillSetAccountPassword
Properties:
Content: |-
FormatVersion: OOS-2019-06-01
Parameters:
InstanceId:
Type: String
AccountPassword:
Type: String
Tasks:
- Name: ModifyRedisPassword
Action: ACS::ExecuteAPI
Properties:
Service: R-kvstore
API: ResetAccountPassword
Parameters:
RegionId: '{{ ACS::RegionId }}'
InstanceId: '{{ InstanceId }}'
AccountName: '{{ InstanceId }}'
AccountPassword: '{{ AccountPassword }}'
TemplateName:
Fn::Sub: trial-modify-redis-pwd-${ALIYUN::StackId}
Execution:
Type: ALIYUN::OOS::Execution
Condition: WillSetAccountPassword
Properties:
TemplateName:
Ref: Template
Parameters:
InstanceId:
Ref: InstanceId
AccountPassword:
Ref: AccountPassword
DependsOn: Connection
ResourceCleaner:
Type: ALIYUN::ROS::ResourceCleaner
Condition: WillSetAccountPassword
Properties:
Action: Scan+CleanUp
Resources:
- ResourceId:
Ref: Execution
ResourceType: OOS:Execution
RegionId:
Ref: ALIYUN::Region
- ResourceId:
Ref: Template
ResourceType: OOS:Template
RegionId:
Ref: ALIYUN::Region
CleanUpTimeout: 120
Outputs:
Host:
Description:
en: |-
Public Endpoint. It corresponds to the host variable in the code.
Please continue to Step 4.
zh-cn: |-
公网连接地址。对应代码中的host变量。
请继续步骤四。
Value:
Fn::GetAtt:
- Connection
- ConnectionString
Port:
Description:
en: |-
Service Port Number. It corresponds to the port variable in the code.
Please continue to Step 4.
zh-cn: |-
服务端口。对应代码中的port变量。
请继续步骤四。
Value: 6379
AccountName:
Description:
en: Instance Account.
zh-cn: 实例账号。
Value:
Ref: InstanceId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- InstanceId
- SecurityIps
- AccountPassword
TemplateTags:
- acs:document:试用教程:Redis游戏玩家排行榜