Class ParameterGroupProps
Properties for a parameter group.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ParameterGroupProps : Object, IParameterGroupProps
Syntax (vb)
Public Class ParameterGroupProps
Inherits Object
Implements IParameterGroupProps
Remarks
ExampleMetadata: lit=aws-rds/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_18_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
Constructors
ParameterGroupProps() |
Properties
Description | Description for this parameter group. |
Engine | The database engine for this parameter group. |
Name | The name of this parameter group. |
Parameters | The parameters in this parameter group. |
RemovalPolicy | The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. |
Constructors
ParameterGroupProps()
public ParameterGroupProps()
Properties
Description
Description for this parameter group.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: a CDK generated description
Engine
The database engine for this parameter group.
public IEngine Engine { get; set; }
Property Value
Name
The name of this parameter group.
public string Name { get; set; }
Property Value
System.String
Remarks
Default: - CloudFormation-generated name
Parameters
The parameters in this parameter group.
public IDictionary<string, string> Parameters { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - None
RemovalPolicy
The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.
public Nullable<RemovalPolicy> RemovalPolicy { get; set; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: - RemovalPolicy.DESTROY