/
rdsParameterGroup.go
347 lines (296 loc) · 13.4 KB
/
rdsParameterGroup.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
345
346
347
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package rds
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a RDS Parameter Group resource.
//
// For information about RDS Parameter Group and how to use it, see [What is Parameter Group](https://www.alibabacloud.com/help/en/doc-detail/144839.htm).
//
// > **NOTE:** Available since v1.119.0.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rds"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// cfg := config.New(ctx, "")
// name := "tf_example"
// if param := cfg.Get("name"); param != "" {
// name = param
// }
// _, err := rds.NewRdsParameterGroup(ctx, "default", &rds.RdsParameterGroupArgs{
// Engine: pulumi.String("mysql"),
// EngineVersion: pulumi.String("5.7"),
// ParamDetails: rds.RdsParameterGroupParamDetailArray{
// &rds.RdsParameterGroupParamDetailArgs{
// ParamName: pulumi.String("back_log"),
// ParamValue: pulumi.String("4000"),
// },
// &rds.RdsParameterGroupParamDetailArgs{
// ParamName: pulumi.String("wait_timeout"),
// ParamValue: pulumi.String("86460"),
// },
// },
// ParameterGroupDesc: pulumi.String(name),
// ParameterGroupName: pulumi.String(name),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// RDS Parameter Group can be imported using the id, e.g.
//
// ```sh
// $ pulumi import alicloud:rds/rdsParameterGroup:RdsParameterGroup example <id>
// ```
type RdsParameterGroup struct {
pulumi.CustomResourceState
// The database engine. Valid values: `mysql`, `mariadb`, `PostgreSQL`.
Engine pulumi.StringOutput `pulumi:"engine"`
// The version of the database engine. Valid values: mysql: `5.1`, `5.5`, `5.6`, `5.7`, `8.0`; mariadb: `10.3`; PostgreSQL: `10.0`, `11.0`, `12.0`, `13.0`, `14.0`, `15.0`.
EngineVersion pulumi.StringOutput `pulumi:"engineVersion"`
// Parameter list. See `paramDetail` below.
ParamDetails RdsParameterGroupParamDetailArrayOutput `pulumi:"paramDetails"`
// The description of the parameter template.
ParameterGroupDesc pulumi.StringPtrOutput `pulumi:"parameterGroupDesc"`
// The name of the parameter template.
ParameterGroupName pulumi.StringOutput `pulumi:"parameterGroupName"`
}
// NewRdsParameterGroup registers a new resource with the given unique name, arguments, and options.
func NewRdsParameterGroup(ctx *pulumi.Context,
name string, args *RdsParameterGroupArgs, opts ...pulumi.ResourceOption) (*RdsParameterGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Engine == nil {
return nil, errors.New("invalid value for required argument 'Engine'")
}
if args.EngineVersion == nil {
return nil, errors.New("invalid value for required argument 'EngineVersion'")
}
if args.ParamDetails == nil {
return nil, errors.New("invalid value for required argument 'ParamDetails'")
}
if args.ParameterGroupName == nil {
return nil, errors.New("invalid value for required argument 'ParameterGroupName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource RdsParameterGroup
err := ctx.RegisterResource("alicloud:rds/rdsParameterGroup:RdsParameterGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRdsParameterGroup gets an existing RdsParameterGroup 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 GetRdsParameterGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RdsParameterGroupState, opts ...pulumi.ResourceOption) (*RdsParameterGroup, error) {
var resource RdsParameterGroup
err := ctx.ReadResource("alicloud:rds/rdsParameterGroup:RdsParameterGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RdsParameterGroup resources.
type rdsParameterGroupState struct {
// The database engine. Valid values: `mysql`, `mariadb`, `PostgreSQL`.
Engine *string `pulumi:"engine"`
// The version of the database engine. Valid values: mysql: `5.1`, `5.5`, `5.6`, `5.7`, `8.0`; mariadb: `10.3`; PostgreSQL: `10.0`, `11.0`, `12.0`, `13.0`, `14.0`, `15.0`.
EngineVersion *string `pulumi:"engineVersion"`
// Parameter list. See `paramDetail` below.
ParamDetails []RdsParameterGroupParamDetail `pulumi:"paramDetails"`
// The description of the parameter template.
ParameterGroupDesc *string `pulumi:"parameterGroupDesc"`
// The name of the parameter template.
ParameterGroupName *string `pulumi:"parameterGroupName"`
}
type RdsParameterGroupState struct {
// The database engine. Valid values: `mysql`, `mariadb`, `PostgreSQL`.
Engine pulumi.StringPtrInput
// The version of the database engine. Valid values: mysql: `5.1`, `5.5`, `5.6`, `5.7`, `8.0`; mariadb: `10.3`; PostgreSQL: `10.0`, `11.0`, `12.0`, `13.0`, `14.0`, `15.0`.
EngineVersion pulumi.StringPtrInput
// Parameter list. See `paramDetail` below.
ParamDetails RdsParameterGroupParamDetailArrayInput
// The description of the parameter template.
ParameterGroupDesc pulumi.StringPtrInput
// The name of the parameter template.
ParameterGroupName pulumi.StringPtrInput
}
func (RdsParameterGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*rdsParameterGroupState)(nil)).Elem()
}
type rdsParameterGroupArgs struct {
// The database engine. Valid values: `mysql`, `mariadb`, `PostgreSQL`.
Engine string `pulumi:"engine"`
// The version of the database engine. Valid values: mysql: `5.1`, `5.5`, `5.6`, `5.7`, `8.0`; mariadb: `10.3`; PostgreSQL: `10.0`, `11.0`, `12.0`, `13.0`, `14.0`, `15.0`.
EngineVersion string `pulumi:"engineVersion"`
// Parameter list. See `paramDetail` below.
ParamDetails []RdsParameterGroupParamDetail `pulumi:"paramDetails"`
// The description of the parameter template.
ParameterGroupDesc *string `pulumi:"parameterGroupDesc"`
// The name of the parameter template.
ParameterGroupName string `pulumi:"parameterGroupName"`
}
// The set of arguments for constructing a RdsParameterGroup resource.
type RdsParameterGroupArgs struct {
// The database engine. Valid values: `mysql`, `mariadb`, `PostgreSQL`.
Engine pulumi.StringInput
// The version of the database engine. Valid values: mysql: `5.1`, `5.5`, `5.6`, `5.7`, `8.0`; mariadb: `10.3`; PostgreSQL: `10.0`, `11.0`, `12.0`, `13.0`, `14.0`, `15.0`.
EngineVersion pulumi.StringInput
// Parameter list. See `paramDetail` below.
ParamDetails RdsParameterGroupParamDetailArrayInput
// The description of the parameter template.
ParameterGroupDesc pulumi.StringPtrInput
// The name of the parameter template.
ParameterGroupName pulumi.StringInput
}
func (RdsParameterGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*rdsParameterGroupArgs)(nil)).Elem()
}
type RdsParameterGroupInput interface {
pulumi.Input
ToRdsParameterGroupOutput() RdsParameterGroupOutput
ToRdsParameterGroupOutputWithContext(ctx context.Context) RdsParameterGroupOutput
}
func (*RdsParameterGroup) ElementType() reflect.Type {
return reflect.TypeOf((**RdsParameterGroup)(nil)).Elem()
}
func (i *RdsParameterGroup) ToRdsParameterGroupOutput() RdsParameterGroupOutput {
return i.ToRdsParameterGroupOutputWithContext(context.Background())
}
func (i *RdsParameterGroup) ToRdsParameterGroupOutputWithContext(ctx context.Context) RdsParameterGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(RdsParameterGroupOutput)
}
// RdsParameterGroupArrayInput is an input type that accepts RdsParameterGroupArray and RdsParameterGroupArrayOutput values.
// You can construct a concrete instance of `RdsParameterGroupArrayInput` via:
//
// RdsParameterGroupArray{ RdsParameterGroupArgs{...} }
type RdsParameterGroupArrayInput interface {
pulumi.Input
ToRdsParameterGroupArrayOutput() RdsParameterGroupArrayOutput
ToRdsParameterGroupArrayOutputWithContext(context.Context) RdsParameterGroupArrayOutput
}
type RdsParameterGroupArray []RdsParameterGroupInput
func (RdsParameterGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RdsParameterGroup)(nil)).Elem()
}
func (i RdsParameterGroupArray) ToRdsParameterGroupArrayOutput() RdsParameterGroupArrayOutput {
return i.ToRdsParameterGroupArrayOutputWithContext(context.Background())
}
func (i RdsParameterGroupArray) ToRdsParameterGroupArrayOutputWithContext(ctx context.Context) RdsParameterGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RdsParameterGroupArrayOutput)
}
// RdsParameterGroupMapInput is an input type that accepts RdsParameterGroupMap and RdsParameterGroupMapOutput values.
// You can construct a concrete instance of `RdsParameterGroupMapInput` via:
//
// RdsParameterGroupMap{ "key": RdsParameterGroupArgs{...} }
type RdsParameterGroupMapInput interface {
pulumi.Input
ToRdsParameterGroupMapOutput() RdsParameterGroupMapOutput
ToRdsParameterGroupMapOutputWithContext(context.Context) RdsParameterGroupMapOutput
}
type RdsParameterGroupMap map[string]RdsParameterGroupInput
func (RdsParameterGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RdsParameterGroup)(nil)).Elem()
}
func (i RdsParameterGroupMap) ToRdsParameterGroupMapOutput() RdsParameterGroupMapOutput {
return i.ToRdsParameterGroupMapOutputWithContext(context.Background())
}
func (i RdsParameterGroupMap) ToRdsParameterGroupMapOutputWithContext(ctx context.Context) RdsParameterGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RdsParameterGroupMapOutput)
}
type RdsParameterGroupOutput struct{ *pulumi.OutputState }
func (RdsParameterGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RdsParameterGroup)(nil)).Elem()
}
func (o RdsParameterGroupOutput) ToRdsParameterGroupOutput() RdsParameterGroupOutput {
return o
}
func (o RdsParameterGroupOutput) ToRdsParameterGroupOutputWithContext(ctx context.Context) RdsParameterGroupOutput {
return o
}
// The database engine. Valid values: `mysql`, `mariadb`, `PostgreSQL`.
func (o RdsParameterGroupOutput) Engine() pulumi.StringOutput {
return o.ApplyT(func(v *RdsParameterGroup) pulumi.StringOutput { return v.Engine }).(pulumi.StringOutput)
}
// The version of the database engine. Valid values: mysql: `5.1`, `5.5`, `5.6`, `5.7`, `8.0`; mariadb: `10.3`; PostgreSQL: `10.0`, `11.0`, `12.0`, `13.0`, `14.0`, `15.0`.
func (o RdsParameterGroupOutput) EngineVersion() pulumi.StringOutput {
return o.ApplyT(func(v *RdsParameterGroup) pulumi.StringOutput { return v.EngineVersion }).(pulumi.StringOutput)
}
// Parameter list. See `paramDetail` below.
func (o RdsParameterGroupOutput) ParamDetails() RdsParameterGroupParamDetailArrayOutput {
return o.ApplyT(func(v *RdsParameterGroup) RdsParameterGroupParamDetailArrayOutput { return v.ParamDetails }).(RdsParameterGroupParamDetailArrayOutput)
}
// The description of the parameter template.
func (o RdsParameterGroupOutput) ParameterGroupDesc() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RdsParameterGroup) pulumi.StringPtrOutput { return v.ParameterGroupDesc }).(pulumi.StringPtrOutput)
}
// The name of the parameter template.
func (o RdsParameterGroupOutput) ParameterGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *RdsParameterGroup) pulumi.StringOutput { return v.ParameterGroupName }).(pulumi.StringOutput)
}
type RdsParameterGroupArrayOutput struct{ *pulumi.OutputState }
func (RdsParameterGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RdsParameterGroup)(nil)).Elem()
}
func (o RdsParameterGroupArrayOutput) ToRdsParameterGroupArrayOutput() RdsParameterGroupArrayOutput {
return o
}
func (o RdsParameterGroupArrayOutput) ToRdsParameterGroupArrayOutputWithContext(ctx context.Context) RdsParameterGroupArrayOutput {
return o
}
func (o RdsParameterGroupArrayOutput) Index(i pulumi.IntInput) RdsParameterGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RdsParameterGroup {
return vs[0].([]*RdsParameterGroup)[vs[1].(int)]
}).(RdsParameterGroupOutput)
}
type RdsParameterGroupMapOutput struct{ *pulumi.OutputState }
func (RdsParameterGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RdsParameterGroup)(nil)).Elem()
}
func (o RdsParameterGroupMapOutput) ToRdsParameterGroupMapOutput() RdsParameterGroupMapOutput {
return o
}
func (o RdsParameterGroupMapOutput) ToRdsParameterGroupMapOutputWithContext(ctx context.Context) RdsParameterGroupMapOutput {
return o
}
func (o RdsParameterGroupMapOutput) MapIndex(k pulumi.StringInput) RdsParameterGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RdsParameterGroup {
return vs[0].(map[string]*RdsParameterGroup)[vs[1].(string)]
}).(RdsParameterGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RdsParameterGroupInput)(nil)).Elem(), &RdsParameterGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*RdsParameterGroupArrayInput)(nil)).Elem(), RdsParameterGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RdsParameterGroupMapInput)(nil)).Elem(), RdsParameterGroupMap{})
pulumi.RegisterOutputType(RdsParameterGroupOutput{})
pulumi.RegisterOutputType(RdsParameterGroupArrayOutput{})
pulumi.RegisterOutputType(RdsParameterGroupMapOutput{})
}