Cleanup

Congratulations on completing the CI/CD with CodePipeline module.

This module is not used in subsequent steps, so you can remove the resources now, or at the end of the workshop.

First we need to delete the Kubernetes deployment and service:

kubectl delete deployments hello-k8s

kubectl delete services hello-k8s

Next, we are going to delete the CloudFormation stack created. Open CloudFormation the AWS Management Console.

Check the box next to the eksws-codepipeline stack, select the Actions dropdown menu and then click Delete stack:

CloudFormation Delete

Now we are going to delete the ECR repository:

ECR Delete

Empty and then delete the S3 bucket used by CodeBuild for build artifacts (bucket name starts with eksws-codepipeline). First, select the bucket, then empty the bucket and finally delete the bucket:

S3 Delete

Finally, we are going to delete the IAM role created for CodeBuild to permit changes to the EKS cluster:

aws iam delete-role-policy --role-name EksWorkshopCodeBuildKubectlRole --policy-name eks-describe

aws iam delete-role --role-name EksWorkshopCodeBuildKubectlRole