@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
135 lines • 6.55 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.OptionGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an RDS DB option group resource. Documentation of the available options for various RDS engines can be found at:
*
* * [MariaDB Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MariaDB.Options.html)
* * [Microsoft SQL Server Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.SQLServer.Options.html)
* * [MySQL Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.Options.html)
* * [Oracle Options](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.rds.OptionGroup("example", {
* name: "option-group-test",
* optionGroupDescription: "Option Group",
* engineName: "sqlserver-ee",
* majorEngineVersion: "11.00",
* options: [
* {
* optionName: "Timezone",
* optionSettings: [{
* name: "TIME_ZONE",
* value: "UTC",
* }],
* },
* {
* optionName: "SQLSERVER_BACKUP_RESTORE",
* optionSettings: [{
* name: "IAM_ROLE_ARN",
* value: exampleAwsIamRole.arn,
* }],
* },
* {
* optionName: "TDE",
* },
* ],
* });
* ```
*
* > **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](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithOptionGroups.html#USER_WorkingWithOptionGroups.Delete).
*
* ## Import
*
* Using `pulumi import`, import DB option groups using the `name`. For example:
*
* ```sh
* $ pulumi import aws:rds/optionGroup:OptionGroup example mysql-option-group
* ```
*/
class OptionGroup extends pulumi.CustomResource {
/**
* Get an existing OptionGroup resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new OptionGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of OptionGroup. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === OptionGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
var _a;
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["engineName"] = state ? state.engineName : undefined;
resourceInputs["majorEngineVersion"] = state ? state.majorEngineVersion : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["namePrefix"] = state ? state.namePrefix : undefined;
resourceInputs["optionGroupDescription"] = state ? state.optionGroupDescription : undefined;
resourceInputs["options"] = state ? state.options : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["skipDestroy"] = state ? state.skipDestroy : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
if ((!args || args.engineName === undefined) && !opts.urn) {
throw new Error("Missing required property 'engineName'");
}
if ((!args || args.majorEngineVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'majorEngineVersion'");
}
resourceInputs["engineName"] = args ? args.engineName : undefined;
resourceInputs["majorEngineVersion"] = args ? args.majorEngineVersion : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["namePrefix"] = args ? args.namePrefix : undefined;
resourceInputs["optionGroupDescription"] = (_a = (args ? args.optionGroupDescription : undefined)) !== null && _a !== void 0 ? _a : "Managed by Pulumi";
resourceInputs["options"] = args ? args.options : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["skipDestroy"] = args ? args.skipDestroy : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(OptionGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.OptionGroup = OptionGroup;
/** @internal */
OptionGroup.__pulumiType = 'aws:rds/optionGroup:OptionGroup';
//# sourceMappingURL=optionGroup.js.map