Skip to content

Commit 85c1467

Browse files
haritamarclaude
andcommitted
ci: assume shared AWS OIDC role for athena (CORE-687)
elementary-cli and dbt-data-reliability share a single IAM role (github-actions-elementary-oss) provisioned in elementary-internal. This change wires up the dbt-data-reliability side: - test-warehouse.yml: add id-token: write at job level + a configure-aws-credentials step gated on inputs.warehouse-type == 'athena'. - cleanup-stale-schemas.yml: add id-token: write at job level + a configure-aws-credentials step gated on matrix.warehouse-type == 'athena' (only the athena matrix entry needs AWS). - test-all-warehouses.yml: grant id-token: write to the test-cloud caller job, since it calls test-warehouse.yml as a reusable workflow and GitHub requires id-token: write to be granted by the caller. Pairs with the profile-template change in this same branch (integration_tests/profiles/profiles.yml.j2: drop static AWS keys, add work_group: oss_tests). Requires AWS_OIDC_ROLE_ARN to be set as a repo secret with the role ARN exported by the matching elementary-internal Terraform PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ccc74c0 commit 85c1467

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/cleanup-stale-schemas.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
runs-on: ubuntu-latest
2323
permissions:
2424
contents: read
25+
# Mint an OIDC token to assume the shared elementary-oss AWS role
26+
# (used by the athena matrix entry below).
27+
id-token: write
2528
env:
2629
WAREHOUSE: ${{ matrix.warehouse-type }}
2730
MAX_AGE_HOURS: ${{ inputs.max-age-hours || '24' }}
@@ -43,6 +46,13 @@ jobs:
4346
exit 1
4447
fi
4548
49+
- name: Configure AWS credentials
50+
if: matrix.warehouse-type == 'athena'
51+
uses: aws-actions/configure-aws-credentials@v4
52+
with:
53+
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }}
54+
aws-region: eu-west-1
55+
4656
- name: Checkout dbt package
4757
uses: actions/checkout@v6
4858
with:

.github/workflows/test-all-warehouses.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ jobs:
138138
needs: [check-fork-status, approve-fork]
139139
permissions:
140140
contents: read
141+
# Required so the called test-warehouse.yml can mint an OIDC token to
142+
# assume the AWS role (only used for the athena matrix entry); per
143+
# GitHub, id-token: write must be granted by the calling workflow.
144+
id-token: write
141145
if: |
142146
! cancelled() &&
143147
needs.check-fork-status.result == 'success' &&

.github/workflows/test-warehouse.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
timeout-minutes: 60
6464
permissions:
6565
contents: read
66+
# Mint an OIDC token to assume the shared elementary-oss AWS role.
67+
id-token: write
6668
env:
6769
WAREHOUSE: ${{ inputs.warehouse-type }}
6870
DBT_VERSION: ${{ inputs.dbt-version }}
@@ -85,6 +87,13 @@ jobs:
8587
path: dbt-data-reliability
8688
ref: ${{ inputs.dbt-data-reliability-ref }}
8789

90+
- name: Configure AWS credentials
91+
if: inputs.warehouse-type == 'athena'
92+
uses: aws-actions/configure-aws-credentials@v4
93+
with:
94+
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }}
95+
aws-region: eu-west-1
96+
8897
- name: Start Postgres
8998
if: inputs.warehouse-type == 'postgres'
9099
working-directory: ${{ env.TESTS_DIR }}

0 commit comments

Comments
 (0)