Interface DatabaseInstanceProps

All Superinterfaces:
DatabaseInstanceNewProps, DatabaseInstanceSourceProps, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
DatabaseInstanceProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:23.421Z") @Stability(Stable) public interface DatabaseInstanceProps extends software.amazon.jsii.JsiiSerializable, DatabaseInstanceSourceProps
Construction properties for a DatabaseInstance.

Example:

 IVpc vpc;
 DatabaseInstance instance1 = DatabaseInstance.Builder.create(this, "PostgresInstance1")
         .engine(DatabaseInstanceEngine.POSTGRES)
         // Generate the secret with admin username `postgres` and random password
         .credentials(Credentials.fromGeneratedSecret("postgres"))
         .vpc(vpc)
         .build();
 // Templated secret with username and password fields
 Secret templatedSecret = Secret.Builder.create(this, "TemplatedSecret")
         .generateSecretString(SecretStringGenerator.builder()
                 .secretStringTemplate(JSON.stringify(Map.of("username", "postgres")))
                 .generateStringKey("password")
                 .excludeCharacters("/@\"")
                 .build())
         .build();
 // Using the templated secret as credentials
 DatabaseInstance instance2 = DatabaseInstance.Builder.create(this, "PostgresInstance2")
         .engine(DatabaseInstanceEngine.POSTGRES)
         .credentials(Map.of(
                 "username", templatedSecret.secretValueFromJson("username").toString(),
                 "password", templatedSecret.secretValueFromJson("password")))
         .vpc(vpc)
         .build();
 
  • Method Details

    • getCharacterSetName

      @Stability(Stable) @Nullable default String getCharacterSetName()
      For supported engines, specifies the character set to associate with the DB instance.

      Default: - RDS default character set name

    • getCredentials

      @Stability(Stable) @Nullable default Credentials getCredentials()
      Credentials for the administrative user.

      Default: - A username of 'admin' (or 'postgres' for PostgreSQL) and SecretsManager-generated password

    • getStorageEncrypted

      @Stability(Stable) @Nullable default Boolean getStorageEncrypted()
      Indicates whether the DB instance is encrypted.

      Default: - true if storageEncryptionKey has been provided, false otherwise

    • getStorageEncryptionKey

      @Stability(Stable) @Nullable default IKey getStorageEncryptionKey()
      The KMS key that's used to encrypt the DB instance.

      Default: - default master key if storageEncrypted is true, no key otherwise

    • builder

      @Stability(Stable) static DatabaseInstanceProps.Builder builder()
      Returns:
      a DatabaseInstanceProps.Builder of DatabaseInstanceProps