modifyClusterSubnetGroup method

Future<ModifyClusterSubnetGroupResult> modifyClusterSubnetGroup({
  1. required String clusterSubnetGroupName,
  2. required List<String> subnetIds,
  3. String? description,
})

Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets with the new list of subnets.

VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a subnet group for a provisioned cluster is in an account with VPC BPA turned on, the following capabilities are blocked:

  • Creating a public cluster
  • Restoring a public cluster
  • Modifying a private cluster to be public
  • Adding a subnet with VPC BPA turned on to the subnet group when there's at least one public cluster within the group
For more information about VPC BPA, see Block public access to VPCs and subnets in the Amazon VPC User Guide.

May throw ClusterSubnetGroupNotFoundFault. May throw ClusterSubnetQuotaExceededFault. May throw DependentServiceRequestThrottlingFault. May throw InvalidSubnet. May throw SubnetAlreadyInUse. May throw UnauthorizedOperation.

Parameter clusterSubnetGroupName : The name of the subnet group to be modified.

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

Parameter description : A text description of the subnet group to be modified.

Implementation

Future<ModifyClusterSubnetGroupResult> modifyClusterSubnetGroup({
  required String clusterSubnetGroupName,
  required List<String> subnetIds,
  String? description,
}) async {
  final $request = <String, String>{
    'ClusterSubnetGroupName': clusterSubnetGroupName,
    if (subnetIds.isEmpty)
      'SubnetIds': ''
    else
      for (var i1 = 0; i1 < subnetIds.length; i1++)
        'SubnetIds.SubnetIdentifier.${i1 + 1}': subnetIds[i1],
    if (description != null) 'Description': description,
  };
  final $result = await _protocol.send(
    $request,
    action: 'ModifyClusterSubnetGroup',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'ModifyClusterSubnetGroupResult',
  );
  return ModifyClusterSubnetGroupResult.fromXml($result);
}