Skip to content

Commit

Permalink
detach policy from role and delete the role (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
spring1843 authored Mar 15, 2022
1 parent b3d5493 commit 8c17f26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

declare -a steps=(
step01-config.sh
step14-deprovisioning.sh
step16-cleanup.sh
)

Expand Down
Original file line number Diff line number Diff line change
@@ -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" \
Expand Down

0 comments on commit 8c17f26

Please sign in to comment.