Class ServerlessV2ClusterInstanceProps
Options for creating a serverless v2 instance.
Inheritance
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ServerlessV2ClusterInstanceProps : Object, IServerlessV2ClusterInstanceProps, IClusterInstanceOptions
Syntax (vb)
Public Class ServerlessV2ClusterInstanceProps
Inherits Object
Implements IServerlessV2ClusterInstanceProps, IClusterInstanceOptions
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
Engine = DatabaseClusterEngine.AuroraMysql(new AuroraMysqlClusterEngineProps { Version = AuroraMysqlEngineVersion.VER_3_01_0 }),
Writer = ClusterInstance.Provisioned("writer", new ProvisionedClusterInstanceProps {
CaCertificate = CaCertificate.RDS_CA_RSA2048_G1
}),
Readers = new [] { ClusterInstance.ServerlessV2("reader", new ServerlessV2ClusterInstanceProps {
CaCertificate = CaCertificate.Of("custom-ca")
}) },
Vpc = vpc
});
Synopsis
Constructors
ServerlessV2ClusterInstanceProps() |
Properties
AllowMajorVersionUpgrade | Whether to allow upgrade of major version for the DB instance. |
AutoMinorVersionUpgrade | Whether to enable automatic upgrade of minor version for the DB instance. |
CaCertificate | The identifier of the CA certificate for this DB cluster's instances. |
EnablePerformanceInsights | Whether to enable Performance Insights for the DB instance. |
InstanceIdentifier | The identifier for the database instance. |
IsFromLegacyInstanceProps | Only used for migrating existing clusters from using |
ParameterGroup | The DB parameter group to associate with the instance. |
Parameters | The parameters in the DBParameterGroup to create automatically. |
PerformanceInsightEncryptionKey | The AWS KMS key for encryption of Performance Insights data. |
PerformanceInsightRetention | The amount of time, in days, to retain Performance Insights data. |
PreferredMaintenanceWindow | A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). |
PubliclyAccessible | Indicates whether the DB instance is an internet-facing instance. |
ScaleWithWriter | Only applicable to reader instances. |
Constructors
ServerlessV2ClusterInstanceProps()
public ServerlessV2ClusterInstanceProps()
Properties
AllowMajorVersionUpgrade
Whether to allow upgrade of major version for the DB instance.
public Nullable<bool> AllowMajorVersionUpgrade { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false
AutoMinorVersionUpgrade
Whether to enable automatic upgrade of minor version for the DB instance.
public Nullable<bool> AutoMinorVersionUpgrade { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true
CaCertificate
The identifier of the CA certificate for this DB cluster's instances.
public CaCertificate CaCertificate { get; set; }
Property Value
Remarks
Specifying or updating this property triggers a reboot.
For RDS DB engines:
Default: - RDS will choose a certificate authority
EnablePerformanceInsights
Whether to enable Performance Insights for the DB instance.
public Nullable<bool> EnablePerformanceInsights { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false, unless performanceInsightRetention
or performanceInsightEncryptionKey
is set.
InstanceIdentifier
The identifier for the database instance.
public string InstanceIdentifier { get; set; }
Property Value
System.String
Remarks
Default: - CloudFormation generated identifier
IsFromLegacyInstanceProps
Only used for migrating existing clusters from using instanceProps
to writer
and readers
.
public Nullable<bool> IsFromLegacyInstanceProps { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Examples
// existing cluster
Vpc vpc;
var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
Engine = DatabaseClusterEngine.AuroraMysql(new AuroraMysqlClusterEngineProps {
Version = AuroraMysqlEngineVersion.VER_3_03_0
}),
Instances = 2,
InstanceProps = new InstanceProps {
InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.SMALL),
VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PUBLIC },
Vpc = vpc
}
});
// migration
IDictionary<string, object> instanceProps = new Dictionary<string, object> {
{ "instanceType", InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.SMALL) },
{ "isFromLegacyInstanceProps", true }
};
var myCluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
Engine = DatabaseClusterEngine.AuroraMysql(new AuroraMysqlClusterEngineProps {
Version = AuroraMysqlEngineVersion.VER_3_03_0
}),
VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PUBLIC },
Vpc = vpc,
Writer = ClusterInstance.Provisioned("Instance1", new ProvisionedClusterInstanceProps {
InstanceType = instanceProps.InstanceType,
IsFromLegacyInstanceProps = instanceProps.IsFromLegacyInstanceProps
}),
Readers = new [] { ClusterInstance.Provisioned("Instance2", new ProvisionedClusterInstanceProps {
InstanceType = instanceProps.InstanceType,
IsFromLegacyInstanceProps = instanceProps.IsFromLegacyInstanceProps
}) }
});
ParameterGroup
The DB parameter group to associate with the instance.
public IParameterGroup ParameterGroup { get; set; }
Property Value
Remarks
This is only needed if you need to configure different parameter groups for each individual instance, otherwise you should not provide this and just use the cluster parameter group
Default: the cluster parameter group is used
Parameters
The parameters in the DBParameterGroup to create automatically.
public IDictionary<string, string> Parameters { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBParameterGroup.
Default: - None
PerformanceInsightEncryptionKey
The AWS KMS key for encryption of Performance Insights data.
public IKey PerformanceInsightEncryptionKey { get; set; }
Property Value
Remarks
Default: - default master key
PerformanceInsightRetention
The amount of time, in days, to retain Performance Insights data.
public Nullable<PerformanceInsightRetention> PerformanceInsightRetention { get; set; }
Property Value
System.Nullable<PerformanceInsightRetention>
Remarks
Default: 7
PreferredMaintenanceWindow
A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).
public string PreferredMaintenanceWindow { get; set; }
Property Value
System.String
Remarks
Example: 'Sun:23:45-Mon:00:15'
Default: - 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week.
PubliclyAccessible
Indicates whether the DB instance is an internet-facing instance.
public Nullable<bool> PubliclyAccessible { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If not specified, the cluster's vpcSubnets will be used to determine if the instance is internet-facing or not.
Default: - true
if the cluster's vpcSubnets
is subnetType: SubnetType.PUBLIC
, false
otherwise
ScaleWithWriter
Only applicable to reader instances.
public Nullable<bool> ScaleWithWriter { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If this is true then the instance will be placed in promotion tier 1, otherwise it will be placed in promotion tier 2.
For serverless v2 instances this means:
Default: false