createDBProxy method

Future<CreateDBProxyResponse> createDBProxy({
  1. required List<UserAuthConfig> auth,
  2. required String dBProxyName,
  3. required EngineFamily engineFamily,
  4. required String roleArn,
  5. required List<String> vpcSubnetIds,
  6. bool? debugLogging,
  7. int? idleClientTimeout,
  8. bool? requireTLS,
  9. List<Tag>? tags,
  10. List<String>? vpcSecurityGroupIds,
})

Creates a new DB proxy.

May throw InvalidSubnet. May throw DBProxyAlreadyExistsFault. May throw DBProxyQuotaExceededFault.

Parameter auth : The authorization mechanism that the proxy uses.

Parameter 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.

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. The engine family applies to MySQL and PostgreSQL for both RDS and Aurora.

Parameter roleArn : The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access secrets in AWS Secrets Manager.

Parameter vpcSubnetIds : One or more VPC subnet IDs to associate with the new proxy.

Parameter 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.

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 : 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.

Parameter tags : An optional set of key-value pairs to associate arbitrary data of your choosing with the proxy.

Parameter vpcSecurityGroupIds : One or more VPC security group IDs to associate with the new proxy.

Implementation

Future<CreateDBProxyResponse> createDBProxy({
  required List<UserAuthConfig> auth,
  required String dBProxyName,
  required EngineFamily engineFamily,
  required String roleArn,
  required List<String> vpcSubnetIds,
  bool? debugLogging,
  int? idleClientTimeout,
  bool? requireTLS,
  List<Tag>? tags,
  List<String>? vpcSecurityGroupIds,
}) async {
  ArgumentError.checkNotNull(auth, 'auth');
  ArgumentError.checkNotNull(dBProxyName, 'dBProxyName');
  ArgumentError.checkNotNull(engineFamily, 'engineFamily');
  ArgumentError.checkNotNull(roleArn, 'roleArn');
  ArgumentError.checkNotNull(vpcSubnetIds, 'vpcSubnetIds');
  final $request = <String, dynamic>{};
  $request['Auth'] = auth;
  $request['DBProxyName'] = dBProxyName;
  $request['EngineFamily'] = engineFamily.toValue();
  $request['RoleArn'] = roleArn;
  $request['VpcSubnetIds'] = vpcSubnetIds;
  debugLogging?.also((arg) => $request['DebugLogging'] = arg);
  idleClientTimeout?.also((arg) => $request['IdleClientTimeout'] = arg);
  requireTLS?.also((arg) => $request['RequireTLS'] = arg);
  tags?.also((arg) => $request['Tags'] = arg);
  vpcSecurityGroupIds?.also((arg) => $request['VpcSecurityGroupIds'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateDBProxy',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateDBProxyRequest'],
    shapes: shapes,
    resultWrapper: 'CreateDBProxyResult',
  );
  return CreateDBProxyResponse.fromXml($result);
}