createDBSubnetGroup method

Future<CreateDBSubnetGroupResult> createDBSubnetGroup({
  1. required String dBSubnetGroupDescription,
  2. required String dBSubnetGroupName,
  3. required List<String> subnetIds,
  4. List<Tag>? tags,
})

Creates a new DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the AWS Region.

May throw DBSubnetGroupAlreadyExistsFault. May throw DBSubnetGroupQuotaExceededFault. May throw DBSubnetQuotaExceededFault. May throw DBSubnetGroupDoesNotCoverEnoughAZs. May throw InvalidSubnet.

Parameter dBSubnetGroupDescription : The description for the DB subnet group.

Parameter dBSubnetGroupName : The name for the DB subnet group. This value is stored as a lowercase string.

Constraints: Must contain no more than 255 letters, numbers, periods, underscores, spaces, or hyphens. Must not be default.

Example: mySubnetgroup

Parameter subnetIds : The EC2 Subnet IDs for the DB subnet group.

Parameter tags : Tags to assign to the DB subnet group.

Implementation

Future<CreateDBSubnetGroupResult> createDBSubnetGroup({
  required String dBSubnetGroupDescription,
  required String dBSubnetGroupName,
  required List<String> subnetIds,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(
      dBSubnetGroupDescription, 'dBSubnetGroupDescription');
  ArgumentError.checkNotNull(dBSubnetGroupName, 'dBSubnetGroupName');
  ArgumentError.checkNotNull(subnetIds, 'subnetIds');
  final $request = <String, dynamic>{};
  $request['DBSubnetGroupDescription'] = dBSubnetGroupDescription;
  $request['DBSubnetGroupName'] = dBSubnetGroupName;
  $request['SubnetIds'] = subnetIds;
  tags?.also((arg) => $request['Tags'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateDBSubnetGroup',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateDBSubnetGroupMessage'],
    shapes: shapes,
    resultWrapper: 'CreateDBSubnetGroupResult',
  );
  return CreateDBSubnetGroupResult.fromXml($result);
}