Class DatabaseProxyProps.Builder

java.lang.Object
software.amazon.awscdk.services.rds.DatabaseProxyProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseProxyProps>
Enclosing interface:
DatabaseProxyProps

@Stability(Stable) public static final class DatabaseProxyProps.Builder extends Object implements software.amazon.jsii.Builder<DatabaseProxyProps>
A builder for DatabaseProxyProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • proxyTarget

      @Stability(Stable) public DatabaseProxyProps.Builder proxyTarget(ProxyTarget proxyTarget)
      Parameters:
      proxyTarget - DB proxy target: Instance or Cluster. This parameter is required.
      Returns:
      this
    • secrets

      @Stability(Stable) public DatabaseProxyProps.Builder secrets(List<? extends ISecret> secrets)
      Parameters:
      secrets - The secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB cluster. This parameter is required. These secrets are stored within Amazon Secrets Manager. One or more secrets are required.
      Returns:
      this
    • vpc

      @Stability(Stable) public DatabaseProxyProps.Builder vpc(IVpc vpc)
      Parameters:
      vpc - The VPC to associate with the new proxy. This parameter is required.
      Returns:
      this
    • borrowTimeout

      @Stability(Stable) public DatabaseProxyProps.Builder borrowTimeout(Duration borrowTimeout)
      Parameters:
      borrowTimeout - The duration for a proxy to wait for a connection to become available in the connection pool. Only applies when the proxy has opened its maximum number of connections and all connections are busy with client sessions.

      Value must be between 1 second and 1 hour, or Duration.seconds(0) to represent unlimited.

      Returns:
      this
    • clientPasswordAuthType

      @Stability(Stable) public DatabaseProxyProps.Builder clientPasswordAuthType(ClientPasswordAuthType clientPasswordAuthType)
      Parameters:
      clientPasswordAuthType - Specifies the details of authentication used by a proxy to log in as a specific database user.
      Returns:
      this
    • dbProxyName

      @Stability(Stable) public DatabaseProxyProps.Builder dbProxyName(String dbProxyName)
      Parameters:
      dbProxyName - The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens.
      Returns:
      this
    • debugLogging

      @Stability(Stable) public DatabaseProxyProps.Builder debugLogging(Boolean debugLogging)
      Parameters:
      debugLogging - Whether the proxy includes detailed information about SQL statements in its logs. This information helps you to debug issues involving SQL behavior or the performance and scalability of the proxy connections. The debug information includes the text of SQL statements that you submit through the proxy. Thus, only enable this setting when needed for debugging, and only when you have security measures in place to safeguard any sensitive information that appears in the logs.
      Returns:
      this
    • iamAuth

      @Stability(Stable) public DatabaseProxyProps.Builder iamAuth(Boolean iamAuth)
      Parameters:
      iamAuth - Whether to require or disallow AWS Identity and Access Management (IAM) authentication for connections to the proxy.
      Returns:
      this
    • idleClientTimeout

      @Stability(Stable) public DatabaseProxyProps.Builder idleClientTimeout(Duration idleClientTimeout)
      Parameters:
      idleClientTimeout - The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it. You can set this value higher or lower than the connection timeout limit for the associated database.
      Returns:
      this
    • initQuery

      @Stability(Stable) public DatabaseProxyProps.Builder initQuery(String initQuery)
      Parameters:
      initQuery - One or more SQL statements for the proxy to run when opening each new database connection. Typically used with SET statements to make sure that each connection has identical settings such as time zone and character set. For multiple statements, use semicolons as the separator. You can also include multiple variables in a single SET statement, such as SET x=1, y=2.

      not currently supported for PostgreSQL.

      Returns:
      this
    • maxConnectionsPercent

      @Stability(Stable) public DatabaseProxyProps.Builder maxConnectionsPercent(Number maxConnectionsPercent)
      Parameters:
      maxConnectionsPercent - The maximum size of the connection pool for each target in a target group. For Aurora MySQL, it is expressed as a percentage of the max_connections setting for the RDS DB instance or Aurora DB cluster used by the target group.

      1-100

      Returns:
      this
    • maxIdleConnectionsPercent

      @Stability(Stable) public DatabaseProxyProps.Builder maxIdleConnectionsPercent(Number maxIdleConnectionsPercent)
      Parameters:
      maxIdleConnectionsPercent - Controls how actively the proxy closes idle database connections in the connection pool. A high value enables the proxy to leave a high percentage of idle connections open. A low value causes the proxy to close idle client connections and return the underlying database connections to the connection pool. For Aurora MySQL, it is expressed as a percentage of the max_connections setting for the RDS DB instance or Aurora DB cluster used by the target group.

      between 0 and MaxConnectionsPercent

      Returns:
      this
    • requireTls

      @Stability(Stable) public DatabaseProxyProps.Builder requireTls(Boolean requireTls)
      Sets the value of
      invalid @link
      DatabaseProxyProps#getRequireTls
      Parameters:
      requireTls - A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. By enabling this setting, you can enforce encrypted TLS connections to the proxy.
      Returns:
      this
    • role

      @Stability(Stable) public DatabaseProxyProps.Builder role(IRole role)
      Parameters:
      role - IAM role that the proxy uses to access secrets in AWS Secrets Manager.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public DatabaseProxyProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      Parameters:
      securityGroups - One or more VPC security groups to associate with the new proxy.
      Returns:
      this
    • sessionPinningFilters

      @Stability(Stable) public DatabaseProxyProps.Builder sessionPinningFilters(List<? extends SessionPinningFilter> sessionPinningFilters)
      Parameters:
      sessionPinningFilters - Each item in the list represents a class of SQL operations that normally cause all later statements in a session using a proxy to be pinned to the same underlying database connection. Including an item in the list exempts that class of SQL operations from the pinning behavior.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public DatabaseProxyProps.Builder vpcSubnets(SubnetSelection vpcSubnets)
      Parameters:
      vpcSubnets - The subnets used by the proxy.
      Returns:
      this
    • build

      @Stability(Stable) public DatabaseProxyProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<DatabaseProxyProps>
      Returns:
      a new instance of DatabaseProxyProps
      Throws:
      NullPointerException - if any required attribute was not provided