Skip to content

Commit 1dd1313

Browse files
Potential fix for the error destroying test due to checkpoints in vault
1 parent d98b841 commit 1dd1313

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/terraform-destroy-test-environments-cron.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ jobs:
7979
working-directory: ./infrastructure
8080
shell: bash
8181

82+
- name: Pre-cleanup AWS Backup Recovery Points
83+
run: |
84+
RECOVERY_POINTS=$(aws backup list-recovery-points-by-backup-vault \
85+
--backup-vault-name ${{ matrix.sandbox-name }}_backup_vault \
86+
--region eu-west-2 \
87+
--query 'RecoveryPoints[*].RecoveryPointArn' \
88+
--output text)
89+
90+
for ARN in $RECOVERY_POINTS; do
91+
echo "Deleting recovery point: $ARN"
92+
aws backup delete-recovery-point \
93+
--backup-vault-name ${{ matrix.sandbox-name }}_backup_vault \
94+
--recovery-point-arn $ARN \
95+
--region eu-west-2
96+
done
97+
8298
- name: Terraform Destroy
8399
id: destroy
84100
run: terraform destroy -auto-approve -var-file="${{ vars.TF_VARS_FILE }}"

0 commit comments

Comments
 (0)