tech.condense.cdkconstructs.AuroraClusterProps Maven / Gradle / Ivy
Show all versions of cdkconstructs Show documentation
package tech.condense.cdkconstructs;
/**
* (experimental) Properties for the AuroraCluster construct.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-02T10:45:59.984Z")
@software.amazon.jsii.Jsii(module = tech.condense.cdkconstructs.$Module.class, fqn = "@condensetech/cdk-constructs.AuroraClusterProps")
@software.amazon.jsii.Jsii.Proxy(AuroraClusterProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface AuroraClusterProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The engine of the Aurora cluster.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.rds.IClusterEngine getEngine();
/**
* (experimental) The networking configuration for the Aurora cluster.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull tech.condense.cdkconstructs.INetworking getNetworking();
/**
* (experimental) The backup retention period.
*
* Default: - It uses the default applied by [rds.DatabaseClusterProps#backup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rds.DatabaseClusterProps.html#backup).
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getBackupRetention() {
return null;
}
/**
* (experimental) The identifier of the cluster.
*
* If not specified, it relies on the underlying default naming.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getClusterIdentifier() {
return null;
}
/**
* (experimental) The name of the secret that stores the credentials of the database.
*
* Default: `${construct.node.path}/secret`
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getCredentialsSecretName() {
return null;
}
/**
* (experimental) The username of the database.
*
* Default: db_user
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getCredentialsUsername() {
return null;
}
/**
* (experimental) The name of the database.
*
* Default: - No default database is created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getDatabaseName() {
return null;
}
/**
* (experimental) The parameters to override in the parameter group.
*
* Default: - No parameter is overridden.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getParameters() {
return null;
}
/**
* (experimental) The reader instances of the Aurora cluster.
*
* Default: - No reader instances are created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getReaders() {
return null;
}
/**
* (experimental) The removal policy to apply when the cluster is removed.
*
* Default: RemovalPolicy.RETAIN
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.RemovalPolicy getRemovalPolicy() {
return null;
}
/**
* (experimental) The name of the security group.
*
* Default: - `${construct.node.path}-sg`.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getSecurityGroupName() {
return null;
}
/**
* (experimental) The writer instance of the Aurora cluster.
*
* Default: - A provisioned instance with the minimum instance type based on the engine type.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.rds.IClusterInstance getWriter() {
return null;
}
/**
* @return a {@link Builder} of {@link AuroraClusterProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AuroraClusterProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.rds.IClusterEngine engine;
tech.condense.cdkconstructs.INetworking networking;
software.amazon.awscdk.Duration backupRetention;
java.lang.String clusterIdentifier;
java.lang.String credentialsSecretName;
java.lang.String credentialsUsername;
java.lang.String databaseName;
java.util.Map parameters;
java.util.List readers;
software.amazon.awscdk.RemovalPolicy removalPolicy;
java.lang.String securityGroupName;
software.amazon.awscdk.services.rds.IClusterInstance writer;
/**
* Sets the value of {@link AuroraClusterProps#getEngine}
* @param engine The engine of the Aurora cluster. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder engine(software.amazon.awscdk.services.rds.IClusterEngine engine) {
this.engine = engine;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getNetworking}
* @param networking The networking configuration for the Aurora cluster. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder networking(tech.condense.cdkconstructs.INetworking networking) {
this.networking = networking;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getBackupRetention}
* @param backupRetention The backup retention period.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder backupRetention(software.amazon.awscdk.Duration backupRetention) {
this.backupRetention = backupRetention;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getClusterIdentifier}
* @param clusterIdentifier The identifier of the cluster.
* If not specified, it relies on the underlying default naming.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder clusterIdentifier(java.lang.String clusterIdentifier) {
this.clusterIdentifier = clusterIdentifier;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getCredentialsSecretName}
* @param credentialsSecretName The name of the secret that stores the credentials of the database.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder credentialsSecretName(java.lang.String credentialsSecretName) {
this.credentialsSecretName = credentialsSecretName;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getCredentialsUsername}
* @param credentialsUsername The username of the database.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder credentialsUsername(java.lang.String credentialsUsername) {
this.credentialsUsername = credentialsUsername;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getDatabaseName}
* @param databaseName The name of the database.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder databaseName(java.lang.String databaseName) {
this.databaseName = databaseName;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getParameters}
* @param parameters The parameters to override in the parameter group.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parameters(java.util.Map parameters) {
this.parameters = parameters;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getReaders}
* @param readers The reader instances of the Aurora cluster.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder readers(java.util.List extends software.amazon.awscdk.services.rds.IClusterInstance> readers) {
this.readers = (java.util.List)readers;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getRemovalPolicy}
* @param removalPolicy The removal policy to apply when the cluster is removed.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder removalPolicy(software.amazon.awscdk.RemovalPolicy removalPolicy) {
this.removalPolicy = removalPolicy;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getSecurityGroupName}
* @param securityGroupName The name of the security group.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder securityGroupName(java.lang.String securityGroupName) {
this.securityGroupName = securityGroupName;
return this;
}
/**
* Sets the value of {@link AuroraClusterProps#getWriter}
* @param writer The writer instance of the Aurora cluster.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder writer(software.amazon.awscdk.services.rds.IClusterInstance writer) {
this.writer = writer;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AuroraClusterProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public AuroraClusterProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AuroraClusterProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AuroraClusterProps {
private final software.amazon.awscdk.services.rds.IClusterEngine engine;
private final tech.condense.cdkconstructs.INetworking networking;
private final software.amazon.awscdk.Duration backupRetention;
private final java.lang.String clusterIdentifier;
private final java.lang.String credentialsSecretName;
private final java.lang.String credentialsUsername;
private final java.lang.String databaseName;
private final java.util.Map parameters;
private final java.util.List readers;
private final software.amazon.awscdk.RemovalPolicy removalPolicy;
private final java.lang.String securityGroupName;
private final software.amazon.awscdk.services.rds.IClusterInstance writer;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.engine = software.amazon.jsii.Kernel.get(this, "engine", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.rds.IClusterEngine.class));
this.networking = software.amazon.jsii.Kernel.get(this, "networking", software.amazon.jsii.NativeType.forClass(tech.condense.cdkconstructs.INetworking.class));
this.backupRetention = software.amazon.jsii.Kernel.get(this, "backupRetention", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.clusterIdentifier = software.amazon.jsii.Kernel.get(this, "clusterIdentifier", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.credentialsSecretName = software.amazon.jsii.Kernel.get(this, "credentialsSecretName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.credentialsUsername = software.amazon.jsii.Kernel.get(this, "credentialsUsername", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.databaseName = software.amazon.jsii.Kernel.get(this, "databaseName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.parameters = software.amazon.jsii.Kernel.get(this, "parameters", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.readers = software.amazon.jsii.Kernel.get(this, "readers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.rds.IClusterInstance.class)));
this.removalPolicy = software.amazon.jsii.Kernel.get(this, "removalPolicy", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.RemovalPolicy.class));
this.securityGroupName = software.amazon.jsii.Kernel.get(this, "securityGroupName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.writer = software.amazon.jsii.Kernel.get(this, "writer", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.rds.IClusterInstance.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.engine = java.util.Objects.requireNonNull(builder.engine, "engine is required");
this.networking = java.util.Objects.requireNonNull(builder.networking, "networking is required");
this.backupRetention = builder.backupRetention;
this.clusterIdentifier = builder.clusterIdentifier;
this.credentialsSecretName = builder.credentialsSecretName;
this.credentialsUsername = builder.credentialsUsername;
this.databaseName = builder.databaseName;
this.parameters = builder.parameters;
this.readers = (java.util.List)builder.readers;
this.removalPolicy = builder.removalPolicy;
this.securityGroupName = builder.securityGroupName;
this.writer = builder.writer;
}
@Override
public final software.amazon.awscdk.services.rds.IClusterEngine getEngine() {
return this.engine;
}
@Override
public final tech.condense.cdkconstructs.INetworking getNetworking() {
return this.networking;
}
@Override
public final software.amazon.awscdk.Duration getBackupRetention() {
return this.backupRetention;
}
@Override
public final java.lang.String getClusterIdentifier() {
return this.clusterIdentifier;
}
@Override
public final java.lang.String getCredentialsSecretName() {
return this.credentialsSecretName;
}
@Override
public final java.lang.String getCredentialsUsername() {
return this.credentialsUsername;
}
@Override
public final java.lang.String getDatabaseName() {
return this.databaseName;
}
@Override
public final java.util.Map getParameters() {
return this.parameters;
}
@Override
public final java.util.List getReaders() {
return this.readers;
}
@Override
public final software.amazon.awscdk.RemovalPolicy getRemovalPolicy() {
return this.removalPolicy;
}
@Override
public final java.lang.String getSecurityGroupName() {
return this.securityGroupName;
}
@Override
public final software.amazon.awscdk.services.rds.IClusterInstance getWriter() {
return this.writer;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("engine", om.valueToTree(this.getEngine()));
data.set("networking", om.valueToTree(this.getNetworking()));
if (this.getBackupRetention() != null) {
data.set("backupRetention", om.valueToTree(this.getBackupRetention()));
}
if (this.getClusterIdentifier() != null) {
data.set("clusterIdentifier", om.valueToTree(this.getClusterIdentifier()));
}
if (this.getCredentialsSecretName() != null) {
data.set("credentialsSecretName", om.valueToTree(this.getCredentialsSecretName()));
}
if (this.getCredentialsUsername() != null) {
data.set("credentialsUsername", om.valueToTree(this.getCredentialsUsername()));
}
if (this.getDatabaseName() != null) {
data.set("databaseName", om.valueToTree(this.getDatabaseName()));
}
if (this.getParameters() != null) {
data.set("parameters", om.valueToTree(this.getParameters()));
}
if (this.getReaders() != null) {
data.set("readers", om.valueToTree(this.getReaders()));
}
if (this.getRemovalPolicy() != null) {
data.set("removalPolicy", om.valueToTree(this.getRemovalPolicy()));
}
if (this.getSecurityGroupName() != null) {
data.set("securityGroupName", om.valueToTree(this.getSecurityGroupName()));
}
if (this.getWriter() != null) {
data.set("writer", om.valueToTree(this.getWriter()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@condensetech/cdk-constructs.AuroraClusterProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AuroraClusterProps.Jsii$Proxy that = (AuroraClusterProps.Jsii$Proxy) o;
if (!engine.equals(that.engine)) return false;
if (!networking.equals(that.networking)) return false;
if (this.backupRetention != null ? !this.backupRetention.equals(that.backupRetention) : that.backupRetention != null) return false;
if (this.clusterIdentifier != null ? !this.clusterIdentifier.equals(that.clusterIdentifier) : that.clusterIdentifier != null) return false;
if (this.credentialsSecretName != null ? !this.credentialsSecretName.equals(that.credentialsSecretName) : that.credentialsSecretName != null) return false;
if (this.credentialsUsername != null ? !this.credentialsUsername.equals(that.credentialsUsername) : that.credentialsUsername != null) return false;
if (this.databaseName != null ? !this.databaseName.equals(that.databaseName) : that.databaseName != null) return false;
if (this.parameters != null ? !this.parameters.equals(that.parameters) : that.parameters != null) return false;
if (this.readers != null ? !this.readers.equals(that.readers) : that.readers != null) return false;
if (this.removalPolicy != null ? !this.removalPolicy.equals(that.removalPolicy) : that.removalPolicy != null) return false;
if (this.securityGroupName != null ? !this.securityGroupName.equals(that.securityGroupName) : that.securityGroupName != null) return false;
return this.writer != null ? this.writer.equals(that.writer) : that.writer == null;
}
@Override
public final int hashCode() {
int result = this.engine.hashCode();
result = 31 * result + (this.networking.hashCode());
result = 31 * result + (this.backupRetention != null ? this.backupRetention.hashCode() : 0);
result = 31 * result + (this.clusterIdentifier != null ? this.clusterIdentifier.hashCode() : 0);
result = 31 * result + (this.credentialsSecretName != null ? this.credentialsSecretName.hashCode() : 0);
result = 31 * result + (this.credentialsUsername != null ? this.credentialsUsername.hashCode() : 0);
result = 31 * result + (this.databaseName != null ? this.databaseName.hashCode() : 0);
result = 31 * result + (this.parameters != null ? this.parameters.hashCode() : 0);
result = 31 * result + (this.readers != null ? this.readers.hashCode() : 0);
result = 31 * result + (this.removalPolicy != null ? this.removalPolicy.hashCode() : 0);
result = 31 * result + (this.securityGroupName != null ? this.securityGroupName.hashCode() : 0);
result = 31 * result + (this.writer != null ? this.writer.hashCode() : 0);
return result;
}
}
}