Skip to content

Commit

Permalink
Bump eks cleanup token duration to 3h from 1h (#1048)
Browse files Browse the repository at this point in the history
* Bump eks cleanup token duration to 3h from 1h

* Add slack notifications for failed cleanups
  • Loading branch information
lkysow authored Jul 20, 2021
1 parent 64ea736 commit 3d235a8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,10 @@ jobs:
az group delete -n $group --yes
done
- slack/status:
fail_only: true
failure_message: "AKS cleanup failed"

cleanup-gcp-resources:
docker:
- image: docker.mirror.hashicorp.services/hashicorpdev/consul-helm-test:0.10.0
Expand All @@ -661,6 +665,10 @@ jobs:
gcloud container clusters delete $cluster --zone us-central1-a --project ${CLOUDSDK_CORE_PROJECT} --quiet
done
- slack/status:
fail_only: true
failure_message: "GKE cleanup failed"

cleanup-eks-resources:
docker:
- image: docker.mirror.hashicorp.services/hashicorpdev/consul-helm-test:0.9.0
Expand All @@ -670,14 +678,18 @@ jobs:
name: cleanup eks resources
command: |
# Assume the role and set environment variables.
aws sts assume-role --role-arn "$AWS_ROLE_ARN" --role-session-name "consul-helm-$CIRCLE_BUILD_NUM" > assume-role.json
aws sts assume-role --role-arn "$AWS_ROLE_ARN" --role-session-name "consul-helm-$CIRCLE_BUILD_NUM" --duration-seconds 10800 > assume-role.json
export AWS_ACCESS_KEY_ID="$(jq -r .Credentials.AccessKeyId assume-role.json)"
export AWS_SECRET_ACCESS_KEY="$(jq -r .Credentials.SecretAccessKey assume-role.json)"
export AWS_SESSION_TOKEN="$(jq -r .Credentials.SessionToken assume-role.json)"
cd hack/aws-acceptance-test-cleanup
go run ./... -auto-approve
- slack/status:
fail_only: true
failure_message: "EKS cleanup failed"

workflows:
version: 2
test:
Expand Down

0 comments on commit 3d235a8

Please sign in to comment.