Interface IDatabaseClusterProps
Properties for a new database cluster.
Namespace: Amazon.CDK.AWS.DocDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IDatabaseClusterProps
Syntax (vb)
Public Interface IDatabaseClusterProps
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
MasterUser = new Login {
Username = "myuser"
},
InstanceType = InstanceType.Of(InstanceClass.MEMORY5, InstanceSize.LARGE),
VpcSubnets = new SubnetSelection {
SubnetType = SubnetType.PUBLIC
},
Vpc = vpc,
RemovalPolicy = RemovalPolicy.SNAPSHOT
});
Synopsis
Properties
Backup | Backup settings. |
CaCertificate | The identifier of the CA certificate used for the instances. |
CloudWatchLogsRetention | The number of days log events are kept in CloudWatch Logs. |
CloudWatchLogsRetentionRole | The IAM role for the Lambda function associated with the custom resource that sets the retention policy. |
CopyTagsToSnapshot | Whether to copy tags to the snapshot when a snapshot is created. |
DbClusterName | An optional identifier for the cluster. |
DeletionProtection | Specifies whether this cluster can be deleted. |
EnablePerformanceInsights | A value that indicates whether to enable Performance Insights for the instances in the DB Cluster. |
EngineVersion | What version of the database to start. |
ExportAuditLogsToCloudWatch | Whether the audit logs should be exported to CloudWatch. |
ExportProfilerLogsToCloudWatch | Whether the profiler logs should be exported to CloudWatch. |
InstanceIdentifierBase | Base identifier for instances. |
InstanceRemovalPolicy | The removal policy to apply to the cluster's instances. |
Instances | Number of DocDB compute instances. |
InstanceType | What type of instance to start for the replicas. |
KmsKey | The KMS key for storage encryption. |
MasterUser | Username and password for the administrative user. |
ParameterGroup | The DB parameter group to associate with the instance. |
Port | The port the DocumentDB cluster will listen on. |
PreferredMaintenanceWindow | A weekly time range in which maintenance should preferably execute. |
RemovalPolicy | The removal policy to apply when the cluster and its instances are removed or replaced during a stack update, or when the stack is deleted. |
SecurityGroup | Security group. |
SecurityGroupRemovalPolicy | The removal policy to apply to the cluster's security group. |
StorageEncrypted | Whether to enable storage encryption. |
StorageType | The storage type of the DocDB cluster. |
Vpc | What subnets to run the DocumentDB instances in. |
VpcSubnets | Where to place the instances within the VPC. |
Properties
Backup
Backup settings.
virtual IBackupProps Backup { get; }
Property Value
Remarks
Default: - Backup retention period for automated backups is 1 day. Backup preferred window is set to a 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.
CaCertificate
The identifier of the CA certificate used for the instances.
virtual CaCertificate CaCertificate { get; }
Property Value
Remarks
Specifying or updating this property triggers a reboot.
Default: - DocumentDB will choose a certificate authority
See: https://docs.aws.amazon.com/documentdb/latest/developerguide/ca_cert_rotation.html
CloudWatchLogsRetention
The number of days log events are kept in CloudWatch Logs.
virtual Nullable<RetentionDays> CloudWatchLogsRetention { get; }
Property Value
System.Nullable<RetentionDays>
Remarks
When updating
this property, unsetting it doesn't remove the log retention policy. To
remove the retention policy, set the value to Infinity
.
Default: - logs never expire
CloudWatchLogsRetentionRole
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
virtual IRole CloudWatchLogsRetentionRole { get; }
Property Value
Remarks
Default: - a new role is created.
CopyTagsToSnapshot
Whether to copy tags to the snapshot when a snapshot is created.
virtual Nullable<bool> CopyTagsToSnapshot { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false
DbClusterName
An optional identifier for the cluster.
virtual string DbClusterName { get; }
Property Value
System.String
Remarks
Default: - A name is automatically generated.
DeletionProtection
Specifies whether this cluster can be deleted.
virtual Nullable<bool> DeletionProtection { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
If deletionProtection is enabled, the cluster cannot be deleted unless it is modified and deletionProtection is disabled. deletionProtection protects clusters from being accidentally deleted.
Default: - false
EnablePerformanceInsights
A value that indicates whether to enable Performance Insights for the instances in the DB Cluster.
virtual Nullable<bool> EnablePerformanceInsights { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false
EngineVersion
What version of the database to start.
virtual string EngineVersion { get; }
Property Value
System.String
Remarks
Default: - the latest major version
ExportAuditLogsToCloudWatch
Whether the audit logs should be exported to CloudWatch.
virtual Nullable<bool> ExportAuditLogsToCloudWatch { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Note that you also have to configure the audit log export in the Cluster's Parameter Group.
Default: false
ExportProfilerLogsToCloudWatch
Whether the profiler logs should be exported to CloudWatch.
virtual Nullable<bool> ExportProfilerLogsToCloudWatch { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Note that you also have to configure the profiler log export in the Cluster's Parameter Group.
Default: false
InstanceIdentifierBase
Base identifier for instances.
virtual string InstanceIdentifierBase { get; }
Property Value
System.String
Remarks
Every replica is named by appending the replica number to this string, 1-based.
Default: - dbClusterName
is used with the word "Instance" appended. If dbClusterName
is not provided, the
identifier is automatically generated.
InstanceRemovalPolicy
The removal policy to apply to the cluster's instances.
virtual Nullable<RemovalPolicy> InstanceRemovalPolicy { get; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Cannot be set to SNAPSHOT
.
Default: - RemovalPolicy.DESTROY
when removalPolicy
is set to SNAPSHOT
, removalPolicy
otherwise.
See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
Instances
Number of DocDB compute instances.
virtual Nullable<double> Instances { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 1
InstanceType
What type of instance to start for the replicas.
InstanceType InstanceType { get; }
Property Value
KmsKey
The KMS key for storage encryption.
virtual IKey KmsKey { get; }
Property Value
Remarks
Default: - default master key.
MasterUser
ParameterGroup
The DB parameter group to associate with the instance.
virtual IClusterParameterGroup ParameterGroup { get; }
Property Value
Remarks
Default: no parameter group
Port
The port the DocumentDB cluster will listen on.
virtual Nullable<double> Port { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: DatabaseCluster.DEFAULT_PORT
PreferredMaintenanceWindow
A weekly time range in which maintenance should preferably execute.
virtual string PreferredMaintenanceWindow { get; }
Property Value
System.String
Remarks
Must be at least 30 minutes long.
Example: 'tue:04:17-tue:04:47'
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.
RemovalPolicy
The removal policy to apply when the cluster and its instances are removed or replaced during a stack update, or when the stack is deleted.
virtual Nullable<RemovalPolicy> RemovalPolicy { get; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
This removal policy also applies to the implicit security group created for the cluster if one is not supplied as a parameter.
When set to SNAPSHOT
, the removal policy for the instances and the security group
will default to DESTROY
as those resources do not support the policy.
Use the instanceRemovalPolicy
and securityGroupRemovalPolicy
to change the behavior.
Default: - Retain cluster.
SecurityGroup
Security group.
virtual ISecurityGroup SecurityGroup { get; }
Property Value
Remarks
Default: a new security group is created.
SecurityGroupRemovalPolicy
The removal policy to apply to the cluster's security group.
virtual Nullable<RemovalPolicy> SecurityGroupRemovalPolicy { get; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Cannot be set to SNAPSHOT
.
Default: - RemovalPolicy.DESTROY
when removalPolicy
is set to SNAPSHOT
, removalPolicy
otherwise.
See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
StorageEncrypted
Whether to enable storage encryption.
virtual Nullable<bool> StorageEncrypted { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
StorageType
The storage type of the DocDB cluster.
virtual Nullable<StorageType> StorageType { get; }
Property Value
System.Nullable<StorageType>
Remarks
I/O-optimized storage is supported starting with engine version 5.0.0.
Default: StorageType.STANDARD
Vpc
What subnets to run the DocumentDB instances in.
IVpc Vpc { get; }
Property Value
Remarks
Must be at least 2 subnets in two different AZs.
VpcSubnets
Where to place the instances within the VPC.
virtual ISubnetSelection VpcSubnets { get; }
Property Value
Remarks
Default: private subnets