Class DatabaseCluster
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.docdb.DatabaseCluster
- All Implemented Interfaces:
IResource
,IDatabaseCluster
,IConnectable
,ISecretAttachmentTarget
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-11T15:55:56.220Z")
@Stability(Stable)
public class DatabaseCluster
extends Resource
implements IDatabaseCluster
Create a clustered database with a given number of instances.
Example:
Vpc vpc; DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database") .masterUser(Login.builder() .username("myuser") .build()) .instanceType(InstanceType.of(InstanceClass.MEMORY5, InstanceSize.LARGE)) .vpcSubnets(SubnetSelection.builder() .subnetType(SubnetType.PUBLIC) .build()) .vpc(vpc) .removalPolicy(RemovalPolicy.SNAPSHOT) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.docdb.IDatabaseCluster
IDatabaseCluster.Jsii$Default, IDatabaseCluster.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
DatabaseCluster
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
DatabaseCluster
(software.amazon.jsii.JsiiObjectRef objRef) DatabaseCluster
(software.constructs.Construct scope, String id, DatabaseClusterProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddRotationMultiUser
(String id, RotationMultiUserOptions options) Adds the multi user rotation to this cluster.Adds the single user rotation of the master password to this cluster.addRotationSingleUser
(Duration automaticallyAfter) Adds the single user rotation of the master password to this cluster.void
addSecurityGroups
(@NotNull ISecurityGroup... securityGroups) Adds security groups to this cluster.Renders the secret attachment target specifications.static IDatabaseCluster
fromDatabaseClusterAttributes
(software.constructs.Construct scope, String id, DatabaseClusterAttributes attrs) Import an existing DatabaseCluster from properties.The endpoint to use for read/write operations.Identifier of the cluster.Endpoint to use for load-balanced read-only operations.The resource id for the cluster;The connections object to implement IConnectable.Endpoints which address each individual replica.Identifiers of the replicas.The secret attached to this cluster.Security group identifier of this database.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
DEFAULT_NUM_INSTANCES
The default number of instances in the DocDB cluster if none are specified. -
DEFAULT_PORT
The default port Document DB listens on.
-
-
Constructor Details
-
DatabaseCluster
protected DatabaseCluster(software.amazon.jsii.JsiiObjectRef objRef) -
DatabaseCluster
protected DatabaseCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DatabaseCluster
@Stability(Stable) public DatabaseCluster(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseClusterProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromDatabaseClusterAttributes
@Stability(Stable) @NotNull public static IDatabaseCluster fromDatabaseClusterAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseClusterAttributes attrs) Import an existing DatabaseCluster from properties.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
addRotationMultiUser
@Stability(Stable) @NotNull public SecretRotation addRotationMultiUser(@NotNull String id, @NotNull RotationMultiUserOptions options) Adds the multi user rotation to this cluster.- Parameters:
id
- This parameter is required.options
- This parameter is required.
-
addRotationSingleUser
@Stability(Stable) @NotNull public SecretRotation addRotationSingleUser(@Nullable Duration automaticallyAfter) Adds the single user rotation of the master password to this cluster.- Parameters:
automaticallyAfter
- Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.
-
addRotationSingleUser
Adds the single user rotation of the master password to this cluster. -
addSecurityGroups
@Stability(Stable) public void addSecurityGroups(@NotNull @NotNull ISecurityGroup... securityGroups) Adds security groups to this cluster.- Parameters:
securityGroups
- The security groups to add. This parameter is required.
-
asSecretAttachmentTarget
Renders the secret attachment target specifications.- Specified by:
asSecretAttachmentTarget
in interfaceISecretAttachmentTarget
-
getClusterEndpoint
The endpoint to use for read/write operations.- Specified by:
getClusterEndpoint
in interfaceIDatabaseCluster
-
getClusterIdentifier
Identifier of the cluster.- Specified by:
getClusterIdentifier
in interfaceIDatabaseCluster
-
getClusterReadEndpoint
Endpoint to use for load-balanced read-only operations.- Specified by:
getClusterReadEndpoint
in interfaceIDatabaseCluster
-
getClusterResourceIdentifier
The resource id for the cluster;for example: cluster-ABCD1234EFGH5678IJKL90MNOP. The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies.
-
getConnections
The connections object to implement IConnectable.- Specified by:
getConnections
in interfaceIConnectable
-
getInstanceEndpoints
Endpoints which address each individual replica.- Specified by:
getInstanceEndpoints
in interfaceIDatabaseCluster
-
getInstanceIdentifiers
Identifiers of the replicas.- Specified by:
getInstanceIdentifiers
in interfaceIDatabaseCluster
-
getSecurityGroupId
Security group identifier of this database.- Specified by:
getSecurityGroupId
in interfaceIDatabaseCluster
-
getSecret
The secret attached to this cluster.
-