createDBSubnetGroup method
Creates a new DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Web Services Region.
May throw DBSubnetGroupAlreadyExistsFault.
May throw DBSubnetGroupDoesNotCoverEnoughAZs.
May throw DBSubnetGroupQuotaExceededFault.
May throw DBSubnetQuotaExceededFault.
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.
- First character must be a letter.
mydbsubnetgroup
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 {
final $request = <String, String>{
'DBSubnetGroupDescription': dBSubnetGroupDescription,
'DBSubnetGroupName': dBSubnetGroupName,
if (subnetIds.isEmpty)
'SubnetIds': ''
else
for (var i1 = 0; i1 < subnetIds.length; i1++)
'SubnetIds.SubnetIdentifier.${i1 + 1}': subnetIds[i1],
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,
};
final $result = await _protocol.send(
$request,
action: 'CreateDBSubnetGroup',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'CreateDBSubnetGroupResult',
);
return CreateDBSubnetGroupResult.fromXml($result);
}