/
clusterParameterGroup.go
378 lines (324 loc) · 17.6 KB
/
clusterParameterGroup.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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
// 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-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an RDS DB cluster parameter group resource. Documentation of the available parameters for various Aurora engines can be found at:
//
// * [Aurora MySQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Reference.html)
// * [Aurora PostgreSQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraPostgreSQL.Reference.html)
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := rds.NewClusterParameterGroup(ctx, "default", &rds.ClusterParameterGroupArgs{
// Name: pulumi.String("rds-cluster-pg"),
// Family: pulumi.String("aurora5.6"),
// Description: pulumi.String("RDS default cluster parameter group"),
// Parameters: rds.ClusterParameterGroupParameterArray{
// &rds.ClusterParameterGroupParameterArgs{
// Name: pulumi.String("character_set_server"),
// Value: pulumi.String("utf8"),
// },
// &rds.ClusterParameterGroupParameterArgs{
// Name: pulumi.String("character_set_client"),
// Value: pulumi.String("utf8"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import RDS Cluster Parameter Groups using the `name`. For example:
//
// ```sh
// $ pulumi import aws:rds/clusterParameterGroup:ClusterParameterGroup cluster_pg production-pg-1
// ```
type ClusterParameterGroup struct {
pulumi.CustomResourceState
// The ARN of the db cluster parameter group.
Arn pulumi.StringOutput `pulumi:"arn"`
// The description of the DB cluster parameter group. Defaults to "Managed by Pulumi".
Description pulumi.StringOutput `pulumi:"description"`
// The family of the DB cluster parameter group.
Family pulumi.StringOutput `pulumi:"family"`
// The name of the DB parameter.
Name pulumi.StringOutput `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
// A list of DB parameters to apply. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-cluster-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) after initial creation of the group.
Parameters ClusterParameterGroupParameterArrayOutput `pulumi:"parameters"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewClusterParameterGroup registers a new resource with the given unique name, arguments, and options.
func NewClusterParameterGroup(ctx *pulumi.Context,
name string, args *ClusterParameterGroupArgs, opts ...pulumi.ResourceOption) (*ClusterParameterGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Family == nil {
return nil, errors.New("invalid value for required argument 'Family'")
}
if args.Description == nil {
args.Description = pulumi.StringPtr("Managed by Pulumi")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ClusterParameterGroup
err := ctx.RegisterResource("aws:rds/clusterParameterGroup:ClusterParameterGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetClusterParameterGroup gets an existing ClusterParameterGroup 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 GetClusterParameterGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ClusterParameterGroupState, opts ...pulumi.ResourceOption) (*ClusterParameterGroup, error) {
var resource ClusterParameterGroup
err := ctx.ReadResource("aws:rds/clusterParameterGroup:ClusterParameterGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ClusterParameterGroup resources.
type clusterParameterGroupState struct {
// The ARN of the db cluster parameter group.
Arn *string `pulumi:"arn"`
// The description of the DB cluster parameter group. Defaults to "Managed by Pulumi".
Description *string `pulumi:"description"`
// The family of the DB cluster parameter group.
Family *string `pulumi:"family"`
// The name of the DB parameter.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// A list of DB parameters to apply. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-cluster-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) after initial creation of the group.
Parameters []ClusterParameterGroupParameter `pulumi:"parameters"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type ClusterParameterGroupState struct {
// The ARN of the db cluster parameter group.
Arn pulumi.StringPtrInput
// The description of the DB cluster parameter group. Defaults to "Managed by Pulumi".
Description pulumi.StringPtrInput
// The family of the DB cluster parameter group.
Family pulumi.StringPtrInput
// The name of the DB parameter.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// A list of DB parameters to apply. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-cluster-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) after initial creation of the group.
Parameters ClusterParameterGroupParameterArrayInput
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
}
func (ClusterParameterGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*clusterParameterGroupState)(nil)).Elem()
}
type clusterParameterGroupArgs struct {
// The description of the DB cluster parameter group. Defaults to "Managed by Pulumi".
Description *string `pulumi:"description"`
// The family of the DB cluster parameter group.
Family string `pulumi:"family"`
// The name of the DB parameter.
Name *string `pulumi:"name"`
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix *string `pulumi:"namePrefix"`
// A list of DB parameters to apply. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-cluster-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) after initial creation of the group.
Parameters []ClusterParameterGroupParameter `pulumi:"parameters"`
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a ClusterParameterGroup resource.
type ClusterParameterGroupArgs struct {
// The description of the DB cluster parameter group. Defaults to "Managed by Pulumi".
Description pulumi.StringPtrInput
// The family of the DB cluster parameter group.
Family pulumi.StringInput
// The name of the DB parameter.
Name pulumi.StringPtrInput
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
NamePrefix pulumi.StringPtrInput
// A list of DB parameters to apply. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-cluster-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) after initial creation of the group.
Parameters ClusterParameterGroupParameterArrayInput
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (ClusterParameterGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*clusterParameterGroupArgs)(nil)).Elem()
}
type ClusterParameterGroupInput interface {
pulumi.Input
ToClusterParameterGroupOutput() ClusterParameterGroupOutput
ToClusterParameterGroupOutputWithContext(ctx context.Context) ClusterParameterGroupOutput
}
func (*ClusterParameterGroup) ElementType() reflect.Type {
return reflect.TypeOf((**ClusterParameterGroup)(nil)).Elem()
}
func (i *ClusterParameterGroup) ToClusterParameterGroupOutput() ClusterParameterGroupOutput {
return i.ToClusterParameterGroupOutputWithContext(context.Background())
}
func (i *ClusterParameterGroup) ToClusterParameterGroupOutputWithContext(ctx context.Context) ClusterParameterGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterParameterGroupOutput)
}
// ClusterParameterGroupArrayInput is an input type that accepts ClusterParameterGroupArray and ClusterParameterGroupArrayOutput values.
// You can construct a concrete instance of `ClusterParameterGroupArrayInput` via:
//
// ClusterParameterGroupArray{ ClusterParameterGroupArgs{...} }
type ClusterParameterGroupArrayInput interface {
pulumi.Input
ToClusterParameterGroupArrayOutput() ClusterParameterGroupArrayOutput
ToClusterParameterGroupArrayOutputWithContext(context.Context) ClusterParameterGroupArrayOutput
}
type ClusterParameterGroupArray []ClusterParameterGroupInput
func (ClusterParameterGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ClusterParameterGroup)(nil)).Elem()
}
func (i ClusterParameterGroupArray) ToClusterParameterGroupArrayOutput() ClusterParameterGroupArrayOutput {
return i.ToClusterParameterGroupArrayOutputWithContext(context.Background())
}
func (i ClusterParameterGroupArray) ToClusterParameterGroupArrayOutputWithContext(ctx context.Context) ClusterParameterGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterParameterGroupArrayOutput)
}
// ClusterParameterGroupMapInput is an input type that accepts ClusterParameterGroupMap and ClusterParameterGroupMapOutput values.
// You can construct a concrete instance of `ClusterParameterGroupMapInput` via:
//
// ClusterParameterGroupMap{ "key": ClusterParameterGroupArgs{...} }
type ClusterParameterGroupMapInput interface {
pulumi.Input
ToClusterParameterGroupMapOutput() ClusterParameterGroupMapOutput
ToClusterParameterGroupMapOutputWithContext(context.Context) ClusterParameterGroupMapOutput
}
type ClusterParameterGroupMap map[string]ClusterParameterGroupInput
func (ClusterParameterGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ClusterParameterGroup)(nil)).Elem()
}
func (i ClusterParameterGroupMap) ToClusterParameterGroupMapOutput() ClusterParameterGroupMapOutput {
return i.ToClusterParameterGroupMapOutputWithContext(context.Background())
}
func (i ClusterParameterGroupMap) ToClusterParameterGroupMapOutputWithContext(ctx context.Context) ClusterParameterGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterParameterGroupMapOutput)
}
type ClusterParameterGroupOutput struct{ *pulumi.OutputState }
func (ClusterParameterGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ClusterParameterGroup)(nil)).Elem()
}
func (o ClusterParameterGroupOutput) ToClusterParameterGroupOutput() ClusterParameterGroupOutput {
return o
}
func (o ClusterParameterGroupOutput) ToClusterParameterGroupOutputWithContext(ctx context.Context) ClusterParameterGroupOutput {
return o
}
// The ARN of the db cluster parameter group.
func (o ClusterParameterGroupOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterParameterGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The description of the DB cluster parameter group. Defaults to "Managed by Pulumi".
func (o ClusterParameterGroupOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterParameterGroup) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// The family of the DB cluster parameter group.
func (o ClusterParameterGroupOutput) Family() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterParameterGroup) pulumi.StringOutput { return v.Family }).(pulumi.StringOutput)
}
// The name of the DB parameter.
func (o ClusterParameterGroupOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterParameterGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
func (o ClusterParameterGroupOutput) NamePrefix() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterParameterGroup) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
}
// A list of DB parameters to apply. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-cluster-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) after initial creation of the group.
func (o ClusterParameterGroupOutput) Parameters() ClusterParameterGroupParameterArrayOutput {
return o.ApplyT(func(v *ClusterParameterGroup) ClusterParameterGroupParameterArrayOutput { return v.Parameters }).(ClusterParameterGroupParameterArrayOutput)
}
// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o ClusterParameterGroupOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *ClusterParameterGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o ClusterParameterGroupOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *ClusterParameterGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
type ClusterParameterGroupArrayOutput struct{ *pulumi.OutputState }
func (ClusterParameterGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ClusterParameterGroup)(nil)).Elem()
}
func (o ClusterParameterGroupArrayOutput) ToClusterParameterGroupArrayOutput() ClusterParameterGroupArrayOutput {
return o
}
func (o ClusterParameterGroupArrayOutput) ToClusterParameterGroupArrayOutputWithContext(ctx context.Context) ClusterParameterGroupArrayOutput {
return o
}
func (o ClusterParameterGroupArrayOutput) Index(i pulumi.IntInput) ClusterParameterGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterParameterGroup {
return vs[0].([]*ClusterParameterGroup)[vs[1].(int)]
}).(ClusterParameterGroupOutput)
}
type ClusterParameterGroupMapOutput struct{ *pulumi.OutputState }
func (ClusterParameterGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ClusterParameterGroup)(nil)).Elem()
}
func (o ClusterParameterGroupMapOutput) ToClusterParameterGroupMapOutput() ClusterParameterGroupMapOutput {
return o
}
func (o ClusterParameterGroupMapOutput) ToClusterParameterGroupMapOutputWithContext(ctx context.Context) ClusterParameterGroupMapOutput {
return o
}
func (o ClusterParameterGroupMapOutput) MapIndex(k pulumi.StringInput) ClusterParameterGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterParameterGroup {
return vs[0].(map[string]*ClusterParameterGroup)[vs[1].(string)]
}).(ClusterParameterGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ClusterParameterGroupInput)(nil)).Elem(), &ClusterParameterGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterParameterGroupArrayInput)(nil)).Elem(), ClusterParameterGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterParameterGroupMapInput)(nil)).Elem(), ClusterParameterGroupMap{})
pulumi.RegisterOutputType(ClusterParameterGroupOutput{})
pulumi.RegisterOutputType(ClusterParameterGroupArrayOutput{})
pulumi.RegisterOutputType(ClusterParameterGroupMapOutput{})
}