Class DatabaseProxyOptions
Options for a new DatabaseProxy.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DatabaseProxyOptions : Object, IDatabaseProxyOptions
Syntax (vb)
Public Class DatabaseProxyOptions
Inherits Object
Implements IDatabaseProxyOptions
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
SecurityGroup securityGroup;
Secret[] secrets;
DatabaseInstance dbInstance;
var proxy = dbInstance.AddProxy("proxy", new DatabaseProxyOptions {
BorrowTimeout = Duration.Seconds(30),
MaxConnectionsPercent = 50,
Secrets = secrets,
Vpc = vpc
});
Synopsis
Constructors
DatabaseProxyOptions() |
Properties
BorrowTimeout | The duration for a proxy to wait for a connection to become available in the connection pool. |
ClientPasswordAuthType | Specifies the details of authentication used by a proxy to log in as a specific database user. |
DbProxyName | The identifier for the proxy. |
DebugLogging | Whether the proxy includes detailed information about SQL statements in its logs. |
IamAuth | Whether to require or disallow AWS Identity and Access Management (IAM) authentication for connections to the proxy. |
IdleClientTimeout | The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it. |
InitQuery | One or more SQL statements for the proxy to run when opening each new database connection. |
MaxConnectionsPercent | The maximum size of the connection pool for each target in a target group. |
MaxIdleConnectionsPercent | Controls how actively the proxy closes idle database connections in the connection pool. |
RequireTLS | A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. |
Role | IAM role that the proxy uses to access secrets in AWS Secrets Manager. |
Secrets | The secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB cluster. |
SecurityGroups | One or more VPC security groups to associate with the new proxy. |
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. |
Vpc | The VPC to associate with the new proxy. |
VpcSubnets | The subnets used by the proxy. |
Constructors
DatabaseProxyOptions()
public DatabaseProxyOptions()
Properties
BorrowTimeout
The duration for a proxy to wait for a connection to become available in the connection pool.
public Duration BorrowTimeout { get; set; }
Property Value
Remarks
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)
ClientPasswordAuthType
Specifies the details of authentication used by a proxy to log in as a specific database user.
public Nullable<ClientPasswordAuthType> ClientPasswordAuthType { get; set; }
Property Value
System.Nullable<ClientPasswordAuthType>
Remarks
Default: - CloudFormation defaults will apply given the specified database engine.
DbProxyName
The identifier for the proxy.
public string DbProxyName { get; set; }
Property Value
System.String
Remarks
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)
DebugLogging
Whether the proxy includes detailed information about SQL statements in its logs.
public Nullable<bool> DebugLogging { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
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
IamAuth
Whether to require or disallow AWS Identity and Access Management (IAM) authentication for connections to the proxy.
public Nullable<bool> IamAuth { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
IdleClientTimeout
The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it.
public Duration IdleClientTimeout { get; set; }
Property Value
Remarks
You can set this value higher or lower than the connection timeout limit for the associated database.
Default: cdk.Duration.minutes(30)
InitQuery
One or more SQL statements for the proxy to run when opening each new database connection.
public string InitQuery { get; set; }
Property Value
System.String
Remarks
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
MaxConnectionsPercent
The maximum size of the connection pool for each target in a target group.
public Nullable<double> MaxConnectionsPercent { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
MaxIdleConnectionsPercent
Controls how actively the proxy closes idle database connections in the connection pool.
public Nullable<double> MaxIdleConnectionsPercent { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
RequireTLS
A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy.
public Nullable<bool> RequireTLS { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
By enabling this setting, you can enforce encrypted TLS connections to the proxy.
Default: true
Role
IAM role that the proxy uses to access secrets in AWS Secrets Manager.
public IRole Role { get; set; }
Property Value
Remarks
Default: - A role will automatically be created
Secrets
The secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB cluster.
public ISecret[] Secrets { get; set; }
Property Value
ISecret[]
Remarks
These secrets are stored within Amazon Secrets Manager. One or more secrets are required.
SecurityGroups
One or more VPC security groups to associate with the new proxy.
public ISecurityGroup[] SecurityGroups { get; set; }
Property Value
Remarks
Default: - No security groups
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.
public SessionPinningFilter[] SessionPinningFilters { get; set; }
Property Value
Remarks
Including an item in the list exempts that class of SQL operations from the pinning behavior.
Default: - no session pinning filters
Vpc
VpcSubnets
The subnets used by the proxy.
public ISubnetSelection VpcSubnets { get; set; }
Property Value
Remarks
Default: - the VPC default strategy if not specified.