Skip to content

Commit 817e3a5

Browse files
authored
Robust-node-deletion (#513)
* delete node-roles after ASGs have been deleted * moved slack notif to the bottom
1 parent 3f5523d commit 817e3a5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/tekton-resources/tasks/teardown/awscli-eks.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,6 @@ spec:
5959
echo "Role $PIA_ROLE_NAME does not exist, no action needed."
6060
fi
6161
done
62-
- name: teardown-eks-role-stack
63-
image: alpine/k8s:1.23.7
64-
script: |
65-
aws cloudformation delete-stack --stack-name $(params.service-role-stack-name)
66-
aws cloudformation delete-stack --stack-name $(params.node-role-stack-name)
67-
aws cloudformation delete-stack --stack-name $(params.launch-template-stack-name)
68-
- name: send-slack-notification
69-
image: alpine/k8s:1.23.7
70-
script: |
71-
if [ -n "$(params.slack-hook)" ]; then
72-
curl -H "Content-type: application/json" --data '{"Message": "$(params.slack-message)"}' -X POST $(params.slack-hook)
73-
fi
7462
- name: awscli-delete-asg
7563
image: alpine/k8s:1.23.7
7664
script: |
@@ -109,6 +97,12 @@ spec:
10997
done
11098
11199
echo "All matching stacks have been deleted!"
100+
- name: teardown-eks-role-stack
101+
image: alpine/k8s:1.23.7
102+
script: |
103+
aws cloudformation delete-stack --stack-name $(params.service-role-stack-name)
104+
aws cloudformation delete-stack --stack-name $(params.node-role-stack-name)
105+
aws cloudformation delete-stack --stack-name $(params.launch-template-stack-name)
112106
- name: awscli-delete-vpc
113107
image: alpine/k8s:1.23.7
114108
script: |
@@ -158,3 +152,9 @@ spec:
158152
else
159153
echo "Stack deleted successfully!"
160154
fi
155+
- name: send-slack-notification
156+
image: alpine/k8s:1.23.7
157+
script: |
158+
if [ -n "$(params.slack-hook)" ]; then
159+
curl -H "Content-type: application/json" --data '{"Message": "$(params.slack-message)"}' -X POST $(params.slack-hook)
160+
fi

0 commit comments

Comments
 (0)