Skip to content

ROSA Scheduled Delete #416

ROSA Scheduled Delete

ROSA Scheduled Delete #416

name: ROSA Scheduled Delete
on:
workflow_dispatch:
schedule:
- cron: '0 21 * * *' # Runs every day at 9 PM UTC.
jobs:
rosa-delete:
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak-benchmark'
uses: ./.github/workflows/rosa-cluster-delete.yml
secrets: inherit
with:
deleteAll: yes
aurora-delete:
needs: rosa-delete
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region ${{ vars.AWS_DEFAULT_REGION }}
- shell: bash
run: ./provision/aws/rds/aurora_cluster_reaper.sh
env:
AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }}
route53-delete:
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak-benchmark'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup ROSA CLI
uses: ./.github/actions/rosa-cli-setup
with:
aws-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-default-region: ${{ vars.AWS_DEFAULT_REGION }}
rosa-token: ${{ secrets.ROSA_TOKEN }}
- name: Delete Route 53 entries
run: ./provision/aws/route53/route53_delete.sh
env:
AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }}
REAPER: TRUE
delete-check:
needs: [rosa-delete, aurora-delete, route53-delete]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region ${{ vars.AWS_DEFAULT_REGION }}
- shell: bash
run: ./provision/aws/aws_check_vpcs.sh
- shell: bash
if: ${{ always() }}
run: ./provision/aws/aws_check_subnet_groups.sh
accelerator-delete:
if: github.event_name != 'schedule' || github.repository == 'keycloak/keycloak-benchmark'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region ${{ vars.AWS_DEFAULT_REGION }}
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1
with:
tofu_wrapper: false
- name: Delete Global Accelerators
run: ./provision/aws/global-accelerator/accelerator_reaper.sh