@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.020Z") @Stability(value=Stable) 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.MEMORY5, 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. |
software.amazon.jsii.JsiiObject.InitializationModeIDatabaseCluster.Jsii$Default, IDatabaseCluster.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static Number |
DEFAULT_NUM_INSTANCES
The default number of instances in the DocDB cluster if none are specified.
|
static Number |
DEFAULT_PORT
The default port Document DB listens on.
|
| Modifier | Constructor and Description |
|---|---|
|
DatabaseCluster(software.constructs.Construct scope,
String id,
DatabaseClusterProps props) |
protected |
DatabaseCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
DatabaseCluster(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
SecretRotation |
addRotationMultiUser(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,
String id,
DatabaseClusterAttributes attrs)
Import an existing DatabaseCluster from properties.
|
Endpoint |
getClusterEndpoint()
The endpoint to use for read/write operations.
|
String |
getClusterIdentifier()
Identifier of the cluster.
|
Endpoint |
getClusterReadEndpoint()
Endpoint to use for load-balanced read-only operations.
|
String |
getClusterResourceIdentifier()
The resource id for the cluster;
|
Connections |
getConnections()
The connections object to implement IConnectable.
|
List<Endpoint> |
getInstanceEndpoints()
Endpoints which address each individual replica.
|
List<String> |
getInstanceIdentifiers()
Identifiers of the replicas.
|
ISecret |
getSecret()
The secret attached to this cluster.
|
String |
getSecurityGroupId()
Security group identifier of this database.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStack@Stability(value=Stable) public static final Number DEFAULT_NUM_INSTANCES
@Stability(value=Stable) public static final Number DEFAULT_PORT
protected DatabaseCluster(software.amazon.jsii.JsiiObjectRef objRef)
protected DatabaseCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public DatabaseCluster(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
DatabaseClusterProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public static IDatabaseCluster fromDatabaseClusterAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseClusterAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Stable) @NotNull public SecretRotation addRotationMultiUser(@NotNull String id, @NotNull RotationMultiUserOptions options)
id - This parameter is required.options - This parameter is required.@Stability(value=Stable) @NotNull public SecretRotation addRotationSingleUser(@Nullable Duration automaticallyAfter)
automaticallyAfter - Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.@Stability(value=Stable) @NotNull public SecretRotation addRotationSingleUser()
@Stability(value=Stable)
public void addSecurityGroups(@NotNull
ISecurityGroup... securityGroups)
securityGroups - The security groups to add. This parameter is required.@Stability(value=Stable) @NotNull public SecretAttachmentTargetProps asSecretAttachmentTarget()
asSecretAttachmentTarget in interface ISecretAttachmentTarget@Stability(value=Stable) @NotNull public Endpoint getClusterEndpoint()
getClusterEndpoint in interface IDatabaseCluster@Stability(value=Stable) @NotNull public String getClusterIdentifier()
getClusterIdentifier in interface IDatabaseCluster@Stability(value=Stable) @NotNull public Endpoint getClusterReadEndpoint()
getClusterReadEndpoint in interface IDatabaseCluster@Stability(value=Stable) @NotNull public String getClusterResourceIdentifier()
for example: cluster-ABCD1234EFGH5678IJKL90MNOP. The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies.
@Stability(value=Stable) @NotNull public Connections getConnections()
getConnections in interface IConnectable@Stability(value=Stable) @NotNull public List<Endpoint> getInstanceEndpoints()
getInstanceEndpoints in interface IDatabaseCluster@Stability(value=Stable) @NotNull public List<String> getInstanceIdentifiers()
getInstanceIdentifiers in interface IDatabaseCluster@Stability(value=Stable) @NotNull public String getSecurityGroupId()
getSecurityGroupId in interface IDatabaseCluster@Stability(value=Stable) @Nullable public ISecret getSecret()
Copyright © 2022. All rights reserved.