createClusterSubnetGroup method

Future<CreateClusterSubnetGroupResult> createClusterSubnetGroup(
  1. {@required String clusterSubnetGroupName,
  2. @required String description,
  3. @required List<String> subnetIds,
  4. List<Tag> tags}
)

Creates a new Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon Virtual Private Cloud (Amazon VPC) when creating Amazon Redshift subnet group.

For information about subnet groups, go to Amazon Redshift Cluster Subnet Groups in the Amazon Redshift Cluster Management Guide.

May throw ClusterSubnetGroupAlreadyExistsFault. May throw ClusterSubnetGroupQuotaExceededFault. May throw ClusterSubnetQuotaExceededFault. May throw InvalidSubnet. May throw UnauthorizedOperation. May throw TagLimitExceededFault. May throw InvalidTagFault. May throw DependentServiceRequestThrottlingFault.

Parameter clusterSubnetGroupName : The name for the subnet group. Amazon Redshift stores the value as a lowercase string.

Constraints:

  • Must contain no more than 255 alphanumeric characters or hyphens.
  • Must not be "Default".
  • Must be unique for all subnet groups that are created by your AWS account.
Example: examplesubnetgroup

Parameter description : A description for the subnet group.

Parameter subnetIds : An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a single request.

Parameter tags : A list of tag instances.

Implementation

Future<CreateClusterSubnetGroupResult> createClusterSubnetGroup({
  @_s.required String clusterSubnetGroupName,
  @_s.required String description,
  @_s.required List<String> subnetIds,
  List<Tag> tags,
}) async {
  ArgumentError.checkNotNull(
      clusterSubnetGroupName, 'clusterSubnetGroupName');
  _s.validateStringLength(
    'clusterSubnetGroupName',
    clusterSubnetGroupName,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(description, 'description');
  _s.validateStringLength(
    'description',
    description,
    0,
    2147483647,
    isRequired: true,
  );
  ArgumentError.checkNotNull(subnetIds, 'subnetIds');
  final $request = <String, dynamic>{};
  $request['ClusterSubnetGroupName'] = clusterSubnetGroupName;
  $request['Description'] = description;
  $request['SubnetIds'] = subnetIds;
  tags?.also((arg) => $request['Tags'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateClusterSubnetGroup',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateClusterSubnetGroupMessage'],
    shapes: shapes,
    resultWrapper: 'CreateClusterSubnetGroupResult',
  );
  return CreateClusterSubnetGroupResult.fromXml($result);
}