createCacheSubnetGroup method

Future<CreateCacheSubnetGroupResult> createCacheSubnetGroup({
  1. required String cacheSubnetGroupDescription,
  2. required String cacheSubnetGroupName,
  3. required List<String> subnetIds,
})

Creates a new cache subnet group.

Use this parameter only when you are creating a cluster in an Amazon Virtual Private Cloud (Amazon VPC).

May throw CacheSubnetGroupAlreadyExistsFault. May throw CacheSubnetGroupQuotaExceededFault. May throw CacheSubnetQuotaExceededFault. May throw InvalidSubnet. May throw SubnetNotAllowedFault.

Parameter cacheSubnetGroupDescription : A description for the cache subnet group.

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

Constraints: Must contain no more than 255 alphanumeric characters or hyphens.

Example: mysubnetgroup

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

Implementation

Future<CreateCacheSubnetGroupResult> createCacheSubnetGroup({
  required String cacheSubnetGroupDescription,
  required String cacheSubnetGroupName,
  required List<String> subnetIds,
}) async {
  ArgumentError.checkNotNull(
      cacheSubnetGroupDescription, 'cacheSubnetGroupDescription');
  ArgumentError.checkNotNull(cacheSubnetGroupName, 'cacheSubnetGroupName');
  ArgumentError.checkNotNull(subnetIds, 'subnetIds');
  final $request = <String, dynamic>{};
  $request['CacheSubnetGroupDescription'] = cacheSubnetGroupDescription;
  $request['CacheSubnetGroupName'] = cacheSubnetGroupName;
  $request['SubnetIds'] = subnetIds;
  final $result = await _protocol.send(
    $request,
    action: 'CreateCacheSubnetGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateCacheSubnetGroupMessage'],
    shapes: shapes,
    resultWrapper: 'CreateCacheSubnetGroupResult',
  );
  return CreateCacheSubnetGroupResult.fromXml($result);
}