createDBProxy method
- required String dBProxyName,
- required EngineFamily engineFamily,
- required String roleArn,
- required List<
String> vpcSubnetIds, - List<
UserAuthConfig> ? auth, - bool? debugLogging,
- DefaultAuthScheme? defaultAuthScheme,
- EndpointNetworkType? endpointNetworkType,
- int? idleClientTimeout,
- bool? requireTLS,
- List<
Tag> ? tags, - TargetConnectionNetworkType? targetConnectionNetworkType,
- List<
String> ? vpcSecurityGroupIds,
Creates a new DB proxy.
May throw DBProxyAlreadyExistsFault.
May throw DBProxyQuotaExceededFault.
May throw InvalidSubnet.
Parameter dBProxyName :
The identifier for the proxy. This name must be unique for all proxies
owned by your Amazon Web Services account in the specified Amazon Web
Services 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.
Parameter engineFamily :
The kinds of databases that the proxy can connect to. This value
determines which database network protocol the proxy recognizes when it
interprets network traffic to and from the database. For Aurora MySQL, RDS
for MariaDB, and RDS for MySQL databases, specify MYSQL. For
Aurora PostgreSQL and RDS for PostgreSQL databases, specify
POSTGRESQL. For RDS for Microsoft SQL Server, specify
SQLSERVER.
Parameter roleArn :
The Amazon Resource Name (ARN) of the IAM role that the proxy uses to
access secrets in Amazon Web Services Secrets Manager.
Parameter vpcSubnetIds :
One or more VPC subnet IDs to associate with the new proxy.
Parameter auth :
The authorization mechanism that the proxy uses.
Parameter debugLogging :
Specifies whether the proxy logs detailed connection and query
information. When you enable DebugLogging, the proxy captures
connection details and connection pool behavior from your queries. Debug
logging increases CloudWatch costs and can impact proxy performance.
Enable this option only when you need to troubleshoot connection or
performance issues.
Parameter defaultAuthScheme :
The default authentication scheme that the proxy uses for client
connections to the proxy and connections from the proxy to the underlying
database. Valid values are NONE and IAM_AUTH.
When set to IAM_AUTH, the proxy uses end-to-end IAM
authentication to connect to the database. If you don't specify
DefaultAuthScheme or specify this parameter as
NONE, you must specify the Auth option.
Parameter endpointNetworkType :
The network type of the DB proxy endpoint. The network type determines the
IP version that the proxy endpoint supports.
Valid values:
-
IPV4- The proxy endpoint supports IPv4 only. -
IPV6- The proxy endpoint supports IPv6 only. -
DUAL- The proxy endpoint supports both IPv4 and IPv6.
IPV4
Constraints:
-
If you specify
IPV6orDUAL, the VPC and all subnets must have an IPv6 CIDR block. -
If you specify
IPV6orDUAL, the VPC tenancy cannot bededicated.
Parameter 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.
Parameter requireTLS :
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.
Parameter tags :
An optional set of key-value pairs to associate arbitrary data of your
choosing with the proxy.
Parameter targetConnectionNetworkType :
The network type that the proxy uses to connect to the target database.
The network type determines the IP version that the proxy uses for
connections to the database.
Valid values:
-
IPV4- The proxy connects to the database using IPv4 only. -
IPV6- The proxy connects to the database using IPv6 only.
IPV4
Constraints:
-
If you specify
IPV6, the database must support dual-stack mode. RDS doesn't support IPv6-only databases. - All targets registered with the proxy must be compatible with the specified network type.
Parameter vpcSecurityGroupIds :
One or more VPC security group IDs to associate with the new proxy.
Implementation
Future<CreateDBProxyResponse> createDBProxy({
required String dBProxyName,
required EngineFamily engineFamily,
required String roleArn,
required List<String> vpcSubnetIds,
List<UserAuthConfig>? auth,
bool? debugLogging,
DefaultAuthScheme? defaultAuthScheme,
EndpointNetworkType? endpointNetworkType,
int? idleClientTimeout,
bool? requireTLS,
List<Tag>? tags,
TargetConnectionNetworkType? targetConnectionNetworkType,
List<String>? vpcSecurityGroupIds,
}) async {
final $request = <String, String>{
'DBProxyName': dBProxyName,
'EngineFamily': engineFamily.value,
'RoleArn': roleArn,
if (vpcSubnetIds.isEmpty)
'VpcSubnetIds': ''
else
for (var i1 = 0; i1 < vpcSubnetIds.length; i1++)
'VpcSubnetIds.member.${i1 + 1}': vpcSubnetIds[i1],
if (auth != null)
if (auth.isEmpty)
'Auth': ''
else
for (var i1 = 0; i1 < auth.length; i1++)
for (var e3 in auth[i1].toQueryMap().entries)
'Auth.member.${i1 + 1}.${e3.key}': e3.value,
if (debugLogging != null) 'DebugLogging': debugLogging.toString(),
if (defaultAuthScheme != null)
'DefaultAuthScheme': defaultAuthScheme.value,
if (endpointNetworkType != null)
'EndpointNetworkType': endpointNetworkType.value,
if (idleClientTimeout != null)
'IdleClientTimeout': idleClientTimeout.toString(),
if (requireTLS != null) 'RequireTLS': requireTLS.toString(),
if (tags != null)
if (tags.isEmpty)
'Tags': ''
else
for (var i1 = 0; i1 < tags.length; i1++)
for (var e3 in tags[i1].toQueryMap().entries)
'Tags.Tag.${i1 + 1}.${e3.key}': e3.value,
if (targetConnectionNetworkType != null)
'TargetConnectionNetworkType': targetConnectionNetworkType.value,
if (vpcSecurityGroupIds != null)
if (vpcSecurityGroupIds.isEmpty)
'VpcSecurityGroupIds': ''
else
for (var i1 = 0; i1 < vpcSecurityGroupIds.length; i1++)
'VpcSecurityGroupIds.member.${i1 + 1}': vpcSecurityGroupIds[i1],
};
final $result = await _protocol.send(
$request,
action: 'CreateDBProxy',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'CreateDBProxyResult',
);
return CreateDBProxyResponse.fromXml($result);
}