Amazon Elastic Container Service for Kubernetes
API Reference (API Version 2017-11-01)

DeleteCluster

Deletes the Amazon EKS cluster control plane.

Note

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.

Request Syntax

DELETE /clusters/name HTTP/1.1

URI Request Parameters

The request requires the following URI parameters.

name

The name of the cluster to delete.

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Content-type: application/json { "cluster": { "arn": "string", "certificateAuthority": { "data": "string" }, "clientRequestToken": "string", "createdAt": number, "endpoint": "string", "name": "string", "platformVersion": "string", "resourcesVpcConfig": { "securityGroupIds": [ "string" ], "subnetIds": [ "string" ], "vpcId": "string" }, "roleArn": "string", "status": "string", "version": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

cluster

The full description of the cluster to delete.

Type: Cluster object

Errors

For information about the errors that are common to all actions, see Common Errors.

ClientException

These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid.

HTTP Status Code: 400

ResourceInUseException

The specified resource is in use.

HTTP Status Code: 409

ResourceNotFoundException

The specified resource could not be found. You can view your available clusters with ListClusters. Amazon EKS clusters are Region-specific.

HTTP Status Code: 404

ServerException

These errors are usually caused by a server-side issue.

HTTP Status Code: 500

ServiceUnavailableException

The service is unavailable. Back off and retry the operation.

HTTP Status Code: 503

Example

In the following example or examples, the Authorization header contents (AUTHPARAMS) must be replaced with an AWS Signature Version 4 signature. For more information about creating these signatures, see Signature Version 4 Signing Process in the AWS General Reference.

You only need to learn how to sign HTTP requests if you intend to manually create them. When you use the AWS Command Line Interface (AWS CLI) or one of the AWS SDKs to make requests to AWS, these tools automatically sign the requests for you with the access key that you specify when you configure the tools. When you use these tools, you don't need to learn how to sign requests yourself.

Example

The following example deletes a cluster called preview.

Sample Request

DELETE /clusters/devel HTTP/1.1 Host: eks.us-west-2.amazonaws.com Accept-Encoding: identity User-Agent: aws-cli/1.15.0 Python/3.6.5 Darwin/16.7.0 botocore/1.10.0 X-Amz-Date: 20180531T231840Z Authorization: AUTHPARAMS

Sample Response

HTTP/1.1 200 OK Date: Thu, 31 May 2018 23:18:41 GMT Content-Type: application/json Content-Length: 1895 x-amzn-RequestId: f41d2cd9-6528-11e8-90a7-d126e019a58a x-amz-apigw-id: HxlgjH_rPHcF7ag= X-Amzn-Trace-Id: Root=1-5b1082d0-7e60338c3a68e21292b0d2ca Connection: keep-alive { "cluster": { "endpoint": "https://A0DCCD80A04F01705DD065655C30CC3D.yl4.us-west-2.eks.amazonaws.com", "status": "DELETING", "createdAt": 1527807879.988, "certificateAuthority": { "data": "HERE_BE_SOME_CERT_DATA==" }, "arn": "arn:aws:eks:us-west-2:012345678910:cluster/devel", "roleArn": "arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI", "clientRequestToken": null, "version": "1.10", "name": "devel", "resourcesVpcConfig": { "securityGroupIds": [ "sg-6979fe18" ], "vpcId": "vpc-950809ec", "subnetIds": [ "subnet-6782e71e", "subnet-e7e761ac" ] } } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: