Pause AWS Resources #129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pause AWS Resources | |
on: | |
schedule: | |
- cron: "0 2 * * 2-6" # Runs every day at 6PM PST, Monday to Friday | |
workflow_dispatch: | |
workflow_call: | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: write # This is required for actions/checkout | |
jobs: | |
stack-prefix: | |
name: Stack Prefix | |
uses: ./.github/workflows/.stack-prefix.yml | |
pause-resources-dev: | |
name: Pause Resources Dev | |
needs: [stack-prefix] | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }} | |
role-session-name: gha-pause-resources | |
aws-region: ca-central-1 | |
- name: Pause AWS Resources | |
run: | | |
chmod +x ./.github/scripts/pause.sh | |
./.github/scripts/pause.sh dev ${{ needs.stack-prefix.outputs.stack_prefix }} | |
pause-resources-test: | |
name: Pause Resources Test | |
environment: test | |
needs: [stack-prefix] | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }} | |
role-session-name: gha-pause-resources | |
aws-region: ca-central-1 | |
- name: Pause AWS Resources | |
shell: bash | |
run: | | |
chmod +x ./.github/scripts/pause.sh | |
./.github/scripts/pause.sh test ${{ needs.stack-prefix.outputs.stack_prefix }} | |
pause-resources-prod: | |
name: Pause Resources PROD | |
environment: prod | |
needs: [stack-prefix] | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }} | |
role-session-name: gha-pause-resources | |
aws-region: ca-central-1 | |
- name: Pause AWS Resources | |
shell: bash | |
run: | | |
chmod +x ./.github/scripts/pause.sh | |
./.github/scripts/pause.sh prod ${{ needs.stack-prefix.outputs.stack_prefix }} |