@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:05.694Z") @Stability(value=Experimental) public interface DatabaseClusterProps extends software.amazon.jsii.JsiiSerializable
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.core.*;
import software.amazon.awscdk.services.docdb.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.kms.*;
import software.amazon.awscdk.services.logs.*;
ClusterParameterGroup clusterParameterGroup;
Duration duration;
InstanceType instanceType;
Key key;
Role role;
SecretValue secretValue;
SecurityGroup securityGroup;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;
DatabaseClusterProps databaseClusterProps = DatabaseClusterProps.builder()
.instanceType(instanceType)
.masterUser(Login.builder()
.username("username")
// the properties below are optional
.excludeCharacters("excludeCharacters")
.kmsKey(key)
.password(secretValue)
.secretName("secretName")
.build())
.vpc(vpc)
// the properties below are optional
.backup(BackupProps.builder()
.retention(duration)
// the properties below are optional
.preferredWindow("preferredWindow")
.build())
.cloudWatchLogsRetention(RetentionDays.ONE_DAY)
.cloudWatchLogsRetentionRole(role)
.dbClusterName("dbClusterName")
.deletionProtection(false)
.engineVersion("engineVersion")
.exportAuditLogsToCloudWatch(false)
.exportProfilerLogsToCloudWatch(false)
.instanceIdentifierBase("instanceIdentifierBase")
.instances(123)
.kmsKey(key)
.parameterGroup(clusterParameterGroup)
.port(123)
.preferredMaintenanceWindow("preferredMaintenanceWindow")
.removalPolicy(RemovalPolicy.DESTROY)
.securityGroup(securityGroup)
.storageEncrypted(false)
.vpcSubnets(SubnetSelection.builder()
.availabilityZones(List.of("availabilityZones"))
.onePerAz(false)
.subnetFilters(List.of(subnetFilter))
.subnetGroupName("subnetGroupName")
.subnetName("subnetName")
.subnets(List.of(subnet))
.subnetType(SubnetType.ISOLATED)
.build())
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
DatabaseClusterProps.Builder
A builder for
DatabaseClusterProps |
static class |
DatabaseClusterProps.Jsii$Proxy
An implementation for
DatabaseClusterProps |
| Modifier and Type | Method and Description |
|---|---|
static DatabaseClusterProps.Builder |
builder() |
default BackupProps |
getBackup()
(experimental) Backup settings.
|
default RetentionDays |
getCloudWatchLogsRetention()
(experimental) The number of days log events are kept in CloudWatch Logs.
|
default IRole |
getCloudWatchLogsRetentionRole()
(experimental) The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
|
default String |
getDbClusterName()
(experimental) An optional identifier for the cluster.
|
default Boolean |
getDeletionProtection()
(experimental) Specifies whether this cluster can be deleted.
|
default String |
getEngineVersion()
(experimental) What version of the database to start.
|
default Boolean |
getExportAuditLogsToCloudWatch()
(experimental) Whether the audit logs should be exported to CloudWatch.
|
default Boolean |
getExportProfilerLogsToCloudWatch()
(experimental) Whether the profiler logs should be exported to CloudWatch.
|
default String |
getInstanceIdentifierBase()
(experimental) Base identifier for instances.
|
default Number |
getInstances()
(experimental) Number of DocDB compute instances.
|
InstanceType |
getInstanceType()
(experimental) What type of instance to start for the replicas.
|
default IKey |
getKmsKey()
(experimental) The KMS key for storage encryption.
|
Login |
getMasterUser()
(experimental) Username and password for the administrative user.
|
default IClusterParameterGroup |
getParameterGroup()
(experimental) The DB parameter group to associate with the instance.
|
default Number |
getPort()
(experimental) The port the DocumentDB cluster will listen on.
|
default String |
getPreferredMaintenanceWindow()
(experimental) A weekly time range in which maintenance should preferably execute.
|
default RemovalPolicy |
getRemovalPolicy()
(experimental) 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.
|
default ISecurityGroup |
getSecurityGroup()
(experimental) Security group.
|
default Boolean |
getStorageEncrypted()
(experimental) Whether to enable storage encryption.
|
IVpc |
getVpc()
(experimental) What subnets to run the DocumentDB instances in.
|
default SubnetSelection |
getVpcSubnets()
(experimental) Where to place the instances within the VPC.
|
@Stability(value=Experimental) @NotNull InstanceType getInstanceType()
@Stability(value=Experimental) @NotNull Login getMasterUser()
@Stability(value=Experimental) @NotNull IVpc getVpc()
Must be at least 2 subnets in two different AZs.
@Stability(value=Experimental) @Nullable default BackupProps getBackup()
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.
https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.db-cluster-snapshots.html#backup-restore.backup-window@Stability(value=Experimental) @Nullable default RetentionDays getCloudWatchLogsRetention()
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
@Stability(value=Experimental) @Nullable default IRole getCloudWatchLogsRetentionRole()
Default: - a new role is created.
@Stability(value=Experimental) @Nullable default String getDbClusterName()
Default: - A name is automatically generated.
@Stability(value=Experimental) @Nullable default Boolean getDeletionProtection()
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
@Stability(value=Experimental) @Nullable default String getEngineVersion()
Default: - The default engine version.
@Stability(value=Experimental) @Nullable default Boolean getExportAuditLogsToCloudWatch()
Note that you also have to configure the audit log export in the Cluster's Parameter Group.
Default: false
https://docs.aws.amazon.com/documentdb/latest/developerguide/event-auditing.html#event-auditing-enabling-auditing@Stability(value=Experimental) @Nullable default Boolean getExportProfilerLogsToCloudWatch()
Note that you also have to configure the profiler log export in the Cluster's Parameter Group.
Default: false
https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html#profiling.enable-profiling@Stability(value=Experimental) @Nullable default String getInstanceIdentifierBase()
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.
@Stability(value=Experimental) @Nullable default Number getInstances()
Default: 1
@Stability(value=Experimental) @Nullable default IKey getKmsKey()
Default: - default master key.
@Stability(value=Experimental) @Nullable default IClusterParameterGroup getParameterGroup()
Default: no parameter group
@Stability(value=Experimental) @Nullable default Number getPort()
Default: DatabaseCluster.DEFAULT_PORT
@Stability(value=Experimental) @Nullable default String getPreferredMaintenanceWindow()
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.
https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html#maintenance-window@Stability(value=Experimental) @Nullable default RemovalPolicy getRemovalPolicy()
This removal policy also applies to the implicit security group created for the cluster if one is not supplied as a parameter.
Default: - Retain cluster.
@Stability(value=Experimental) @Nullable default ISecurityGroup getSecurityGroup()
Default: a new security group is created.
@Stability(value=Experimental) @Nullable default Boolean getStorageEncrypted()
Default: true
@Stability(value=Experimental) @Nullable default SubnetSelection getVpcSubnets()
Default: private subnets
@Stability(value=Experimental) static DatabaseClusterProps.Builder builder()
DatabaseClusterProps.Builder of DatabaseClusterPropsCopyright © 2022. All rights reserved.