-
Notifications
You must be signed in to change notification settings - Fork 35
/
rds-create-account-database-and-connection.yml
129 lines (129 loc) · 4.19 KB
/
rds-create-account-database-and-connection.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建RDS数据库账户、数据库,设置安全访问IP,并生成数据库连接信息,支持指定实例、数据库名、账号及密码。
en: Create RDS database accounts, databases, configure secure access IPs, and generate
database connection details, supporting specification of instance, database name,
account, and password.
Parameters:
DBInstanceId:
Type: String
Label:
en: RdsInstanceId
zh-cn: 数据库实例Id
Description:
en: The id of RDS instance, make sure the instance has entered the running state
zh-cn: 数据库实例Id,请确保实例已经进入运行中的状态。
AssociationProperty: ALIYUN::RDS::Instance::InstanceId
DBName:
Type: String
Label:
en: Database Name
zh-cn: 数据库(DB)名称
Description:
en: The value can be up to 64 characters in length and can contain lowercase
letters, digits, underscores (_), and hyphens (-). It must start with a lowercase
letter and end with a lowercase letter or digit. An underscore (_) is regarded
as two characters.
zh-cn: 由小写字母、数字、下划线(_)、中划线(-)组成,以小写字母开头,小写字母或数字结尾,最多64个字符。注意:下划线(_)会被看作两个字符。
Default: testdb
AccountName:
Type: String
Label:
en: Database Account
zh-cn: 数据库账号
Description:
en: The account name must be 2 to 32 characters in length and can contain lowercase
letters, digits, and underscores (_). It must start with a letter and end
with a letter or digit.
zh-cn: 由小写字母、数字、下划线(_)组成,以字母开头,以字母或数字结尾,最多32个字符。
Default: testuser
Password:
Type: String
Label:
en: Database account password
zh-cn: 数据库账号密码
Description:
en: 'The password must be 8 to 32 characters in length and must contain at least
three of the following types: uppercase letters, lowercase letter, digits,
and special characters. Special characters include <span style="background:#E7E9EB;"><b>!@#$%^&*()_+-=</b></span>'
zh-cn: 必须包含三种及以上类型:大写字母、小写字母、数字、特殊符号。长度为8~32位。特殊字符包括<span style="background:#E7E9EB;"><b>!@#$%^&*()_+-=</b></span>
AssociationProperty: ALIYUN::RDS::Instance::AccountPassword
NoEcho: true
Resources:
Account:
Type: ALIYUN::RDS::Account
Properties:
AccountName:
Ref: AccountName
AccountType: Super
AccountDescription: tutorial account
AccountPassword:
Ref: Password
DBInstanceId:
Ref: DBInstanceId
DbBase:
Type: ALIYUN::RDS::Database
Properties:
DBInstanceId:
Ref: DBInstanceId
CharacterSetName: utf8
DBName:
Ref: DBName
DBDescription: tutorial base
SecurityIps:
Type: ALIYUN::RDS::DBInstanceSecurityIps
Properties:
DBInstanceId:
Ref: DBInstanceId
DBInstanceIPArrayAttribute: 0.0.0.0/0
Connection:
Type: ALIYUN::RDS::Connection
Properties:
DBInstanceId:
Ref: DBInstanceId
Port: 3306
ConnectionStringPrefix:
Fn::Sub: ${DBInstanceId}o
Outputs:
PublicEndpoint:
Description:
en: Public Endpoint.
zh-cn: 外网地址。
Value:
Fn::GetAtt:
- Connection
- ConnectionString
PublicPort:
Description:
en: Public port.
zh-cn: 外网端口。
Value:
Fn::GetAtt:
- Connection
- Port
DBName:
Description:
en: The name of database.
zh-cn: 数据库名称。
Value:
Fn::GetAtt:
- DbBase
- DBName
AccountName:
Description:
en: Database username.
zh-cn: 数据库用户名。
Value:
Fn::GetAtt:
- Account
- AccountName
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- DBInstanceId
- DBName
- AccountName
- Password
TemplateTags:
- acs:document:试用教程:创建连接RDS数据库并进行读写操作