Show / Hide Table of Contents

Class ClusterInstanceOptions

Common options for creating a cluster instance.

Inheritance
System.Object
ClusterInstanceOptions
Implements
IClusterInstanceOptions
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ClusterInstanceOptions : Object, IClusterInstanceOptions
Syntax (vb)
Public Class ClusterInstanceOptions
    Inherits Object
    Implements IClusterInstanceOptions
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.AWS.RDS;

CaCertificate caCertificate;
Key key;
ParameterGroup parameterGroup;

var clusterInstanceOptions = new ClusterInstanceOptions {
    AllowMajorVersionUpgrade = false,
    ApplyImmediately = false,
    AutoMinorVersionUpgrade = false,
    AvailabilityZone = "availabilityZone",
    CaCertificate = caCertificate,
    EnablePerformanceInsights = false,
    InstanceIdentifier = "instanceIdentifier",
    IsFromLegacyInstanceProps = false,
    ParameterGroup = parameterGroup,
    Parameters = new Dictionary<string, string> {
        { "parametersKey", "parameters" }
    },
    PerformanceInsightEncryptionKey = key,
    PerformanceInsightRetention = PerformanceInsightRetention.DEFAULT,
    PreferredMaintenanceWindow = "preferredMaintenanceWindow",
    PubliclyAccessible = false
};

Synopsis

Constructors

ClusterInstanceOptions()

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 preferredMaintenanceWindow setting.

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.

IsFromLegacyInstanceProps

Only used for migrating existing clusters from using instanceProps to writer and readers.

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.

Constructors

ClusterInstanceOptions()

public ClusterInstanceOptions()

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

ApplyImmediately

Specifies whether changes to the DB instance and any pending modifications are applied immediately, regardless of the preferredMaintenanceWindow setting.

public Nullable<bool> ApplyImmediately { get; set; }
Property Value

System.Nullable<System.Boolean>

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 Nullable<bool> AutoMinorVersionUpgrade { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: - true

AvailabilityZone

The Availability Zone (AZ) where the database will be created.

public string AvailabilityZone { get; set; }
Property Value

System.String

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.

See: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html

CaCertificate

The identifier of the CA certificate for this DB cluster's instances.

public CaCertificate CaCertificate { get; set; }
Property Value

CaCertificate

Remarks

Specifying or updating this property triggers a reboot.

For RDS DB engines:

Default: - RDS will choose a certificate authority

See: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html

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

IParameterGroup

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

IKey

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.

See: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance

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

Implements

IClusterInstanceOptions
Back to top Generated by DocFX