Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 9 additions & 30 deletions .github/workflows/aws_common_procedure_s3_bucket.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
---
name: Tests - Integration - AWS S3 bucket for Terraform backend

# https://docs.camunda.io/docs/self-managed/setup/deploy/amazon/amazon-eks/eks-terraform/#create-an-s3-bucket-for-terraform-state-management

on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/aws_common_procedure_s3_bucket.yml
- .tool-versions
- aws/common/procedure/s3-bucket/**
- .github/actions/aws-configure-cli/**
- .github/actions/internal-apply-skip-label/**
pull_request: {}
schedule:
- cron: 0 0 * * 4 # every Thursday at midnight

- cron: 0 0 * * 4
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
IS_SCHEDULE: ${{ contains(github.head_ref, 'schedules/') || github.event_name == 'schedule' && 'true' || 'false' }}
IS_RENOVATE_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login == 'renovate[bot]' }}

AWS_PROFILE: infraex
AWS_REGION: eu-west-2

jobs:
triage:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Check labels
id: skip_check
uses: ./.github/actions/internal-triage-skip

s3-bucket-verification:
name: Verify S3 related doc scripts
runs-on: ubuntu-latest
needs: triage

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install asdf tools with cache
uses: camunda/infraex-common-config/./.github/actions/asdf-install-tooling@791f01a12a6b0c44f16a1dce9c9791de34ec4767 # 1.3.8

uses: camunda/infraex-common-config/./.github/actions/asdf-install-tooling@791f01a12a6b0c44f16a1dce9c9791de34ec4767
- name: Configure AWS CLI
uses: ./.github/actions/aws-configure-cli
with:
Expand All @@ -56,7 +39,6 @@ jobs:
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }}
aws-profile: ${{ env.AWS_PROFILE }}
aws-region: ${{ env.AWS_REGION }}

- name: Generate random S3 bucket name
working-directory: aws/common/procedure/s3-bucket
run: |
Expand All @@ -65,7 +47,6 @@ jobs:
echo "BUCKET_NAME=$BUCKET_NAME" | tee -a "$GITHUB_ENV"

sed -i "s/^export S3_TF_BUCKET_NAME=\".*\"/export S3_TF_BUCKET_NAME=\"$BUCKET_NAME\"/" ./s3-bucket-creation.sh

- name: Execute S3 scripts
working-directory: aws/common/procedure/s3-bucket
run: |
Expand Down Expand Up @@ -98,7 +79,6 @@ jobs:
./s3-bucket-tf-init.sh

rm -rf config.tf

- name: Delete S3 bucket
if: always()
run: |
Expand Down Expand Up @@ -129,21 +109,18 @@ jobs:
done

aws s3 rb s3://${{ env.BUCKET_NAME }} --force

report-success:
name: Report success
runs-on: ubuntu-latest
needs:
- s3-bucket-verification
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Prevent other runs for renovate
if: ${{ env.IS_RENOVATE_PR == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
uses: ./.github/actions/internal-apply-skip-label

report-failure:
name: Report failure
runs-on: ubuntu-latest
Expand All @@ -154,8 +131,10 @@ jobs:
- name: Notify in Slack in case of failure
id: slack-notification
if: ${{ env.IS_SCHEDULE == 'true' }}
uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@e9a9f33ab193348a82a79bd9250fdf12f708390a # 1.2.19
uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@e9a9f33ab193348a82a79bd9250fdf12f708390a
with:
vault_addr: ${{ secrets.VAULT_ADDR }}
vault_role_id: ${{ secrets.VAULT_ROLE_ID }}
vault_secret_id: ${{ secrets.VAULT_SECRET_ID }}

# Scheduled trigger: 2026-03-03T22:10:41Z - Tuesday schedules 8.7
Loading
Loading