From 8c17f269400a2447fc3f6328a2a9307b264e0831 Mon Sep 17 00:00:00 2001 From: Ryan Maleki Date: Tue, 15 Mar 2022 09:59:33 -0700 Subject: [PATCH] detach policy from role and delete the role (#1514) --- .../getting-started-with-eksctl/scripts/cleanup.sh | 1 - .../getting-started-with-eksctl/scripts/step16-cleanup.sh | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/cleanup.sh b/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/cleanup.sh index bbbb6b389794..52851e7f975a 100755 --- a/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/cleanup.sh +++ b/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/cleanup.sh @@ -2,7 +2,6 @@ declare -a steps=( step01-config.sh - step14-deprovisioning.sh step16-cleanup.sh ) diff --git a/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/step16-cleanup.sh b/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/step16-cleanup.sh index e512101f2961..891000a35690 100644 --- a/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/step16-cleanup.sh +++ b/website/content/en/preview/getting-started/getting-started-with-eksctl/scripts/step16-cleanup.sh @@ -1,5 +1,7 @@ helm uninstall karpenter --namespace karpenter -aws iam delete-role --role-name "${CLUSTER_NAME}-karpenter" +aws iam detach-role-policy --role-name="${CLUSTER_NAME}-karpenter" --policy-arn="arn:aws:iam::${AWS_ACCOUNT_ID}:policy/KarpenterControllerPolicy-${CLUSTER_NAME}" +aws iam delete-policy --policy-arn="arn:aws:iam::${AWS_ACCOUNT_ID}:policy/KarpenterControllerPolicy-${CLUSTER_NAME}" +aws iam delete-role --role-name="${CLUSTER_NAME}-karpenter" aws cloudformation delete-stack --stack-name "Karpenter-${CLUSTER_NAME}" aws ec2 describe-launch-templates \ | jq -r ".LaunchTemplates[].LaunchTemplateName" \