Delete cluster
Last updated
Last updated
View the following tutorial video if it's your first time
While a cluster is running, the cost of running the EC2 instances is continuously incurred by your AWS account. To shut down the cluster after completing the demo, navigate to the Clusters page and select the running cluster. Click Delete to begin the shutdown procedure. It generally takes a similar amount of time to deploy and shut down the cluster; refer to the specific cluster type for more info.
In the case this operation fails, check the below sections for how to manually shutdown the cluster
In the unfortunate case where an error occurs in the cluster shutdown, it may be necessary to manually destroy the resources. All resources created for a cluster are tagged with a unique id that can be found in the cluster details. You can double check for this value to ensure the resources to be destroyed are associated with the cluster.
There are two sets of resources to destroy:
Cluster components
Agent node and its VPC
This section assumes SSH access to the agent node
Every cluster is launched with an agent node whose public DNS is displayed in the cluster details; this instance is launched first and is responsible for launching the rest of the cluster resources and subsequently destroying the corresponding cluster resources.
Assuming SSH access is available, SSH into the agent node and navigate to the directory at /home/ec2-user/rad/application/agent/.workspace/Rad/<clusterType>--<clusterName>/terraform
, where the directory within Rad/
should contain exactly one directory whose name consists of the cluster type and cluster name. Within the terraform/
directory, you should see several files ending in .tf
. From this directory. try to run terraform destroy --auto-approve
.
If this command succeeds, the cluster components are destroyed and skip to the next stage to shut down the agent node.
This is the last resort option if no prior options are successful
Log into your AWS account to access the web console. Manually identify the resources whose names correspond to the cluster, double checking that they have a tag with key ResourceTag
and value matching the unique string of the cluster.
Check for the following resource types under their respective services and delete them:
EC2
EC2 instances (multiple, depending on the cluster type)
Key pair (1)
Security group (1)
The agent node and its accompanying resources can only be shut down by terminating the individual components. Again you can identify the resources by their name and tags.
Check for the following resource types under their respective services and delete them:
EC2
EC2 instance (1), whose instance name is of the format <clusterName>-public-instance
Key pair (1), whose name is of the format keypair-<resourceTag>
Security group (1), whose name is of the format security-group-<resourceTag>
S3
S3 bucket (1), whose bucket name is of the format rad-app-<resourceTag>
IAM
IAM role, whose name is of the format instance_profile_role-<resourceTag>
IAM policy, whose name is of the format instance_role_policy-<resourceTag>
VPC
VPC (1), whose name is of format vpc-<resourceTag>
The VPC is also created with several other resources types such as subnet, gateways, etc. Follow the guidance of deleting the prerequisite resources to be able to delete the VPC