Show / Hide Table of Contents

Interface IOptionGroupProps

Construction properties for an OptionGroup.

Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.AWS.RDS.dll
Syntax (csharp)
public interface IOptionGroupProps
Syntax (vb)
Public Interface IOptionGroupProps
Remarks

ExampleMetadata: lit=test/integ.instance.lit.ts infused

Examples
// Set open cursors with parameter group
var parameterGroup = new ParameterGroup(this, "ParameterGroup", new ParameterGroupProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    Parameters = new Dictionary<string, string> {
        { "open_cursors", "2500" }
    }
});

var optionGroup = new OptionGroup(this, "OptionGroup", new OptionGroupProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    Configurations = new [] { new OptionConfiguration {
        Name = "LOCATOR"
    }, new OptionConfiguration {
        Name = "OEM",
        Port = 1158,
        Vpc = vpc
    } }
});

// Allow connections to OEM
optionGroup.OptionConnections.OEM.Connections.AllowDefaultPortFromAnyIpv4();

// Database instance with production values
var instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
    Engine = DatabaseInstanceEngine.OracleSe2(new OracleSe2InstanceEngineProps { Version = OracleEngineVersion.VER_19_0_0_0_2020_04_R1 }),
    LicenseModel = LicenseModel.BRING_YOUR_OWN_LICENSE,
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.MEDIUM),
    MultiAz = true,
    StorageType = StorageType.IO1,
    Credentials = Credentials.FromUsername("syscdk"),
    Vpc = vpc,
    DatabaseName = "ORCL",
    StorageEncrypted = true,
    BackupRetention = Duration.Days(7),
    MonitoringInterval = Duration.Seconds(60),
    EnablePerformanceInsights = true,
    CloudwatchLogsExports = new [] { "trace", "audit", "alert", "listener" },
    CloudwatchLogsRetention = RetentionDays.ONE_MONTH,
    AutoMinorVersionUpgrade = true,  // required to be true if LOCATOR is used in the option group
    OptionGroup = optionGroup,
    ParameterGroup = parameterGroup,
    RemovalPolicy = RemovalPolicy.DESTROY
});

// Allow connections on default port from any IPV4
instance.Connections.AllowDefaultPortFromAnyIpv4();

// Rotate the master user password every 30 days
instance.AddRotationSingleUser();

// Add alarm for high CPU
// Add alarm for high CPU
new Alarm(this, "HighCPU", new AlarmProps {
    Metric = instance.MetricCPUUtilization(),
    Threshold = 90,
    EvaluationPeriods = 1
});

// Trigger Lambda function on instance availability events
var fn = new Function(this, "Function", new FunctionProps {
    Code = Code.FromInline("exports.handler = (event) => console.log(event);"),
    Handler = "index.handler",
    Runtime = Runtime.NODEJS_14_X
});

var availabilityRule = instance.OnEvent("Availability", new OnEventOptions { Target = new LambdaFunction(fn) });
availabilityRule.AddEventPattern(new EventPattern {
    Detail = new Dictionary<string, object> {
        { "EventCategories", new [] { "availability" } }
    }
});

Synopsis

Properties

Configurations

The configurations for this option group.

Description

A description of the option group.

Engine

The database engine that this option group is associated with.

Properties

Configurations

The configurations for this option group.

IOptionConfiguration[] Configurations { get; }
Property Value

IOptionConfiguration[]

Description

A description of the option group.

virtual string Description { get; }
Property Value

System.String

Remarks

Default: a CDK generated description

Engine

The database engine that this option group is associated with.

IInstanceEngine Engine { get; }
Property Value

IInstanceEngine

Back to top Generated by DocFX