github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rds/optionGroup.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 option group resource. Documentation of the available options for various RDS engines can be found at: 16 // 17 // * [MariaDB Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MariaDB.Options.html) 18 // * [Microsoft SQL Server Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.SQLServer.Options.html) 19 // * [MySQL Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.Options.html) 20 // * [Oracle Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html) 21 // 22 // ## Example Usage 23 // 24 // <!--Start PulumiCodeChooser --> 25 // ```go 26 // package main 27 // 28 // import ( 29 // 30 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds" 31 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 32 // 33 // ) 34 // 35 // func main() { 36 // pulumi.Run(func(ctx *pulumi.Context) error { 37 // _, err := rds.NewOptionGroup(ctx, "example", &rds.OptionGroupArgs{ 38 // Name: pulumi.String("option-group-test"), 39 // OptionGroupDescription: pulumi.String("Option Group"), 40 // EngineName: pulumi.String("sqlserver-ee"), 41 // MajorEngineVersion: pulumi.String("11.00"), 42 // Options: rds.OptionGroupOptionArray{ 43 // &rds.OptionGroupOptionArgs{ 44 // OptionName: pulumi.String("Timezone"), 45 // OptionSettings: rds.OptionGroupOptionOptionSettingArray{ 46 // &rds.OptionGroupOptionOptionSettingArgs{ 47 // Name: pulumi.String("TIME_ZONE"), 48 // Value: pulumi.String("UTC"), 49 // }, 50 // }, 51 // }, 52 // &rds.OptionGroupOptionArgs{ 53 // OptionName: pulumi.String("SQLSERVER_BACKUP_RESTORE"), 54 // OptionSettings: rds.OptionGroupOptionOptionSettingArray{ 55 // &rds.OptionGroupOptionOptionSettingArgs{ 56 // Name: pulumi.String("IAM_ROLE_ARN"), 57 // Value: pulumi.Any(exampleAwsIamRole.Arn), 58 // }, 59 // }, 60 // }, 61 // &rds.OptionGroupOptionArgs{ 62 // OptionName: pulumi.String("TDE"), 63 // }, 64 // }, 65 // }) 66 // if err != nil { 67 // return err 68 // } 69 // return nil 70 // }) 71 // } 72 // 73 // ``` 74 // <!--End PulumiCodeChooser --> 75 // 76 // > **Note:** Any modifications to the `rds.OptionGroup` are set to happen immediately as we default to applying immediately. 77 // 78 // > **WARNING:** You can perform a destroy on a `rds.OptionGroup`, as long as it is not associated with any Amazon RDS resource. An option group can be associated with a DB instance, a manual DB snapshot, or an automated DB snapshot. 79 // 80 // If you try to delete an option group that is associated with an Amazon RDS resource, an error similar to the following is returned: 81 // 82 // > An error occurred (InvalidOptionGroupStateFault) when calling the DeleteOptionGroup operation: The option group 'optionGroupName' cannot be deleted because it is in use. 83 // 84 // More information about this can be found [here](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithOptionGroups.html#USER_WorkingWithOptionGroups.Delete). 85 // 86 // ## Import 87 // 88 // Using `pulumi import`, import DB option groups using the `name`. For example: 89 // 90 // ```sh 91 // $ pulumi import aws:rds/optionGroup:OptionGroup example mysql-option-group 92 // ``` 93 type OptionGroup struct { 94 pulumi.CustomResourceState 95 96 // ARN of the DB option group. 97 Arn pulumi.StringOutput `pulumi:"arn"` 98 // Specifies the name of the engine that this option group should be associated with. 99 EngineName pulumi.StringOutput `pulumi:"engineName"` 100 // Specifies the major version of the engine that this option group should be associated with. 101 MajorEngineVersion pulumi.StringOutput `pulumi:"majorEngineVersion"` 102 // Name of the option group. If omitted, the provider will assign a random, unique name. Must be lowercase, to match as it is stored in AWS. 103 Name pulumi.StringOutput `pulumi:"name"` 104 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. Must be lowercase, to match as it is stored in AWS. 105 NamePrefix pulumi.StringOutput `pulumi:"namePrefix"` 106 // Description of the option group. 107 OptionGroupDescription pulumi.StringOutput `pulumi:"optionGroupDescription"` 108 // The options to apply. See `option` Block below for more details. 109 Options OptionGroupOptionArrayOutput `pulumi:"options"` 110 // 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. 111 Tags pulumi.StringMapOutput `pulumi:"tags"` 112 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 113 // 114 // Deprecated: Please use `tags` instead. 115 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 116 } 117 118 // NewOptionGroup registers a new resource with the given unique name, arguments, and options. 119 func NewOptionGroup(ctx *pulumi.Context, 120 name string, args *OptionGroupArgs, opts ...pulumi.ResourceOption) (*OptionGroup, error) { 121 if args == nil { 122 return nil, errors.New("missing one or more required arguments") 123 } 124 125 if args.EngineName == nil { 126 return nil, errors.New("invalid value for required argument 'EngineName'") 127 } 128 if args.MajorEngineVersion == nil { 129 return nil, errors.New("invalid value for required argument 'MajorEngineVersion'") 130 } 131 if args.OptionGroupDescription == nil { 132 args.OptionGroupDescription = pulumi.StringPtr("Managed by Pulumi") 133 } 134 opts = internal.PkgResourceDefaultOpts(opts) 135 var resource OptionGroup 136 err := ctx.RegisterResource("aws:rds/optionGroup:OptionGroup", name, args, &resource, opts...) 137 if err != nil { 138 return nil, err 139 } 140 return &resource, nil 141 } 142 143 // GetOptionGroup gets an existing OptionGroup resource's state with the given name, ID, and optional 144 // state properties that are used to uniquely qualify the lookup (nil if not required). 145 func GetOptionGroup(ctx *pulumi.Context, 146 name string, id pulumi.IDInput, state *OptionGroupState, opts ...pulumi.ResourceOption) (*OptionGroup, error) { 147 var resource OptionGroup 148 err := ctx.ReadResource("aws:rds/optionGroup:OptionGroup", name, id, state, &resource, opts...) 149 if err != nil { 150 return nil, err 151 } 152 return &resource, nil 153 } 154 155 // Input properties used for looking up and filtering OptionGroup resources. 156 type optionGroupState struct { 157 // ARN of the DB option group. 158 Arn *string `pulumi:"arn"` 159 // Specifies the name of the engine that this option group should be associated with. 160 EngineName *string `pulumi:"engineName"` 161 // Specifies the major version of the engine that this option group should be associated with. 162 MajorEngineVersion *string `pulumi:"majorEngineVersion"` 163 // Name of the option group. If omitted, the provider will assign a random, unique name. Must be lowercase, to match as it is stored in AWS. 164 Name *string `pulumi:"name"` 165 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. Must be lowercase, to match as it is stored in AWS. 166 NamePrefix *string `pulumi:"namePrefix"` 167 // Description of the option group. 168 OptionGroupDescription *string `pulumi:"optionGroupDescription"` 169 // The options to apply. See `option` Block below for more details. 170 Options []OptionGroupOption `pulumi:"options"` 171 // 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. 172 Tags map[string]string `pulumi:"tags"` 173 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 174 // 175 // Deprecated: Please use `tags` instead. 176 TagsAll map[string]string `pulumi:"tagsAll"` 177 } 178 179 type OptionGroupState struct { 180 // ARN of the DB option group. 181 Arn pulumi.StringPtrInput 182 // Specifies the name of the engine that this option group should be associated with. 183 EngineName pulumi.StringPtrInput 184 // Specifies the major version of the engine that this option group should be associated with. 185 MajorEngineVersion pulumi.StringPtrInput 186 // Name of the option group. If omitted, the provider will assign a random, unique name. Must be lowercase, to match as it is stored in AWS. 187 Name pulumi.StringPtrInput 188 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. Must be lowercase, to match as it is stored in AWS. 189 NamePrefix pulumi.StringPtrInput 190 // Description of the option group. 191 OptionGroupDescription pulumi.StringPtrInput 192 // The options to apply. See `option` Block below for more details. 193 Options OptionGroupOptionArrayInput 194 // 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. 195 Tags pulumi.StringMapInput 196 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 197 // 198 // Deprecated: Please use `tags` instead. 199 TagsAll pulumi.StringMapInput 200 } 201 202 func (OptionGroupState) ElementType() reflect.Type { 203 return reflect.TypeOf((*optionGroupState)(nil)).Elem() 204 } 205 206 type optionGroupArgs struct { 207 // Specifies the name of the engine that this option group should be associated with. 208 EngineName string `pulumi:"engineName"` 209 // Specifies the major version of the engine that this option group should be associated with. 210 MajorEngineVersion string `pulumi:"majorEngineVersion"` 211 // Name of the option group. If omitted, the provider will assign a random, unique name. Must be lowercase, to match as it is stored in AWS. 212 Name *string `pulumi:"name"` 213 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. Must be lowercase, to match as it is stored in AWS. 214 NamePrefix *string `pulumi:"namePrefix"` 215 // Description of the option group. 216 OptionGroupDescription *string `pulumi:"optionGroupDescription"` 217 // The options to apply. See `option` Block below for more details. 218 Options []OptionGroupOption `pulumi:"options"` 219 // 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. 220 Tags map[string]string `pulumi:"tags"` 221 } 222 223 // The set of arguments for constructing a OptionGroup resource. 224 type OptionGroupArgs struct { 225 // Specifies the name of the engine that this option group should be associated with. 226 EngineName pulumi.StringInput 227 // Specifies the major version of the engine that this option group should be associated with. 228 MajorEngineVersion pulumi.StringInput 229 // Name of the option group. If omitted, the provider will assign a random, unique name. Must be lowercase, to match as it is stored in AWS. 230 Name pulumi.StringPtrInput 231 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. Must be lowercase, to match as it is stored in AWS. 232 NamePrefix pulumi.StringPtrInput 233 // Description of the option group. 234 OptionGroupDescription pulumi.StringPtrInput 235 // The options to apply. See `option` Block below for more details. 236 Options OptionGroupOptionArrayInput 237 // 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. 238 Tags pulumi.StringMapInput 239 } 240 241 func (OptionGroupArgs) ElementType() reflect.Type { 242 return reflect.TypeOf((*optionGroupArgs)(nil)).Elem() 243 } 244 245 type OptionGroupInput interface { 246 pulumi.Input 247 248 ToOptionGroupOutput() OptionGroupOutput 249 ToOptionGroupOutputWithContext(ctx context.Context) OptionGroupOutput 250 } 251 252 func (*OptionGroup) ElementType() reflect.Type { 253 return reflect.TypeOf((**OptionGroup)(nil)).Elem() 254 } 255 256 func (i *OptionGroup) ToOptionGroupOutput() OptionGroupOutput { 257 return i.ToOptionGroupOutputWithContext(context.Background()) 258 } 259 260 func (i *OptionGroup) ToOptionGroupOutputWithContext(ctx context.Context) OptionGroupOutput { 261 return pulumi.ToOutputWithContext(ctx, i).(OptionGroupOutput) 262 } 263 264 // OptionGroupArrayInput is an input type that accepts OptionGroupArray and OptionGroupArrayOutput values. 265 // You can construct a concrete instance of `OptionGroupArrayInput` via: 266 // 267 // OptionGroupArray{ OptionGroupArgs{...} } 268 type OptionGroupArrayInput interface { 269 pulumi.Input 270 271 ToOptionGroupArrayOutput() OptionGroupArrayOutput 272 ToOptionGroupArrayOutputWithContext(context.Context) OptionGroupArrayOutput 273 } 274 275 type OptionGroupArray []OptionGroupInput 276 277 func (OptionGroupArray) ElementType() reflect.Type { 278 return reflect.TypeOf((*[]*OptionGroup)(nil)).Elem() 279 } 280 281 func (i OptionGroupArray) ToOptionGroupArrayOutput() OptionGroupArrayOutput { 282 return i.ToOptionGroupArrayOutputWithContext(context.Background()) 283 } 284 285 func (i OptionGroupArray) ToOptionGroupArrayOutputWithContext(ctx context.Context) OptionGroupArrayOutput { 286 return pulumi.ToOutputWithContext(ctx, i).(OptionGroupArrayOutput) 287 } 288 289 // OptionGroupMapInput is an input type that accepts OptionGroupMap and OptionGroupMapOutput values. 290 // You can construct a concrete instance of `OptionGroupMapInput` via: 291 // 292 // OptionGroupMap{ "key": OptionGroupArgs{...} } 293 type OptionGroupMapInput interface { 294 pulumi.Input 295 296 ToOptionGroupMapOutput() OptionGroupMapOutput 297 ToOptionGroupMapOutputWithContext(context.Context) OptionGroupMapOutput 298 } 299 300 type OptionGroupMap map[string]OptionGroupInput 301 302 func (OptionGroupMap) ElementType() reflect.Type { 303 return reflect.TypeOf((*map[string]*OptionGroup)(nil)).Elem() 304 } 305 306 func (i OptionGroupMap) ToOptionGroupMapOutput() OptionGroupMapOutput { 307 return i.ToOptionGroupMapOutputWithContext(context.Background()) 308 } 309 310 func (i OptionGroupMap) ToOptionGroupMapOutputWithContext(ctx context.Context) OptionGroupMapOutput { 311 return pulumi.ToOutputWithContext(ctx, i).(OptionGroupMapOutput) 312 } 313 314 type OptionGroupOutput struct{ *pulumi.OutputState } 315 316 func (OptionGroupOutput) ElementType() reflect.Type { 317 return reflect.TypeOf((**OptionGroup)(nil)).Elem() 318 } 319 320 func (o OptionGroupOutput) ToOptionGroupOutput() OptionGroupOutput { 321 return o 322 } 323 324 func (o OptionGroupOutput) ToOptionGroupOutputWithContext(ctx context.Context) OptionGroupOutput { 325 return o 326 } 327 328 // ARN of the DB option group. 329 func (o OptionGroupOutput) Arn() pulumi.StringOutput { 330 return o.ApplyT(func(v *OptionGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 331 } 332 333 // Specifies the name of the engine that this option group should be associated with. 334 func (o OptionGroupOutput) EngineName() pulumi.StringOutput { 335 return o.ApplyT(func(v *OptionGroup) pulumi.StringOutput { return v.EngineName }).(pulumi.StringOutput) 336 } 337 338 // Specifies the major version of the engine that this option group should be associated with. 339 func (o OptionGroupOutput) MajorEngineVersion() pulumi.StringOutput { 340 return o.ApplyT(func(v *OptionGroup) pulumi.StringOutput { return v.MajorEngineVersion }).(pulumi.StringOutput) 341 } 342 343 // Name of the option group. If omitted, the provider will assign a random, unique name. Must be lowercase, to match as it is stored in AWS. 344 func (o OptionGroupOutput) Name() pulumi.StringOutput { 345 return o.ApplyT(func(v *OptionGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 346 } 347 348 // Creates a unique name beginning with the specified prefix. Conflicts with `name`. Must be lowercase, to match as it is stored in AWS. 349 func (o OptionGroupOutput) NamePrefix() pulumi.StringOutput { 350 return o.ApplyT(func(v *OptionGroup) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput) 351 } 352 353 // Description of the option group. 354 func (o OptionGroupOutput) OptionGroupDescription() pulumi.StringOutput { 355 return o.ApplyT(func(v *OptionGroup) pulumi.StringOutput { return v.OptionGroupDescription }).(pulumi.StringOutput) 356 } 357 358 // The options to apply. See `option` Block below for more details. 359 func (o OptionGroupOutput) Options() OptionGroupOptionArrayOutput { 360 return o.ApplyT(func(v *OptionGroup) OptionGroupOptionArrayOutput { return v.Options }).(OptionGroupOptionArrayOutput) 361 } 362 363 // 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. 364 func (o OptionGroupOutput) Tags() pulumi.StringMapOutput { 365 return o.ApplyT(func(v *OptionGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 366 } 367 368 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 369 // 370 // Deprecated: Please use `tags` instead. 371 func (o OptionGroupOutput) TagsAll() pulumi.StringMapOutput { 372 return o.ApplyT(func(v *OptionGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 373 } 374 375 type OptionGroupArrayOutput struct{ *pulumi.OutputState } 376 377 func (OptionGroupArrayOutput) ElementType() reflect.Type { 378 return reflect.TypeOf((*[]*OptionGroup)(nil)).Elem() 379 } 380 381 func (o OptionGroupArrayOutput) ToOptionGroupArrayOutput() OptionGroupArrayOutput { 382 return o 383 } 384 385 func (o OptionGroupArrayOutput) ToOptionGroupArrayOutputWithContext(ctx context.Context) OptionGroupArrayOutput { 386 return o 387 } 388 389 func (o OptionGroupArrayOutput) Index(i pulumi.IntInput) OptionGroupOutput { 390 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *OptionGroup { 391 return vs[0].([]*OptionGroup)[vs[1].(int)] 392 }).(OptionGroupOutput) 393 } 394 395 type OptionGroupMapOutput struct{ *pulumi.OutputState } 396 397 func (OptionGroupMapOutput) ElementType() reflect.Type { 398 return reflect.TypeOf((*map[string]*OptionGroup)(nil)).Elem() 399 } 400 401 func (o OptionGroupMapOutput) ToOptionGroupMapOutput() OptionGroupMapOutput { 402 return o 403 } 404 405 func (o OptionGroupMapOutput) ToOptionGroupMapOutputWithContext(ctx context.Context) OptionGroupMapOutput { 406 return o 407 } 408 409 func (o OptionGroupMapOutput) MapIndex(k pulumi.StringInput) OptionGroupOutput { 410 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *OptionGroup { 411 return vs[0].(map[string]*OptionGroup)[vs[1].(string)] 412 }).(OptionGroupOutput) 413 } 414 415 func init() { 416 pulumi.RegisterInputType(reflect.TypeOf((*OptionGroupInput)(nil)).Elem(), &OptionGroup{}) 417 pulumi.RegisterInputType(reflect.TypeOf((*OptionGroupArrayInput)(nil)).Elem(), OptionGroupArray{}) 418 pulumi.RegisterInputType(reflect.TypeOf((*OptionGroupMapInput)(nil)).Elem(), OptionGroupMap{}) 419 pulumi.RegisterOutputType(OptionGroupOutput{}) 420 pulumi.RegisterOutputType(OptionGroupArrayOutput{}) 421 pulumi.RegisterOutputType(OptionGroupMapOutput{}) 422 }