-
Notifications
You must be signed in to change notification settings - Fork 5
/
enterpriseInstance.go
344 lines (331 loc) · 17.2 KB
/
enterpriseInstance.go
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package dms
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides a DMS Enterprise Instance resource.
//
// > **NOTE:** API users must first register in DMS.
// > **NOTE:** Available in 1.81.0+.
type EnterpriseInstance struct {
pulumi.CustomResourceState
// Cross-database query datalink name.
DataLinkName pulumi.StringPtrOutput `pulumi:"dataLinkName"`
// Database access password.
DatabasePassword pulumi.StringOutput `pulumi:"databasePassword"`
// Database access account.
DatabaseUser pulumi.StringOutput `pulumi:"databaseUser"`
DbaId pulumi.StringOutput `pulumi:"dbaId"`
// The instance dba nickname.
DbaNickName pulumi.StringOutput `pulumi:"dbaNickName"`
// The DBA of the instance is passed into the Alibaba Cloud uid of the DBA.
DbaUid pulumi.IntOutput `pulumi:"dbaUid"`
// Whether to use online services, currently only supports MySQL and PolarDB. Valid values: `0` Not used, `1` Native online DDL priority, `2` DMS lock-free table structure change priority.
DdlOnline pulumi.IntPtrOutput `pulumi:"ddlOnline"`
// ECS instance ID. The value of InstanceSource is the ECS self-built library. This value must be passed.
EcsInstanceId pulumi.StringOutput `pulumi:"ecsInstanceId"`
// The region where the instance is located. This value must be passed when the value of InstanceSource is RDS, ECS self-built library, and VPC dedicated line IDC.
EcsRegion pulumi.StringPtrOutput `pulumi:"ecsRegion"`
// Environment type. Valid values: `product` production environment, `dev` development environment, `pre` pre-release environment, `test` test environment, `sit` SIT environment, `uat` UAT environment, `pet` pressure test environment, `stag` STAG environment.
EnvType pulumi.StringOutput `pulumi:"envType"`
// Export timeout, unit: s (seconds).
ExportTimeout pulumi.IntOutput `pulumi:"exportTimeout"`
// Host address of the target database.
Host pulumi.StringOutput `pulumi:"host"`
// Instance alias, to help users quickly distinguish positioning.
InstanceAlias pulumi.StringOutput `pulumi:"instanceAlias"`
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// The source of the database instance. Valid values: `PUBLIC_OWN`, `RDS`, `ECS_OWN`, `VPC_IDC`.
InstanceSource pulumi.StringOutput `pulumi:"instanceSource"`
// Database type. Valid values: `MySQL`, `SQLServer`, `PostgreSQL`, `Oracle,` `DRDS`, `OceanBase`, `Mongo`, `Redis`.
InstanceType pulumi.StringOutput `pulumi:"instanceType"`
// Network type. Valid values: `CLASSIC`, `VPC`.
NetworkType pulumi.StringOutput `pulumi:"networkType"`
// Access port of the target database.
Port pulumi.IntOutput `pulumi:"port"`
// Query timeout time, unit: s (seconds).
QueryTimeout pulumi.IntOutput `pulumi:"queryTimeout"`
// The security rule of the instance is passed into the name of the security rule in the enterprise.
SafeRule pulumi.StringOutput `pulumi:"safeRule"`
SafeRuleId pulumi.StringOutput `pulumi:"safeRuleId"`
// The SID. This value must be passed when InstanceType is PostgreSQL or Oracle.
Sid pulumi.StringPtrOutput `pulumi:"sid"`
// The instance status.
State pulumi.StringOutput `pulumi:"state"`
// The tenant ID.
Tid pulumi.IntPtrOutput `pulumi:"tid"`
// Whether to enable cross-instance query. Valid values: `0` not open, `1` open.
UseDsql pulumi.IntPtrOutput `pulumi:"useDsql"`
// VPC ID. This value must be passed when the value of InstanceSource is VPC dedicated line IDC.
VpcId pulumi.StringPtrOutput `pulumi:"vpcId"`
}
// NewEnterpriseInstance registers a new resource with the given unique name, arguments, and options.
func NewEnterpriseInstance(ctx *pulumi.Context,
name string, args *EnterpriseInstanceArgs, opts ...pulumi.ResourceOption) (*EnterpriseInstance, error) {
if args == nil || args.DatabasePassword == nil {
return nil, errors.New("missing required argument 'DatabasePassword'")
}
if args == nil || args.DatabaseUser == nil {
return nil, errors.New("missing required argument 'DatabaseUser'")
}
if args == nil || args.DbaUid == nil {
return nil, errors.New("missing required argument 'DbaUid'")
}
if args == nil || args.EnvType == nil {
return nil, errors.New("missing required argument 'EnvType'")
}
if args == nil || args.ExportTimeout == nil {
return nil, errors.New("missing required argument 'ExportTimeout'")
}
if args == nil || args.Host == nil {
return nil, errors.New("missing required argument 'Host'")
}
if args == nil || args.InstanceAlias == nil {
return nil, errors.New("missing required argument 'InstanceAlias'")
}
if args == nil || args.InstanceSource == nil {
return nil, errors.New("missing required argument 'InstanceSource'")
}
if args == nil || args.InstanceType == nil {
return nil, errors.New("missing required argument 'InstanceType'")
}
if args == nil || args.NetworkType == nil {
return nil, errors.New("missing required argument 'NetworkType'")
}
if args == nil || args.Port == nil {
return nil, errors.New("missing required argument 'Port'")
}
if args == nil || args.QueryTimeout == nil {
return nil, errors.New("missing required argument 'QueryTimeout'")
}
if args == nil || args.SafeRule == nil {
return nil, errors.New("missing required argument 'SafeRule'")
}
if args == nil {
args = &EnterpriseInstanceArgs{}
}
var resource EnterpriseInstance
err := ctx.RegisterResource("alicloud:dms/enterpriseInstance:EnterpriseInstance", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEnterpriseInstance gets an existing EnterpriseInstance resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEnterpriseInstance(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EnterpriseInstanceState, opts ...pulumi.ResourceOption) (*EnterpriseInstance, error) {
var resource EnterpriseInstance
err := ctx.ReadResource("alicloud:dms/enterpriseInstance:EnterpriseInstance", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EnterpriseInstance resources.
type enterpriseInstanceState struct {
// Cross-database query datalink name.
DataLinkName *string `pulumi:"dataLinkName"`
// Database access password.
DatabasePassword *string `pulumi:"databasePassword"`
// Database access account.
DatabaseUser *string `pulumi:"databaseUser"`
DbaId *string `pulumi:"dbaId"`
// The instance dba nickname.
DbaNickName *string `pulumi:"dbaNickName"`
// The DBA of the instance is passed into the Alibaba Cloud uid of the DBA.
DbaUid *int `pulumi:"dbaUid"`
// Whether to use online services, currently only supports MySQL and PolarDB. Valid values: `0` Not used, `1` Native online DDL priority, `2` DMS lock-free table structure change priority.
DdlOnline *int `pulumi:"ddlOnline"`
// ECS instance ID. The value of InstanceSource is the ECS self-built library. This value must be passed.
EcsInstanceId *string `pulumi:"ecsInstanceId"`
// The region where the instance is located. This value must be passed when the value of InstanceSource is RDS, ECS self-built library, and VPC dedicated line IDC.
EcsRegion *string `pulumi:"ecsRegion"`
// Environment type. Valid values: `product` production environment, `dev` development environment, `pre` pre-release environment, `test` test environment, `sit` SIT environment, `uat` UAT environment, `pet` pressure test environment, `stag` STAG environment.
EnvType *string `pulumi:"envType"`
// Export timeout, unit: s (seconds).
ExportTimeout *int `pulumi:"exportTimeout"`
// Host address of the target database.
Host *string `pulumi:"host"`
// Instance alias, to help users quickly distinguish positioning.
InstanceAlias *string `pulumi:"instanceAlias"`
InstanceId *string `pulumi:"instanceId"`
// The source of the database instance. Valid values: `PUBLIC_OWN`, `RDS`, `ECS_OWN`, `VPC_IDC`.
InstanceSource *string `pulumi:"instanceSource"`
// Database type. Valid values: `MySQL`, `SQLServer`, `PostgreSQL`, `Oracle,` `DRDS`, `OceanBase`, `Mongo`, `Redis`.
InstanceType *string `pulumi:"instanceType"`
// Network type. Valid values: `CLASSIC`, `VPC`.
NetworkType *string `pulumi:"networkType"`
// Access port of the target database.
Port *int `pulumi:"port"`
// Query timeout time, unit: s (seconds).
QueryTimeout *int `pulumi:"queryTimeout"`
// The security rule of the instance is passed into the name of the security rule in the enterprise.
SafeRule *string `pulumi:"safeRule"`
SafeRuleId *string `pulumi:"safeRuleId"`
// The SID. This value must be passed when InstanceType is PostgreSQL or Oracle.
Sid *string `pulumi:"sid"`
// The instance status.
State *string `pulumi:"state"`
// The tenant ID.
Tid *int `pulumi:"tid"`
// Whether to enable cross-instance query. Valid values: `0` not open, `1` open.
UseDsql *int `pulumi:"useDsql"`
// VPC ID. This value must be passed when the value of InstanceSource is VPC dedicated line IDC.
VpcId *string `pulumi:"vpcId"`
}
type EnterpriseInstanceState struct {
// Cross-database query datalink name.
DataLinkName pulumi.StringPtrInput
// Database access password.
DatabasePassword pulumi.StringPtrInput
// Database access account.
DatabaseUser pulumi.StringPtrInput
DbaId pulumi.StringPtrInput
// The instance dba nickname.
DbaNickName pulumi.StringPtrInput
// The DBA of the instance is passed into the Alibaba Cloud uid of the DBA.
DbaUid pulumi.IntPtrInput
// Whether to use online services, currently only supports MySQL and PolarDB. Valid values: `0` Not used, `1` Native online DDL priority, `2` DMS lock-free table structure change priority.
DdlOnline pulumi.IntPtrInput
// ECS instance ID. The value of InstanceSource is the ECS self-built library. This value must be passed.
EcsInstanceId pulumi.StringPtrInput
// The region where the instance is located. This value must be passed when the value of InstanceSource is RDS, ECS self-built library, and VPC dedicated line IDC.
EcsRegion pulumi.StringPtrInput
// Environment type. Valid values: `product` production environment, `dev` development environment, `pre` pre-release environment, `test` test environment, `sit` SIT environment, `uat` UAT environment, `pet` pressure test environment, `stag` STAG environment.
EnvType pulumi.StringPtrInput
// Export timeout, unit: s (seconds).
ExportTimeout pulumi.IntPtrInput
// Host address of the target database.
Host pulumi.StringPtrInput
// Instance alias, to help users quickly distinguish positioning.
InstanceAlias pulumi.StringPtrInput
InstanceId pulumi.StringPtrInput
// The source of the database instance. Valid values: `PUBLIC_OWN`, `RDS`, `ECS_OWN`, `VPC_IDC`.
InstanceSource pulumi.StringPtrInput
// Database type. Valid values: `MySQL`, `SQLServer`, `PostgreSQL`, `Oracle,` `DRDS`, `OceanBase`, `Mongo`, `Redis`.
InstanceType pulumi.StringPtrInput
// Network type. Valid values: `CLASSIC`, `VPC`.
NetworkType pulumi.StringPtrInput
// Access port of the target database.
Port pulumi.IntPtrInput
// Query timeout time, unit: s (seconds).
QueryTimeout pulumi.IntPtrInput
// The security rule of the instance is passed into the name of the security rule in the enterprise.
SafeRule pulumi.StringPtrInput
SafeRuleId pulumi.StringPtrInput
// The SID. This value must be passed when InstanceType is PostgreSQL or Oracle.
Sid pulumi.StringPtrInput
// The instance status.
State pulumi.StringPtrInput
// The tenant ID.
Tid pulumi.IntPtrInput
// Whether to enable cross-instance query. Valid values: `0` not open, `1` open.
UseDsql pulumi.IntPtrInput
// VPC ID. This value must be passed when the value of InstanceSource is VPC dedicated line IDC.
VpcId pulumi.StringPtrInput
}
func (EnterpriseInstanceState) ElementType() reflect.Type {
return reflect.TypeOf((*enterpriseInstanceState)(nil)).Elem()
}
type enterpriseInstanceArgs struct {
// Cross-database query datalink name.
DataLinkName *string `pulumi:"dataLinkName"`
// Database access password.
DatabasePassword string `pulumi:"databasePassword"`
// Database access account.
DatabaseUser string `pulumi:"databaseUser"`
DbaId *string `pulumi:"dbaId"`
// The DBA of the instance is passed into the Alibaba Cloud uid of the DBA.
DbaUid int `pulumi:"dbaUid"`
// Whether to use online services, currently only supports MySQL and PolarDB. Valid values: `0` Not used, `1` Native online DDL priority, `2` DMS lock-free table structure change priority.
DdlOnline *int `pulumi:"ddlOnline"`
// ECS instance ID. The value of InstanceSource is the ECS self-built library. This value must be passed.
EcsInstanceId *string `pulumi:"ecsInstanceId"`
// The region where the instance is located. This value must be passed when the value of InstanceSource is RDS, ECS self-built library, and VPC dedicated line IDC.
EcsRegion *string `pulumi:"ecsRegion"`
// Environment type. Valid values: `product` production environment, `dev` development environment, `pre` pre-release environment, `test` test environment, `sit` SIT environment, `uat` UAT environment, `pet` pressure test environment, `stag` STAG environment.
EnvType string `pulumi:"envType"`
// Export timeout, unit: s (seconds).
ExportTimeout int `pulumi:"exportTimeout"`
// Host address of the target database.
Host string `pulumi:"host"`
// Instance alias, to help users quickly distinguish positioning.
InstanceAlias string `pulumi:"instanceAlias"`
InstanceId *string `pulumi:"instanceId"`
// The source of the database instance. Valid values: `PUBLIC_OWN`, `RDS`, `ECS_OWN`, `VPC_IDC`.
InstanceSource string `pulumi:"instanceSource"`
// Database type. Valid values: `MySQL`, `SQLServer`, `PostgreSQL`, `Oracle,` `DRDS`, `OceanBase`, `Mongo`, `Redis`.
InstanceType string `pulumi:"instanceType"`
// Network type. Valid values: `CLASSIC`, `VPC`.
NetworkType string `pulumi:"networkType"`
// Access port of the target database.
Port int `pulumi:"port"`
// Query timeout time, unit: s (seconds).
QueryTimeout int `pulumi:"queryTimeout"`
// The security rule of the instance is passed into the name of the security rule in the enterprise.
SafeRule string `pulumi:"safeRule"`
SafeRuleId *string `pulumi:"safeRuleId"`
// The SID. This value must be passed when InstanceType is PostgreSQL or Oracle.
Sid *string `pulumi:"sid"`
// The tenant ID.
Tid *int `pulumi:"tid"`
// Whether to enable cross-instance query. Valid values: `0` not open, `1` open.
UseDsql *int `pulumi:"useDsql"`
// VPC ID. This value must be passed when the value of InstanceSource is VPC dedicated line IDC.
VpcId *string `pulumi:"vpcId"`
}
// The set of arguments for constructing a EnterpriseInstance resource.
type EnterpriseInstanceArgs struct {
// Cross-database query datalink name.
DataLinkName pulumi.StringPtrInput
// Database access password.
DatabasePassword pulumi.StringInput
// Database access account.
DatabaseUser pulumi.StringInput
DbaId pulumi.StringPtrInput
// The DBA of the instance is passed into the Alibaba Cloud uid of the DBA.
DbaUid pulumi.IntInput
// Whether to use online services, currently only supports MySQL and PolarDB. Valid values: `0` Not used, `1` Native online DDL priority, `2` DMS lock-free table structure change priority.
DdlOnline pulumi.IntPtrInput
// ECS instance ID. The value of InstanceSource is the ECS self-built library. This value must be passed.
EcsInstanceId pulumi.StringPtrInput
// The region where the instance is located. This value must be passed when the value of InstanceSource is RDS, ECS self-built library, and VPC dedicated line IDC.
EcsRegion pulumi.StringPtrInput
// Environment type. Valid values: `product` production environment, `dev` development environment, `pre` pre-release environment, `test` test environment, `sit` SIT environment, `uat` UAT environment, `pet` pressure test environment, `stag` STAG environment.
EnvType pulumi.StringInput
// Export timeout, unit: s (seconds).
ExportTimeout pulumi.IntInput
// Host address of the target database.
Host pulumi.StringInput
// Instance alias, to help users quickly distinguish positioning.
InstanceAlias pulumi.StringInput
InstanceId pulumi.StringPtrInput
// The source of the database instance. Valid values: `PUBLIC_OWN`, `RDS`, `ECS_OWN`, `VPC_IDC`.
InstanceSource pulumi.StringInput
// Database type. Valid values: `MySQL`, `SQLServer`, `PostgreSQL`, `Oracle,` `DRDS`, `OceanBase`, `Mongo`, `Redis`.
InstanceType pulumi.StringInput
// Network type. Valid values: `CLASSIC`, `VPC`.
NetworkType pulumi.StringInput
// Access port of the target database.
Port pulumi.IntInput
// Query timeout time, unit: s (seconds).
QueryTimeout pulumi.IntInput
// The security rule of the instance is passed into the name of the security rule in the enterprise.
SafeRule pulumi.StringInput
SafeRuleId pulumi.StringPtrInput
// The SID. This value must be passed when InstanceType is PostgreSQL or Oracle.
Sid pulumi.StringPtrInput
// The tenant ID.
Tid pulumi.IntPtrInput
// Whether to enable cross-instance query. Valid values: `0` not open, `1` open.
UseDsql pulumi.IntPtrInput
// VPC ID. This value must be passed when the value of InstanceSource is VPC dedicated line IDC.
VpcId pulumi.StringPtrInput
}
func (EnterpriseInstanceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*enterpriseInstanceArgs)(nil)).Elem()
}