# Amazon EKS Cluster w/ External Secrets Operator This example deploys an EKS Cluster with the External Secrets Operator. The cluster is populated with a ClusterSecretStore and SecretStore example using SecretManager and Parameter Store respectively. A secret for each store is also created. Both stores use IRSA to retrieve the secret values from AWS. ## How to Deploy ### Prerequisites: Ensure that you have installed the following tools in your Mac or Windows Laptop before start working with this module and run Terraform Plan and Apply 1. [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) 2. [Kubectl](https://Kubernetes.io/docs/tasks/tools/) 3. [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) ### Deployment Steps #### Step 1: Clone the repo using the command below ```sh git clone https://github.com/aws-ia/terraform-aws-eks-blueprints.git ``` #### Step 2: Run Terraform INIT Initialize a working directory with configuration files ```sh cd examples/external-secrets/ terraform init ``` #### Step 3: Run Terraform PLAN Verify the resources created by this execution ```sh export AWS_REGION= # Select your own region terraform plan ``` #### Step 4: Finally, Terraform APPLY **Deploy the pattern** ```sh terraform apply ``` Enter `yes` to apply. ### Configure `kubectl` and test cluster EKS Cluster details can be extracted from terraform output or from AWS Console to get the name of cluster. This following command used to update the `kubeconfig` in your local machine where you run kubectl commands to interact with your EKS Cluster. #### Step 5: Run `update-kubeconfig` command `~/.kube/config` file gets updated with cluster details and certificate from the below command $ aws eks --region update-kubeconfig --name ### Step 6: List the secret resources in the `external-secrets` namespace $ kubectl get externalsecrets -n external-secrets $ kubectl get secrets -n external-secrets ## Cleanup To clean up your environment, destroy the Terraform modules in reverse order. Destroy the Kubernetes Add-ons, EKS cluster with Node groups and VPC ```sh terraform destroy -target="module.eks_blueprints_kubernetes_addons" -auto-approve terraform destroy -target="module.eks_blueprints" -auto-approve terraform destroy -target="module.vpc" -auto-approve ``` Finally, destroy any additional resources that are not in the above modules ```sh terraform destroy -auto-approve ```