@Stability(value=Stable) public static final class DatabaseProxy.Builder extends Object implements software.amazon.jsii.Builder<DatabaseProxy>
DatabaseProxy.| Modifier and Type | Method and Description |
|---|---|
DatabaseProxy.Builder |
borrowTimeout(Duration borrowTimeout)
The duration for a proxy to wait for a connection to become available in the connection pool.
|
DatabaseProxy |
build() |
static DatabaseProxy.Builder |
create(software.constructs.Construct scope,
String id) |
DatabaseProxy.Builder |
dbProxyName(String dbProxyName)
The identifier for the proxy.
|
DatabaseProxy.Builder |
debugLogging(Boolean debugLogging)
Whether the proxy includes detailed information about SQL statements in its logs.
|
DatabaseProxy.Builder |
iamAuth(Boolean iamAuth)
Whether to require or disallow AWS Identity and Access Management (IAM) authentication for connections to the proxy.
|
DatabaseProxy.Builder |
idleClientTimeout(Duration idleClientTimeout)
The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it.
|
DatabaseProxy.Builder |
initQuery(String initQuery)
One or more SQL statements for the proxy to run when opening each new database connection.
|
DatabaseProxy.Builder |
maxConnectionsPercent(Number maxConnectionsPercent)
The maximum size of the connection pool for each target in a target group.
|
DatabaseProxy.Builder |
maxIdleConnectionsPercent(Number maxIdleConnectionsPercent)
Controls how actively the proxy closes idle database connections in the connection pool.
|
DatabaseProxy.Builder |
proxyTarget(ProxyTarget proxyTarget)
DB proxy target: Instance or Cluster.
|
DatabaseProxy.Builder |
requireTls(Boolean requireTls)
A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy.
|
DatabaseProxy.Builder |
role(IRole role)
IAM role that the proxy uses to access secrets in AWS Secrets Manager.
|
DatabaseProxy.Builder |
secrets(List<? extends ISecret> secrets)
The secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB cluster.
|
DatabaseProxy.Builder |
securityGroups(List<? extends ISecurityGroup> securityGroups)
One or more VPC security groups to associate with the new proxy.
|
DatabaseProxy.Builder |
sessionPinningFilters(List<? extends SessionPinningFilter> 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.
|
DatabaseProxy.Builder |
vpc(IVpc vpc)
The VPC to associate with the new proxy.
|
DatabaseProxy.Builder |
vpcSubnets(SubnetSelection vpcSubnets)
The subnets used by the proxy.
|
@Stability(value=Stable) public static DatabaseProxy.Builder create(software.constructs.Construct scope, String id)
scope - This parameter is required.id - This parameter is required.DatabaseProxy.Builder.@Stability(value=Stable) public DatabaseProxy.Builder secrets(List<? extends ISecret> secrets)
These secrets are stored within Amazon Secrets Manager. One or more secrets are required.
secrets - The secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB cluster. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder vpc(IVpc vpc)
vpc - The VPC to associate with the new proxy. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder borrowTimeout(Duration borrowTimeout)
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.
Default: cdk.Duration.seconds(120)
borrowTimeout - The duration for a proxy to wait for a connection to become available in the connection pool. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder dbProxyName(String dbProxyName)
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.
Default: - Generated by CloudFormation (recommended)
dbProxyName - The identifier for the proxy. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder debugLogging(Boolean debugLogging)
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.
Default: false
debugLogging - Whether the proxy includes detailed information about SQL statements in its logs. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder iamAuth(Boolean iamAuth)
Default: false
iamAuth - Whether to require or disallow AWS Identity and Access Management (IAM) authentication for connections to the proxy. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder idleClientTimeout(Duration idleClientTimeout)
You can set this value higher or lower than the connection timeout limit for the associated database.
Default: cdk.Duration.minutes(30)
idleClientTimeout - The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder initQuery(String initQuery)
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.
Default: - no initialization query
initQuery - One or more SQL statements for the proxy to run when opening each new database connection. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder maxConnectionsPercent(Number maxConnectionsPercent)
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
Default: 100
maxConnectionsPercent - The maximum size of the connection pool for each target in a target group. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder maxIdleConnectionsPercent(Number maxIdleConnectionsPercent)
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
Default: 50
maxIdleConnectionsPercent - Controls how actively the proxy closes idle database connections in the connection pool. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder requireTls(Boolean requireTls)
By enabling this setting, you can enforce encrypted TLS connections to the proxy.
Default: true
requireTls - A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder role(IRole role)
Default: - A role will automatically be created
role - IAM role that the proxy uses to access secrets in AWS Secrets Manager. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
Default: - No security groups
securityGroups - One or more VPC security groups to associate with the new proxy. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder sessionPinningFilters(List<? extends SessionPinningFilter> sessionPinningFilters)
Including an item in the list exempts that class of SQL operations from the pinning behavior.
Default: - no session pinning filters
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. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder vpcSubnets(SubnetSelection vpcSubnets)
Default: - the VPC default strategy if not specified.
vpcSubnets - The subnets used by the proxy. This parameter is required.this@Stability(value=Stable) public DatabaseProxy.Builder proxyTarget(ProxyTarget proxyTarget)
proxyTarget - DB proxy target: Instance or Cluster. This parameter is required.this@Stability(value=Stable) public DatabaseProxy build()
build in interface software.amazon.jsii.Builder<DatabaseProxy>Copyright © 2022. All rights reserved.