@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:45.115Z") public class DatabaseCluster extends Resource implements IDatabaseCluster
Example:
Vpc vpc; DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database") .masterUser(Login.builder() .username("myuser") // NOTE: 'admin' is reserved by DocumentDB .excludeCharacters("\"@/:") // optional, defaults to the set "\"@/" and is also used for eventually created rotations .secretName("/myapp/mydocdb/masteruser") .build()) .instanceType(InstanceType.of(InstanceClass.R5, InstanceSize.LARGE)) .vpcSubnets(SubnetSelection.builder() .subnetType(SubnetType.PUBLIC) .build()) .vpc(vpc) .build();
Modifier and Type | Class and Description |
---|---|
static class |
DatabaseCluster.Builder
A fluent builder for
DatabaseCluster . |
IDatabaseCluster.Jsii$Default, IDatabaseCluster.Jsii$Proxy
Modifier and Type | Field and Description |
---|---|
static java.lang.Number |
DEFAULT_NUM_INSTANCES
The default number of instances in the DocDB cluster if none are specified.
|
static java.lang.Number |
DEFAULT_PORT
The default port Document DB listens on.
|
Modifier | Constructor and Description |
---|---|
protected |
DatabaseCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
DatabaseCluster(software.amazon.jsii.JsiiObjectRef objRef) |
|
DatabaseCluster(software.constructs.Construct scope,
java.lang.String id,
DatabaseClusterProps props) |
Modifier and Type | Method and Description |
---|---|
SecretRotation |
addRotationMultiUser(java.lang.String id,
RotationMultiUserOptions options)
Adds the multi user rotation to this cluster.
|
SecretRotation |
addRotationSingleUser()
Adds the single user rotation of the master password to this cluster.
|
SecretRotation |
addRotationSingleUser(Duration automaticallyAfter)
Adds the single user rotation of the master password to this cluster.
|
void |
addSecurityGroups(ISecurityGroup... securityGroups)
Adds security groups to this cluster.
|
SecretAttachmentTargetProps |
asSecretAttachmentTarget()
Renders the secret attachment target specifications.
|
static IDatabaseCluster |
fromDatabaseClusterAttributes(software.constructs.Construct scope,
java.lang.String id,
DatabaseClusterAttributes attrs)
Import an existing DatabaseCluster from properties.
|
Endpoint |
getClusterEndpoint()
The endpoint to use for read/write operations.
|
java.lang.String |
getClusterIdentifier()
Identifier of the cluster.
|
Endpoint |
getClusterReadEndpoint()
Endpoint to use for load-balanced read-only operations.
|
java.lang.String |
getClusterResourceIdentifier()
The resource id for the cluster;
|
Connections |
getConnections()
The connections object to implement IConnectable.
|
java.util.List<Endpoint> |
getInstanceEndpoints()
Endpoints which address each individual replica.
|
java.util.List<java.lang.String> |
getInstanceIdentifiers()
Identifiers of the replicas.
|
ISecret |
getSecret()
The secret attached to this cluster.
|
java.lang.String |
getSecurityGroupId()
Security group identifier of this database.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
public static final java.lang.Number DEFAULT_NUM_INSTANCES
public static final java.lang.Number DEFAULT_PORT
protected DatabaseCluster(software.amazon.jsii.JsiiObjectRef objRef)
protected DatabaseCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public DatabaseCluster(software.constructs.Construct scope, java.lang.String id, DatabaseClusterProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static IDatabaseCluster fromDatabaseClusterAttributes(software.constructs.Construct scope, java.lang.String id, DatabaseClusterAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public SecretRotation addRotationMultiUser(java.lang.String id, RotationMultiUserOptions options)
id
- This parameter is required.options
- This parameter is required.public SecretRotation addRotationSingleUser(Duration automaticallyAfter)
automaticallyAfter
- Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.public SecretRotation addRotationSingleUser()
public void addSecurityGroups(ISecurityGroup... securityGroups)
securityGroups
- The security groups to add. This parameter is required.public SecretAttachmentTargetProps asSecretAttachmentTarget()
asSecretAttachmentTarget
in interface ISecretAttachmentTarget
public Endpoint getClusterEndpoint()
getClusterEndpoint
in interface IDatabaseCluster
public java.lang.String getClusterIdentifier()
getClusterIdentifier
in interface IDatabaseCluster
public Endpoint getClusterReadEndpoint()
getClusterReadEndpoint
in interface IDatabaseCluster
public java.lang.String getClusterResourceIdentifier()
for example: cluster-ABCD1234EFGH5678IJKL90MNOP. The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies.
public Connections getConnections()
getConnections
in interface IConnectable
public java.util.List<Endpoint> getInstanceEndpoints()
getInstanceEndpoints
in interface IDatabaseCluster
public java.util.List<java.lang.String> getInstanceIdentifiers()
getInstanceIdentifiers
in interface IDatabaseCluster
public java.lang.String getSecurityGroupId()
getSecurityGroupId
in interface IDatabaseCluster
public ISecret getSecret()