Class DatabaseSecret

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IResource, ISecret, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.172Z") @Stability(Stable) public class DatabaseSecret extends Secret
A database secret.

Example:

 DatabaseInstance instance;
 DatabaseSecret myUserSecret = DatabaseSecret.Builder.create(this, "MyUserSecret")
         .username("myuser")
         .secretName("my-user-secret") // optional, defaults to a CloudFormation-generated name
         .masterSecret(instance.getSecret())
         .excludeCharacters("{}[]()'\"/\\")
         .build();
 ISecret myUserSecretAttached = myUserSecret.attach(instance); // Adds DB connections information in the secret
 instance.addRotationMultiUser("MyUser", RotationMultiUserOptions.builder() // Add rotation using the multi user scheme
         .secret(myUserSecretAttached).build());
 
  • Constructor Details

    • DatabaseSecret

      protected DatabaseSecret(software.amazon.jsii.JsiiObjectRef objRef)
    • DatabaseSecret

      protected DatabaseSecret(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • DatabaseSecret

      @Stability(Stable) public DatabaseSecret(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseSecretProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.