CNE AWS Ready: Cleaning Up the Environment
Remove Cloud Native Experience (CNE) resources when you no longer need an environment to avoid unnecessary cloud costs.
Manage infrastructure created through GitOps and Terraform through those workflows. Avoid modifying or deleting resources directly in the AWS console, as this can cause infrastructure state inconsistencies.
See CNE AWS Ready: Troubleshooting for more information.
Clean up the environment in this order:
Tear Down Managed Infrastructure
Before removing the platform or cluster, delete the managed cloud resources created for your environments (such as databases, networking resources, and storage).
-
If your database uses deletion protection, disable it in
infrastructure.yaml:database: deletionProtection: false -
(Optional) Force-delete storage and backup resources:
forceDestroy: trueIf you do not set this option, manually remove:
- Objects and versions from S3 buckets
- Recovery points from backup vaults
-
Commit and push the change to your GitOps repository and allow Argo CD to synchronize the update.
-
Disable infrastructure for the environment:
enabled: false -
Commit and push this change.
-
Open Argo CD and synchronize the relevant
infraapplications with Prune enabled. Crossplane removes the managed infrastructure resources during this process.
Ensure you are authenticated with the AWS CLI before synchronizing.
To access Argo CD:
kubectl port-forward -n argocd-system svc/argocd-server 8080:443
To retrieve the admin password:
kubectl -n argocd-system get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 --decode
Wait until Argo CD shows that all infrastructure resources are deleted.
In rare cases, Crossplane may leave resources in AWS. Verify remaining resources in the AWS console and delete them manually if necessary.
Tear Down the CNE Platform
After all managed infrastructure is deleted, remove the platform resources.
-
From the root directory of the extracted archive, run:
cd gitops/resources terraform destroy --auto-approve -
After completion, remove the remaining platform components:
cd gitops/platform terraform destroy --auto-approve
Tear Down the Kubernetes Cluster
Finally, delete the Amazon EKS cluster:
cd eks
terraform destroy --auto-approve
After the command finishes, verify in the AWS console that the EKS cluster and related resources have been removed.