github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rds/parameterGroup.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package rds 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides an RDS DB parameter group resource. Documentation of the available parameters for various RDS engines can be found at: 16 // 17 // * [Aurora MySQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Reference.html) 18 // * [Aurora PostgreSQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraPostgreSQL.Reference.html) 19 // * [MariaDB Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MariaDB.Parameters.html) 20 // * [Oracle Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ModifyInstance.Oracle.html#USER_ModifyInstance.Oracle.sqlnet) 21 // * [PostgreSQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.Parameters) 22 // 23 // > **Hands-on:** For an example of the `rds.ParameterGroup` in use, follow the Manage AWS RDS Instances tutorial on HashiCorp Learn. 24 // 25 // > **NOTE**: to make diffs less confusing, the AWS provider will ignore changes for a `parameter` whose `value` remains 26 // unchanged but whose `applyMethod` is changing (e.g., from `immediate` to `pending-reboot`, or `pending-reboot` to 27 // `immediate`). This matches the cloud: if only the apply method of a parameter is changing, the AWS API will not register 28 // this change. To change the `applyMethod` of a parameter, its value must also change. 29 // 30 // ## Example Usage 31 // 32 // ### Basic Usage 33 // 34 // <!--Start PulumiCodeChooser --> 35 // ```go 36 // package main 37 // 38 // import ( 39 // 40 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds" 41 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 42 // 43 // ) 44 // 45 // func main() { 46 // pulumi.Run(func(ctx *pulumi.Context) error { 47 // _, err := rds.NewParameterGroup(ctx, "default", &rds.ParameterGroupArgs{ 48 // Name: pulumi.String("rds-pg"), 49 // Family: pulumi.String("mysql5.6"), 50 // Parameters: rds.ParameterGroupParameterArray{ 51 // &rds.ParameterGroupParameterArgs{ 52 // Name: pulumi.String("character_set_server"), 53 // Value: pulumi.String("utf8"), 54 // }, 55 // &rds.ParameterGroupParameterArgs{ 56 // Name: pulumi.String("character_set_client"), 57 // Value: pulumi.String("utf8"), 58 // }, 59 // }, 60 // }) 61 // if err != nil { 62 // return err 63 // } 64 // return nil 65 // }) 66 // } 67 // 68 // ``` 69 // <!--End PulumiCodeChooser --> 70 // 71 // ## Import 72 // 73 // Using `pulumi import`, import DB Parameter groups using the `name`. For example: 74 // 75 // ```sh 76 // $ pulumi import aws:rds/parameterGroup:ParameterGroup rds_pg rds-pg 77 // ``` 78 type ParameterGroup struct { 79 pulumi.CustomResourceState 80 81 // The ARN of the db parameter group. 82 Arn pulumi.StringOutput `pulumi:"arn"` 83 // The description of the DB parameter group. Defaults to "Managed by Pulumi". 84 Description pulumi.StringOutput `pulumi:"description"` 85 // The family of the DB parameter group. 86 Family pulumi.StringOutput `pulumi:"family"` 87 // The name of the DB parameter group. If omitted, this provider will assign a random, unique name. 88 Name pulumi.StringOutput `pulumi:"name"` 89 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. 90 NamePrefix pulumi.StringOutput `pulumi:"namePrefix"` 91 // The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group. 92 Parameters ParameterGroupParameterArrayOutput `pulumi:"parameters"` 93 // 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. 94 Tags pulumi.StringMapOutput `pulumi:"tags"` 95 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 96 // 97 // Deprecated: Please use `tags` instead. 98 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 99 } 100 101 // NewParameterGroup registers a new resource with the given unique name, arguments, and options. 102 func NewParameterGroup(ctx *pulumi.Context, 103 name string, args *ParameterGroupArgs, opts ...pulumi.ResourceOption) (*ParameterGroup, error) { 104 if args == nil { 105 return nil, errors.New("missing one or more required arguments") 106 } 107 108 if args.Family == nil { 109 return nil, errors.New("invalid value for required argument 'Family'") 110 } 111 if args.Description == nil { 112 args.Description = pulumi.StringPtr("Managed by Pulumi") 113 } 114 opts = internal.PkgResourceDefaultOpts(opts) 115 var resource ParameterGroup 116 err := ctx.RegisterResource("aws:rds/parameterGroup:ParameterGroup", name, args, &resource, opts...) 117 if err != nil { 118 return nil, err 119 } 120 return &resource, nil 121 } 122 123 // GetParameterGroup gets an existing ParameterGroup resource's state with the given name, ID, and optional 124 // state properties that are used to uniquely qualify the lookup (nil if not required). 125 func GetParameterGroup(ctx *pulumi.Context, 126 name string, id pulumi.IDInput, state *ParameterGroupState, opts ...pulumi.ResourceOption) (*ParameterGroup, error) { 127 var resource ParameterGroup 128 err := ctx.ReadResource("aws:rds/parameterGroup:ParameterGroup", name, id, state, &resource, opts...) 129 if err != nil { 130 return nil, err 131 } 132 return &resource, nil 133 } 134 135 // Input properties used for looking up and filtering ParameterGroup resources. 136 type parameterGroupState struct { 137 // The ARN of the db parameter group. 138 Arn *string `pulumi:"arn"` 139 // The description of the DB parameter group. Defaults to "Managed by Pulumi". 140 Description *string `pulumi:"description"` 141 // The family of the DB parameter group. 142 Family *string `pulumi:"family"` 143 // The name of the DB parameter group. If omitted, this provider will assign a random, unique name. 144 Name *string `pulumi:"name"` 145 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. 146 NamePrefix *string `pulumi:"namePrefix"` 147 // The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group. 148 Parameters []ParameterGroupParameter `pulumi:"parameters"` 149 // 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. 150 Tags map[string]string `pulumi:"tags"` 151 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 152 // 153 // Deprecated: Please use `tags` instead. 154 TagsAll map[string]string `pulumi:"tagsAll"` 155 } 156 157 type ParameterGroupState struct { 158 // The ARN of the db parameter group. 159 Arn pulumi.StringPtrInput 160 // The description of the DB parameter group. Defaults to "Managed by Pulumi". 161 Description pulumi.StringPtrInput 162 // The family of the DB parameter group. 163 Family pulumi.StringPtrInput 164 // The name of the DB parameter group. If omitted, this provider will assign a random, unique name. 165 Name pulumi.StringPtrInput 166 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. 167 NamePrefix pulumi.StringPtrInput 168 // The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group. 169 Parameters ParameterGroupParameterArrayInput 170 // 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. 171 Tags pulumi.StringMapInput 172 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 173 // 174 // Deprecated: Please use `tags` instead. 175 TagsAll pulumi.StringMapInput 176 } 177 178 func (ParameterGroupState) ElementType() reflect.Type { 179 return reflect.TypeOf((*parameterGroupState)(nil)).Elem() 180 } 181 182 type parameterGroupArgs struct { 183 // The description of the DB parameter group. Defaults to "Managed by Pulumi". 184 Description *string `pulumi:"description"` 185 // The family of the DB parameter group. 186 Family string `pulumi:"family"` 187 // The name of the DB parameter group. If omitted, this provider will assign a random, unique name. 188 Name *string `pulumi:"name"` 189 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. 190 NamePrefix *string `pulumi:"namePrefix"` 191 // The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group. 192 Parameters []ParameterGroupParameter `pulumi:"parameters"` 193 // 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. 194 Tags map[string]string `pulumi:"tags"` 195 } 196 197 // The set of arguments for constructing a ParameterGroup resource. 198 type ParameterGroupArgs struct { 199 // The description of the DB parameter group. Defaults to "Managed by Pulumi". 200 Description pulumi.StringPtrInput 201 // The family of the DB parameter group. 202 Family pulumi.StringInput 203 // The name of the DB parameter group. If omitted, this provider will assign a random, unique name. 204 Name pulumi.StringPtrInput 205 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. 206 NamePrefix pulumi.StringPtrInput 207 // The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group. 208 Parameters ParameterGroupParameterArrayInput 209 // 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. 210 Tags pulumi.StringMapInput 211 } 212 213 func (ParameterGroupArgs) ElementType() reflect.Type { 214 return reflect.TypeOf((*parameterGroupArgs)(nil)).Elem() 215 } 216 217 type ParameterGroupInput interface { 218 pulumi.Input 219 220 ToParameterGroupOutput() ParameterGroupOutput 221 ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput 222 } 223 224 func (*ParameterGroup) ElementType() reflect.Type { 225 return reflect.TypeOf((**ParameterGroup)(nil)).Elem() 226 } 227 228 func (i *ParameterGroup) ToParameterGroupOutput() ParameterGroupOutput { 229 return i.ToParameterGroupOutputWithContext(context.Background()) 230 } 231 232 func (i *ParameterGroup) ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput { 233 return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupOutput) 234 } 235 236 // ParameterGroupArrayInput is an input type that accepts ParameterGroupArray and ParameterGroupArrayOutput values. 237 // You can construct a concrete instance of `ParameterGroupArrayInput` via: 238 // 239 // ParameterGroupArray{ ParameterGroupArgs{...} } 240 type ParameterGroupArrayInput interface { 241 pulumi.Input 242 243 ToParameterGroupArrayOutput() ParameterGroupArrayOutput 244 ToParameterGroupArrayOutputWithContext(context.Context) ParameterGroupArrayOutput 245 } 246 247 type ParameterGroupArray []ParameterGroupInput 248 249 func (ParameterGroupArray) ElementType() reflect.Type { 250 return reflect.TypeOf((*[]*ParameterGroup)(nil)).Elem() 251 } 252 253 func (i ParameterGroupArray) ToParameterGroupArrayOutput() ParameterGroupArrayOutput { 254 return i.ToParameterGroupArrayOutputWithContext(context.Background()) 255 } 256 257 func (i ParameterGroupArray) ToParameterGroupArrayOutputWithContext(ctx context.Context) ParameterGroupArrayOutput { 258 return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupArrayOutput) 259 } 260 261 // ParameterGroupMapInput is an input type that accepts ParameterGroupMap and ParameterGroupMapOutput values. 262 // You can construct a concrete instance of `ParameterGroupMapInput` via: 263 // 264 // ParameterGroupMap{ "key": ParameterGroupArgs{...} } 265 type ParameterGroupMapInput interface { 266 pulumi.Input 267 268 ToParameterGroupMapOutput() ParameterGroupMapOutput 269 ToParameterGroupMapOutputWithContext(context.Context) ParameterGroupMapOutput 270 } 271 272 type ParameterGroupMap map[string]ParameterGroupInput 273 274 func (ParameterGroupMap) ElementType() reflect.Type { 275 return reflect.TypeOf((*map[string]*ParameterGroup)(nil)).Elem() 276 } 277 278 func (i ParameterGroupMap) ToParameterGroupMapOutput() ParameterGroupMapOutput { 279 return i.ToParameterGroupMapOutputWithContext(context.Background()) 280 } 281 282 func (i ParameterGroupMap) ToParameterGroupMapOutputWithContext(ctx context.Context) ParameterGroupMapOutput { 283 return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupMapOutput) 284 } 285 286 type ParameterGroupOutput struct{ *pulumi.OutputState } 287 288 func (ParameterGroupOutput) ElementType() reflect.Type { 289 return reflect.TypeOf((**ParameterGroup)(nil)).Elem() 290 } 291 292 func (o ParameterGroupOutput) ToParameterGroupOutput() ParameterGroupOutput { 293 return o 294 } 295 296 func (o ParameterGroupOutput) ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput { 297 return o 298 } 299 300 // The ARN of the db parameter group. 301 func (o ParameterGroupOutput) Arn() pulumi.StringOutput { 302 return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 303 } 304 305 // The description of the DB parameter group. Defaults to "Managed by Pulumi". 306 func (o ParameterGroupOutput) Description() pulumi.StringOutput { 307 return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) 308 } 309 310 // The family of the DB parameter group. 311 func (o ParameterGroupOutput) Family() pulumi.StringOutput { 312 return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Family }).(pulumi.StringOutput) 313 } 314 315 // The name of the DB parameter group. If omitted, this provider will assign a random, unique name. 316 func (o ParameterGroupOutput) Name() pulumi.StringOutput { 317 return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 318 } 319 320 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. 321 func (o ParameterGroupOutput) NamePrefix() pulumi.StringOutput { 322 return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput) 323 } 324 325 // The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group. 326 func (o ParameterGroupOutput) Parameters() ParameterGroupParameterArrayOutput { 327 return o.ApplyT(func(v *ParameterGroup) ParameterGroupParameterArrayOutput { return v.Parameters }).(ParameterGroupParameterArrayOutput) 328 } 329 330 // 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. 331 func (o ParameterGroupOutput) Tags() pulumi.StringMapOutput { 332 return o.ApplyT(func(v *ParameterGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 333 } 334 335 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 336 // 337 // Deprecated: Please use `tags` instead. 338 func (o ParameterGroupOutput) TagsAll() pulumi.StringMapOutput { 339 return o.ApplyT(func(v *ParameterGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 340 } 341 342 type ParameterGroupArrayOutput struct{ *pulumi.OutputState } 343 344 func (ParameterGroupArrayOutput) ElementType() reflect.Type { 345 return reflect.TypeOf((*[]*ParameterGroup)(nil)).Elem() 346 } 347 348 func (o ParameterGroupArrayOutput) ToParameterGroupArrayOutput() ParameterGroupArrayOutput { 349 return o 350 } 351 352 func (o ParameterGroupArrayOutput) ToParameterGroupArrayOutputWithContext(ctx context.Context) ParameterGroupArrayOutput { 353 return o 354 } 355 356 func (o ParameterGroupArrayOutput) Index(i pulumi.IntInput) ParameterGroupOutput { 357 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ParameterGroup { 358 return vs[0].([]*ParameterGroup)[vs[1].(int)] 359 }).(ParameterGroupOutput) 360 } 361 362 type ParameterGroupMapOutput struct{ *pulumi.OutputState } 363 364 func (ParameterGroupMapOutput) ElementType() reflect.Type { 365 return reflect.TypeOf((*map[string]*ParameterGroup)(nil)).Elem() 366 } 367 368 func (o ParameterGroupMapOutput) ToParameterGroupMapOutput() ParameterGroupMapOutput { 369 return o 370 } 371 372 func (o ParameterGroupMapOutput) ToParameterGroupMapOutputWithContext(ctx context.Context) ParameterGroupMapOutput { 373 return o 374 } 375 376 func (o ParameterGroupMapOutput) MapIndex(k pulumi.StringInput) ParameterGroupOutput { 377 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ParameterGroup { 378 return vs[0].(map[string]*ParameterGroup)[vs[1].(string)] 379 }).(ParameterGroupOutput) 380 } 381 382 func init() { 383 pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupInput)(nil)).Elem(), &ParameterGroup{}) 384 pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupArrayInput)(nil)).Elem(), ParameterGroupArray{}) 385 pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupMapInput)(nil)).Elem(), ParameterGroupMap{}) 386 pulumi.RegisterOutputType(ParameterGroupOutput{}) 387 pulumi.RegisterOutputType(ParameterGroupArrayOutput{}) 388 pulumi.RegisterOutputType(ParameterGroupMapOutput{}) 389 }