Class DatabaseCluster

java.lang.Object
software.amazon.jsii.JsiiObject
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");
 
  • 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