createSubnetGroup method

Future<CreateSubnetGroupResponse> createSubnetGroup({
  1. required String subnetGroupName,
  2. required List<String> subnetIds,
  3. String? description,
})

Creates a new subnet group.

May throw SubnetGroupAlreadyExistsFault. May throw SubnetGroupQuotaExceededFault. May throw SubnetQuotaExceededFault. May throw InvalidSubnet. May throw ServiceLinkedRoleNotFoundFault.

Parameter subnetGroupName : A name for the subnet group. This value is stored as a lowercase string.

Parameter subnetIds : A list of VPC subnet IDs for the subnet group.

Parameter description : A description for the subnet group

Implementation

Future<CreateSubnetGroupResponse> createSubnetGroup({
  required String subnetGroupName,
  required List<String> subnetIds,
  String? description,
}) async {
  ArgumentError.checkNotNull(subnetGroupName, 'subnetGroupName');
  ArgumentError.checkNotNull(subnetIds, 'subnetIds');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDAXV3.CreateSubnetGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'SubnetGroupName': subnetGroupName,
      'SubnetIds': subnetIds,
      if (description != null) 'Description': description,
    },
  );

  return CreateSubnetGroupResponse.fromJson(jsonResponse.body);
}