Class ProvisionedClusterInstanceProps
Options for creating a provisioned instance.
Inherited Members
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ProvisionedClusterInstanceProps : IProvisionedClusterInstanceProps, IClusterInstanceOptions
Syntax (vb)
Public Class ProvisionedClusterInstanceProps Implements IProvisionedClusterInstanceProps, 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("Instance", new ProvisionedClusterInstanceProps {
InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.SMALL)
}),
Readers = new [] { ClusterInstance.Provisioned("reader") },
InstanceUpdateBehaviour = InstanceUpdateBehaviour.ROLLING, // Optional - defaults to rds.InstanceUpdateBehaviour.BULK
Vpc = vpc
});
Synopsis
Constructors
| ProvisionedClusterInstanceProps() | Options for creating a provisioned instance. |
Properties
| AllowMajorVersionUpgrade | Whether to allow upgrade of major version for the DB instance. |
| ApplyImmediately | Specifies whether changes to the DB instance and any pending modifications are applied immediately, regardless of the |
| AutoMinorVersionUpgrade | Whether to enable automatic upgrade of minor version for the DB instance. |
| AvailabilityZone | The Availability Zone (AZ) where the database will be created. |
| 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. |
| InstanceType | The cluster instance type. |
| 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). |
| PromotionTier | The promotion tier of the cluster instance. |
| PubliclyAccessible | Indicates whether the DB instance is an internet-facing instance. |
Constructors
ProvisionedClusterInstanceProps()
Options for creating a provisioned instance.
public ProvisionedClusterInstanceProps()
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("Instance", new ProvisionedClusterInstanceProps {
InstanceType = InstanceType.Of(InstanceClass.BURSTABLE3, InstanceSize.SMALL)
}),
Readers = new [] { ClusterInstance.Provisioned("reader") },
InstanceUpdateBehaviour = InstanceUpdateBehaviour.ROLLING, // Optional - defaults to rds.InstanceUpdateBehaviour.BULK
Vpc = vpc
});
Properties
AllowMajorVersionUpgrade
Whether to allow upgrade of major version for the DB instance.
public bool? AllowMajorVersionUpgrade { get; set; }
Property Value
bool?
Remarks
Default: - false
ApplyImmediately
Specifies whether changes to the DB instance and any pending modifications are applied immediately, regardless of the preferredMaintenanceWindow setting.
public bool? ApplyImmediately { get; set; }
Property Value
bool?
Remarks
If set to false, changes are applied during the next maintenance window.
Until RDS applies the changes, the DB instance remains in a drift state. As a result, the configuration doesn't fully reflect the requested modifications and temporarily diverges from the intended state.
This property also determines whether the DB instance reboots when a static parameter is modified in the associated DB parameter group.
Default: - Changes will be applied immediately
See: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Modifying.html
AutoMinorVersionUpgrade
Whether to enable automatic upgrade of minor version for the DB instance.
public bool? AutoMinorVersionUpgrade { get; set; }
Property Value
bool?
Remarks
Default: - true
AvailabilityZone
The Availability Zone (AZ) where the database will be created.
public string? AvailabilityZone { get; set; }
Property Value
Remarks
For Amazon Aurora, each Aurora DB cluster hosts copies of its storage in three separate Availability Zones. Specify one of these Availability Zones. Aurora automatically chooses an appropriate Availability Zone if you don't specify one.
Default: - A random, system-chosen Availability Zone in the endpointʼs AWS Region.
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 bool? EnablePerformanceInsights { get; set; }
Property Value
bool?
Remarks
Default: - false, unless performanceInsightRetention or performanceInsightEncryptionKey is set.
InstanceIdentifier
The identifier for the database instance.
public string? InstanceIdentifier { get; set; }
Property Value
Remarks
Default: - CloudFormation generated identifier
InstanceType
The cluster instance type.
public InstanceType? InstanceType { get; set; }
Property Value
Remarks
Default: db.t3.medium
IsFromLegacyInstanceProps
Only used for migrating existing clusters from using instanceProps to writer and readers.
public bool? IsFromLegacyInstanceProps { get; set; }
Property Value
bool?
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
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 PerformanceInsightRetention? PerformanceInsightRetention { get; set; }
Property Value
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
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.
PromotionTier
The promotion tier of the cluster instance.
public double? PromotionTier { get; set; }
Property Value
Remarks
Can be between 0-15
For provisioned instances this just determines the failover priority. If multiple instances have the same priority then one will be picked at random
Default: 2
PubliclyAccessible
Indicates whether the DB instance is an internet-facing instance.
public bool? PubliclyAccessible { get; set; }
Property Value
bool?
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