Class DatabaseCluster
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.rds.DatabaseClusterBase
software.amazon.awscdk.services.rds.DatabaseCluster
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IConnectable
,IDatabaseCluster
,ISecretAttachmentTarget
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:49.089Z")
@Stability(Stable)
public class DatabaseCluster
extends DatabaseClusterBase
Create a clustered database with a given number of instances.
Example:
Vpc vpc; DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database") .engine(DatabaseClusterEngine.AURORA) .instanceProps(InstanceProps.builder().vpc(vpc).build()) .build(); DatabaseProxy proxy = DatabaseProxy.Builder.create(this, "Proxy") .proxyTarget(ProxyTarget.fromCluster(cluster)) .secrets(List.of(cluster.getSecret())) .vpc(vpc) .build(); Role role = Role.Builder.create(this, "DBProxyRole").assumedBy(new AccountPrincipal(this.account)).build(); proxy.grantConnect(role, "admin");
-
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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.rds.IDatabaseCluster
IDatabaseCluster.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
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.Adds the single user rotation of the master password to this cluster.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.Access to the network connections.The engine for this Cluster.Endpoints which address each individual replica.Identifiers of the replicas.Application for multi user rotation to this cluster.protected CfnDBClusterProps
The secret attached to this cluster.protected List<ISecurityGroup>
Application for single user rotation of the master password to this cluster.protected ISubnetGroup
getVpc()
The VPC network to place the cluster in.The cluster's subnets.Methods inherited from class software.amazon.awscdk.services.rds.DatabaseClusterBase
addProxy, asSecretAttachmentTarget, metric, metric, metricCPUUtilization, metricCPUUtilization, metricDatabaseConnections, metricDatabaseConnections, metricDeadlocks, metricDeadlocks, metricEngineUptime, metricEngineUptime, metricFreeableMemory, metricFreeableMemory, metricFreeLocalStorage, metricFreeLocalStorage, metricNetworkReceiveThroughput, metricNetworkReceiveThroughput, metricNetworkThroughput, metricNetworkThroughput, metricNetworkTransmitThroughput, metricNetworkTransmitThroughput, metricSnapshotStorageUsed, metricSnapshotStorageUsed, metricTotalBackupStorageBilled, metricTotalBackupStorageBilled, metricVolumeBytesUsed, metricVolumeBytesUsed, metricVolumeReadIOPs, metricVolumeReadIOPs, metricVolumeWriteIOPs, metricVolumeWriteIOPs
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
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.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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 RotationSingleUserOptions options) Adds the single user rotation of the master password to this cluster.- Parameters:
options
-
-
addRotationSingleUser
Adds the single user rotation of the master password to this cluster. -
getClusterEndpoint
The endpoint to use for read/write operations.- Specified by:
getClusterEndpoint
in interfaceIDatabaseCluster
- Specified by:
getClusterEndpoint
in classDatabaseClusterBase
-
getClusterIdentifier
Identifier of the cluster.- Specified by:
getClusterIdentifier
in interfaceIDatabaseCluster
- Specified by:
getClusterIdentifier
in classDatabaseClusterBase
-
getClusterReadEndpoint
Endpoint to use for load-balanced read-only operations.- Specified by:
getClusterReadEndpoint
in interfaceIDatabaseCluster
- Specified by:
getClusterReadEndpoint
in classDatabaseClusterBase
-
getConnections
Access to the network connections.- Specified by:
getConnections
in interfaceIConnectable
- Specified by:
getConnections
in classDatabaseClusterBase
-
getInstanceEndpoints
Endpoints which address each individual replica.- Specified by:
getInstanceEndpoints
in interfaceIDatabaseCluster
- Specified by:
getInstanceEndpoints
in classDatabaseClusterBase
-
getInstanceIdentifiers
Identifiers of the replicas.- Specified by:
getInstanceIdentifiers
in interfaceIDatabaseCluster
- Specified by:
getInstanceIdentifiers
in classDatabaseClusterBase
-
getMultiUserRotationApplication
Application for multi user rotation to this cluster. -
getNewCfnProps
-
getSecurityGroups
-
getSingleUserRotationApplication
Application for single user rotation of the master password to this cluster. -
getSubnetGroup
-
getVpc
The VPC network to place the cluster in. -
getEngine
The engine for this Cluster.Never undefined.
- Specified by:
getEngine
in interfaceIDatabaseCluster
- Specified by:
getEngine
in classDatabaseClusterBase
-
getSecret
The secret attached to this cluster. -
getVpcSubnets
The cluster's subnets.
-