OptionGroup class

Provides an RDS DB option group resource. Documentation of the available options for various RDS engines can be found at:

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.rds.OptionGroup("example", {
    options: [
        {
            optionSettings: [{
                name: "TIME_ZONE",
                value: "UTC",
            }],
            optionName: "Timezone",
        },
        {
            optionSettings: [{
                name: "IAM_ROLE_ARN",
                value: exampleAwsIamRole.arn,
            }],
            optionName: "SQLSERVER_BACKUP_RESTORE",
        },
        {
            optionName: "TDE",
        },
    ],
    name: "option-group-test",
    optionGroupDescription: "Option Group",
    engineName: "sqlserver-ee",
    majorEngineVersion: "11.00",
});
import pulumi
import pulumi_aws as aws

example = aws.rds.OptionGroup("example",
    options=[
        {
            "option_settings": [{
                "name": "TIME_ZONE",
                "value": "UTC",
            }],
            "option_name": "Timezone",
        },
        {
            "option_settings": [{
                "name": "IAM_ROLE_ARN",
                "value": example_aws_iam_role["arn"],
            }],
            "option_name": "SQLSERVER_BACKUP_RESTORE",
        },
        {
            "option_name": "TDE",
        },
    ],
    name="option-group-test",
    option_group_description="Option Group",
    engine_name="sqlserver-ee",
    major_engine_version="11.00")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Rds.OptionGroup("example", new()
    {
        Options = new[]
        {
            new Aws.Rds.Inputs.OptionGroupOptionArgs
            {
                OptionSettings = new[]
                {
                    new Aws.Rds.Inputs.OptionGroupOptionOptionSettingArgs
                    {
                        Name = "TIME_ZONE",
                        Value = "UTC",
                    },
                },
                OptionName = "Timezone",
            },
            new Aws.Rds.Inputs.OptionGroupOptionArgs
            {
                OptionSettings = new[]
                {
                    new Aws.Rds.Inputs.OptionGroupOptionOptionSettingArgs
                    {
                        Name = "IAM_ROLE_ARN",
                        Value = exampleAwsIamRole.Arn,
                    },
                },
                OptionName = "SQLSERVER_BACKUP_RESTORE",
            },
            new Aws.Rds.Inputs.OptionGroupOptionArgs
            {
                OptionName = "TDE",
            },
        },
        Name = "option-group-test",
        OptionGroupDescription = "Option Group",
        EngineName = "sqlserver-ee",
        MajorEngineVersion = "11.00",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/rds"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rds.NewOptionGroup(ctx, "example", &rds.OptionGroupArgs{
			Options: rds.OptionGroupOptionArray{
				&rds.OptionGroupOptionArgs{
					OptionSettings: rds.OptionGroupOptionOptionSettingArray{
						&rds.OptionGroupOptionOptionSettingArgs{
							Name:  pulumi.String("TIME_ZONE"),
							Value: pulumi.String("UTC"),
						},
					},
					OptionName: pulumi.String("Timezone"),
				},
				&rds.OptionGroupOptionArgs{
					OptionSettings: rds.OptionGroupOptionOptionSettingArray{
						&rds.OptionGroupOptionOptionSettingArgs{
							Name:  pulumi.String("IAM_ROLE_ARN"),
							Value: pulumi.Any(exampleAwsIamRole.Arn),
						},
					},
					OptionName: pulumi.String("SQLSERVER_BACKUP_RESTORE"),
				},
				&rds.OptionGroupOptionArgs{
					OptionName: pulumi.String("TDE"),
				},
			},
			Name:                   pulumi.String("option-group-test"),
			OptionGroupDescription: pulumi.String("Option Group"),
			EngineName:             pulumi.String("sqlserver-ee"),
			MajorEngineVersion:     pulumi.String("11.00"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_rds_optiongroup" "example" {
  options {
    option_settings {
      name  = "TIME_ZONE"
      value = "UTC"
    }
    option_name = "Timezone"
  }
  options {
    option_settings {
      name  = "IAM_ROLE_ARN"
      value = exampleAwsIamRole.arn
    }
    option_name = "SQLSERVER_BACKUP_RESTORE"
  }
  options {
    option_name = "TDE"
  }
  name                     = "option-group-test"
  option_group_description = "Option Group"
  engine_name              = "sqlserver-ee"
  major_engine_version     = "11.00"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.rds.OptionGroup;
import com.pulumi.aws.rds.OptionGroupArgs;
import com.pulumi.aws.rds.inputs.OptionGroupOptionArgs;
import com.pulumi.aws.rds.inputs.OptionGroupOptionOptionSettingArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new OptionGroup("example", OptionGroupArgs.builder()
            .options(
                OptionGroupOptionArgs.builder()
                    .optionSettings(OptionGroupOptionOptionSettingArgs.builder()
                        .name("TIME_ZONE")
                        .value("UTC")
                        .build())
                    .optionName("Timezone")
                    .build(),
                OptionGroupOptionArgs.builder()
                    .optionSettings(OptionGroupOptionOptionSettingArgs.builder()
                        .name("IAM_ROLE_ARN")
                        .value(exampleAwsIamRole.arn())
                        .build())
                    .optionName("SQLSERVER_BACKUP_RESTORE")
                    .build(),
                OptionGroupOptionArgs.builder()
                    .optionName("TDE")
                    .build())
            .name("option-group-test")
            .optionGroupDescription("Option Group")
            .engineName("sqlserver-ee")
            .majorEngineVersion("11.00")
            .build());

    }
}
resources:
  example:
    type: aws:rds:OptionGroup
    properties:
      options:
        - optionSettings:
            - name: TIME_ZONE
              value: UTC
          optionName: Timezone
        - optionSettings:
            - name: IAM_ROLE_ARN
              value: ${exampleAwsIamRole.arn}
          optionName: SQLSERVER_BACKUP_RESTORE
        - optionName: TDE
      name: option-group-test
      optionGroupDescription: Option Group
      engineName: sqlserver-ee
      majorEngineVersion: '11.00'

> Note: Any modifications to the aws.rds.OptionGroup are set to happen immediately as we default to applying immediately.

> WARNING: You can perform a destroy on a aws.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.

If you try to delete an option group that is associated with an Amazon RDS resource, an error similar to the following is returned:

> An error occurred (InvalidOptionGroupStateFault) when calling the DeleteOptionGroup operation: The option group 'optionGroupName' cannot be deleted because it is in use.

More information about this can be found here.

Import

Using pulumi import, import DB option groups using the name. For example:

$ pulumi import aws:rds/optionGroup:OptionGroup example mysql-option-group

Constructors

OptionGroup(String name, {OptionGroupArgs? args, CustomResourceOptions? options})
Creates a new OptionGroup. name The Pulumi resource name. args Arguments used to configure this OptionGroup. The set of arguments for OptionGroup. options Resource options controlling this resource's behavior.
OptionGroup.reference(String urn)
Creates a typed reference to an existing OptionGroup resource.

Properties

arn ↔ Output<String>
ARN of the DB option group.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
engineName ↔ Output<String>
Specifies the name of the engine that this option group should be associated with.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
majorEngineVersion ↔ Output<String>
Specifies the major version of the engine that this option group should be associated with.
latefinal
name ↔ Output<String>
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.
latefinal
namePrefix ↔ Output<String>
Creates a unique name beginning with the specified prefix. Conflicts with name. Must be lowercase, to match as it is stored in AWS.
latefinal
optionGroupDescription ↔ Output<String>
Description of the option group. Defaults to "Managed by Pulumi".
latefinal
options ↔ Output<List<OptionGroupOption>?>
The options to apply. See option Block below for more details.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skipDestroy ↔ Output<bool?>
Set to true if you do not wish the option group to be deleted at destroy time, and instead just remove the option group from the Pulumi state.
latefinal
tags ↔ Output<Map<String, String>?>
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.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {OptionGroupState? state, CustomResourceOptions? options}) → OptionGroup
Gets an existing OptionGroup resource's state with the given name and id.