Class DatabaseProxy

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.rds.DatabaseProxy
All Implemented Interfaces:
IResource, IConnectable, IDatabaseProxy, ISecretAttachmentTarget, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:23.444Z") @Stability(Stable) public class DatabaseProxy extends Resource implements IConnectable, ISecretAttachmentTarget, IDatabaseProxy
RDS Database Proxy.

Example:

 Vpc vpc;
 DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database")
         .engine(DatabaseClusterEngine.auroraMysql(AuroraMysqlClusterEngineProps.builder()
                 .version(AuroraMysqlEngineVersion.VER_3_03_0)
                 .build()))
         .writer(ClusterInstance.provisioned("writer"))
         .vpc(vpc)
         .build();
 DatabaseProxy proxy = DatabaseProxy.Builder.create(this, "Proxy")
         .proxyTarget(ProxyTarget.fromCluster(cluster))
         .secrets(List.of(cluster.getSecret()))
         .vpc(vpc)
         .clientPasswordAuthType(ClientPasswordAuthType.MYSQL_NATIVE_PASSWORD)
         .build();
 
  • Constructor Details

    • DatabaseProxy

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

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

      @Stability(Stable) public DatabaseProxy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseProxyProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromDatabaseProxyAttributes

      @Stability(Stable) @NotNull public static IDatabaseProxy fromDatabaseProxyAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseProxyAttributes attrs)
      Import an existing database proxy.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • asSecretAttachmentTarget

      @Stability(Stable) @NotNull public SecretAttachmentTargetProps asSecretAttachmentTarget()
      Renders the secret attachment target specifications.
      Specified by:
      asSecretAttachmentTarget in interface ISecretAttachmentTarget
    • grantConnect

      @Stability(Stable) @NotNull public Grant grantConnect(@NotNull IGrantable grantee, @Nullable String dbUser)
      Grant the given identity connection access to the proxy.

      Specified by:
      grantConnect in interface IDatabaseProxy
      Parameters:
      grantee - This parameter is required.
      dbUser -
    • grantConnect

      @Stability(Stable) @NotNull public Grant grantConnect(@NotNull IGrantable grantee)
      Grant the given identity connection access to the proxy.

      Specified by:
      grantConnect in interface IDatabaseProxy
      Parameters:
      grantee - This parameter is required.
    • getConnections

      @Stability(Stable) @NotNull public Connections getConnections()
      Access to network connections.
      Specified by:
      getConnections in interface IConnectable
    • getDbProxyArn

      @Stability(Stable) @NotNull public String getDbProxyArn()
      DB Proxy ARN.
      Specified by:
      getDbProxyArn in interface IDatabaseProxy
    • getDbProxyName

      @Stability(Stable) @NotNull public String getDbProxyName()
      DB Proxy Name.
      Specified by:
      getDbProxyName in interface IDatabaseProxy
    • getEndpoint

      @Stability(Stable) @NotNull public String getEndpoint()
      Endpoint.
      Specified by:
      getEndpoint in interface IDatabaseProxy