deleteCluster method

Future<DeleteClusterResponse> deleteCluster({
  1. required String name,
})

Deletes the Amazon EKS cluster control plane.

If you have active services in your cluster that are associated with a load balancer, you must delete those services before deleting the cluster so that the load balancers are deleted properly. Otherwise, you can have orphaned resources in your VPC that prevent you from being able to delete the VPC. For more information, see Deleting a Cluster in the Amazon EKS User Guide.

If you have managed node groups or Fargate profiles attached to the cluster, you must delete them first. For more information, see DeleteNodegroup and DeleteFargateProfile.

May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ClientException. May throw ServerException. May throw ServiceUnavailableException.

Parameter name : The name of the cluster to delete.

Implementation

Future<DeleteClusterResponse> deleteCluster({
  required String name,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/clusters/${Uri.encodeComponent(name)}',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteClusterResponse.fromJson(response);
}