createDBInstance method
Future<CreateDBInstanceResult>
createDBInstance({
- required int allocatedStorage,
- required String dBInstanceClass,
- required String dBInstanceIdentifier,
- required String engine,
- required String masterUserPassword,
- required String masterUsername,
- bool? autoMinorVersionUpgrade,
- String? availabilityZone,
- int? backupRetentionPeriod,
- String? characterSetName,
- String? dBName,
- String? dBParameterGroupName,
- List<
String> ? dBSecurityGroups, - String? dBSubnetGroupName,
- String? engineVersion,
- int? iops,
- String? licenseModel,
- bool? multiAZ,
- String? optionGroupName,
- int? port,
- String? preferredBackupWindow,
- String? preferredMaintenanceWindow,
- bool? publiclyAccessible,
- List<
String> ? vpcSecurityGroupIds,
May throw DBInstanceAlreadyExistsFault. May throw InsufficientDBInstanceCapacityFault. May throw DBParameterGroupNotFoundFault. May throw DBSecurityGroupNotFoundFault. May throw InstanceQuotaExceededFault. May throw StorageQuotaExceededFault. May throw DBSubnetGroupNotFoundFault. May throw DBSubnetGroupDoesNotCoverEnoughAZs. May throw InvalidSubnet. May throw InvalidVPCNetworkStateFault. May throw ProvisionedIopsNotAvailableInAZFault. May throw OptionGroupNotFoundFault.
Implementation
Future<CreateDBInstanceResult> createDBInstance({
required int allocatedStorage,
required String dBInstanceClass,
required String dBInstanceIdentifier,
required String engine,
required String masterUserPassword,
required String masterUsername,
bool? autoMinorVersionUpgrade,
String? availabilityZone,
int? backupRetentionPeriod,
String? characterSetName,
String? dBName,
String? dBParameterGroupName,
List<String>? dBSecurityGroups,
String? dBSubnetGroupName,
String? engineVersion,
int? iops,
String? licenseModel,
bool? multiAZ,
String? optionGroupName,
int? port,
String? preferredBackupWindow,
String? preferredMaintenanceWindow,
bool? publiclyAccessible,
List<String>? vpcSecurityGroupIds,
}) async {
ArgumentError.checkNotNull(allocatedStorage, 'allocatedStorage');
ArgumentError.checkNotNull(dBInstanceClass, 'dBInstanceClass');
ArgumentError.checkNotNull(dBInstanceIdentifier, 'dBInstanceIdentifier');
ArgumentError.checkNotNull(engine, 'engine');
ArgumentError.checkNotNull(masterUserPassword, 'masterUserPassword');
ArgumentError.checkNotNull(masterUsername, 'masterUsername');
final $request = <String, dynamic>{};
$request['AllocatedStorage'] = allocatedStorage;
$request['DBInstanceClass'] = dBInstanceClass;
$request['DBInstanceIdentifier'] = dBInstanceIdentifier;
$request['Engine'] = engine;
$request['MasterUserPassword'] = masterUserPassword;
$request['MasterUsername'] = masterUsername;
autoMinorVersionUpgrade
?.also((arg) => $request['AutoMinorVersionUpgrade'] = arg);
availabilityZone?.also((arg) => $request['AvailabilityZone'] = arg);
backupRetentionPeriod
?.also((arg) => $request['BackupRetentionPeriod'] = arg);
characterSetName?.also((arg) => $request['CharacterSetName'] = arg);
dBName?.also((arg) => $request['DBName'] = arg);
dBParameterGroupName?.also((arg) => $request['DBParameterGroupName'] = arg);
dBSecurityGroups?.also((arg) => $request['DBSecurityGroups'] = arg);
dBSubnetGroupName?.also((arg) => $request['DBSubnetGroupName'] = arg);
engineVersion?.also((arg) => $request['EngineVersion'] = arg);
iops?.also((arg) => $request['Iops'] = arg);
licenseModel?.also((arg) => $request['LicenseModel'] = arg);
multiAZ?.also((arg) => $request['MultiAZ'] = arg);
optionGroupName?.also((arg) => $request['OptionGroupName'] = arg);
port?.also((arg) => $request['Port'] = arg);
preferredBackupWindow
?.also((arg) => $request['PreferredBackupWindow'] = arg);
preferredMaintenanceWindow
?.also((arg) => $request['PreferredMaintenanceWindow'] = arg);
publiclyAccessible?.also((arg) => $request['PubliclyAccessible'] = arg);
vpcSecurityGroupIds?.also((arg) => $request['VpcSecurityGroupIds'] = arg);
final $result = await _protocol.send(
$request,
action: 'CreateDBInstance',
version: '2013-02-12',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['CreateDBInstanceMessage'],
shapes: shapes,
resultWrapper: 'CreateDBInstanceResult',
);
return CreateDBInstanceResult.fromXml($result);
}