createCacheSecurityGroup method

Future<CreateCacheSecurityGroupResult> createCacheSecurityGroup({
  1. required String cacheSecurityGroupName,
  2. required String description,
})

Creates a new cache security group. Use a cache security group to control access to one or more clusters.

Cache security groups are only used when you are creating a cluster outside of an Amazon Virtual Private Cloud (Amazon VPC). If you are creating a cluster inside of a VPC, use a cache subnet group instead. For more information, see CreateCacheSubnetGroup.

May throw CacheSecurityGroupAlreadyExistsFault. May throw CacheSecurityGroupQuotaExceededFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

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

Constraints: Must contain no more than 255 alphanumeric characters. Cannot be the word "Default".

Example: mysecuritygroup

Parameter description : A description for the cache security group.

Implementation

Future<CreateCacheSecurityGroupResult> createCacheSecurityGroup({
  required String cacheSecurityGroupName,
  required String description,
}) async {
  ArgumentError.checkNotNull(
      cacheSecurityGroupName, 'cacheSecurityGroupName');
  ArgumentError.checkNotNull(description, 'description');
  final $request = <String, dynamic>{};
  $request['CacheSecurityGroupName'] = cacheSecurityGroupName;
  $request['Description'] = description;
  final $result = await _protocol.send(
    $request,
    action: 'CreateCacheSecurityGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateCacheSecurityGroupMessage'],
    shapes: shapes,
    resultWrapper: 'CreateCacheSecurityGroupResult',
  );
  return CreateCacheSecurityGroupResult.fromXml($result);
}