This steps my be suffice to clean up all the objects created for this workshop.
-
Delete the test host
aws ec2 terminate-instances \ --instance-ids $HOSTINSTANCEID \ --region $REGION \ --no-cli-pager
-
Detach the
tigera-egw-policy
policy from the nodegroup's role and delete it.aws iam detach-role-policy \ --role-name $NGROLENAME \ --policy-arn $TIGERAEGWPOLICYARN
aws iam delete-policy \ --policy-arn $TIGERAEGWPOLICYARN
-
Delete the cluster (with the nodegroup)
eksctl delete cluster \ --name $CLUSTERNAME \ --region $REGION
-
Delete the security group
aws ec2 delete-security-group \ --group-id $HOSTSGID \ --region $REGION \ --no-cli-pager
-
Detach the Internet Gateway from the VPC
aws ec2 detach-internet-gateway \ --region $REGION \ --internet-gateway-id $INETGWID \ --vpc-id $VPCID
-
Delete the Internet Gateway
aws ec2 delete-internet-gateway \ --internet-gateway-id $INETGWID \ --region $REGION
-
Delete the Subnets
aws ec2 delete-subnet \ --region $REGION \ --subnet-id $SUBNETPUBEKS1AID aws ec2 delete-subnet \ --region $REGION \ --subnet-id $SUBNETPUBEKS1BID aws ec2 delete-subnet \ --region $REGION \ --subnet-id $SUBNETPUBEGW1AID aws ec2 delete-subnet \ --region $REGION \ --subnet-id $SUBNETPUBEGW1BID
-
Release the Elastic IP addresses.
aws ec2 release-address \ --region $REGION \ --allocation-id $EIPALLOCATION1 aws ec2 release-address \ --region $REGION \ --allocation-id $EIPALLOCATION2
-
Delete the VPC
aws ec2 delete-vpc \ --region $REGION \ --vpc-id $VPCID
-
Delete the keypair
aws ec2 delete-key-pair \ --region $REGION \ --key-name $KEYPAIRNAME
-
Delete the private key and the egwLabVars.env files stored locally
rm -f ~/.ssh/$KEYPAIRNAME.pem # Remove the lab env params file. rm ~/egwLabVars.env