CNE AWS Ready: Configuring the Cloud Native Experience

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.

Warning

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:

  1. Tear down managed infrastructure
  2. Tear down CNE platform resources
  3. Tear down the Kubernetes cluster

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).

  1. If your database uses deletion protection, disable it in infrastructure.yaml:

    	database:
    		deletionProtection: false
    
  2. (Optional) Force-delete storage and backup resources:

    	forceDestroy: true
    

    If you do not set this option, manually remove:

    • Objects and versions from S3 buckets
    • Recovery points from backup vaults
  3. Commit and push the change to your GitOps repository and allow Argo CD to synchronize the update.

  4. Disable infrastructure for the environment:

    	enabled: false
    
  5. Commit and push this change.

  6. Open Argo CD and synchronize the relevant infra applications with Prune enabled. Crossplane removes the managed infrastructure resources during this process.

Tip

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.

Note

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.

  1. From the root directory of the extracted archive, run:

    	cd gitops/resources
    	terraform destroy --auto-approve
    
  2. 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.