-
Notifications
You must be signed in to change notification settings - Fork 35
/
instance.yml
152 lines (152 loc) · 3.19 KB
/
instance.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建Redis实例,配置白名单、账户访问权限及审计日志,自定义网络设置与安全组。
en: Create a Redis instance, configure the whitelist, account access permissions,
and audit logs, customize network settings, and configure security groups.
Parameters:
InstanceClass:
Type: String
Description: Instance Class
InstanceName:
Type: String
Description: Instance Name
EngineVersion:
Type: String
Description: 'AllowedValues: 2.8, 4.0, 5.0'
Default: '5.0'
Password:
Type: String
Description: Login Password.
NoEcho: true
VpcName:
Type: String
Default: mytest
VSwitchName:
Type: String
Default: mytest
ZoneId:
Type: String
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
AccountName:
Type: String
Default: mytest
AccountPassword:
Type: String
AccountPrivilege:
Type: String
Default: RoleReadOnly
SecurityIps:
Type: String
Description: Ip or CIDR mode
Default: 0.0.0.0/0
Resources:
VPC:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Ref: VpcName
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: VPC
VSwitchName:
Ref: VSwitchName
CidrBlock: 192.168.10.0/24
DependsOn: VPC
Instance:
Type: ALIYUN::REDIS::Instance
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: VPC
VSwitchId:
Ref: VSwitch
EngineVersion:
Ref: EngineVersion
InstanceClass:
Ref: InstanceClass
InstanceName:
Ref: InstanceName
Password:
Ref: Password
DependsOn: VSwitch
AuditLogConfig:
Type: ALIYUN::REDIS::AuditLogConfig
Properties:
InstanceId:
Ref: Instance
Retention: 1
Whitelist:
Type: ALIYUN::REDIS::Whitelist
Properties:
InstanceId:
Ref: Instance
SecurityIps:
Ref: SecurityIps
SecurityIpGroupName: ros
SecurityIpGroupAttribute: show
DependsOn: Instance
Account:
Type: ALIYUN::REDIS::Account
Properties:
InstanceId:
Ref: Instance
AccountDescription: Test Create Redis Account
AccountName:
Ref: AccountName
AccountPrivilege:
Ref: AccountPrivilege
AccountPassword:
Ref: AccountPassword
DependsOn: Whitelist
Outputs:
OrderId:
Value:
Fn::GetAtt:
- Instance
- OrderId
InstanceId:
Value:
Fn::GetAtt:
- Instance
- InstanceId
ConnectionDomain:
Value:
Fn::GetAtt:
- Instance
- ConnectionDomain
Port:
Value:
Fn::GetAtt:
- Instance
- Port
AccountInstanceId:
Value:
Fn::GetAtt:
- Account
- InstanceId
AccountName:
Value:
Fn::GetAtt:
- Account
- AccountName
SecurityIps:
Value:
Fn::GetAtt:
- Whitelist
- SecurityIps
SecurityIpGroupName:
Value:
Fn::GetAtt:
- Whitelist
- SecurityIpGroupName
SecurityIpGroupAttribute:
Value:
Fn::GetAtt:
- Whitelist
- SecurityIpGroupAttribute