Skip to content

Commit ea58f53

Browse files
authored
ci: drop static AWS keys from athena profile (CORE-687) (#997)
1 parent 9ad6411 commit ea58f53

4 files changed

Lines changed: 24 additions & 2 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 }}

integration_tests/profiles/profiles.yml.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@
177177
region_name: {{ athena_region | toyaml }}
178178
database: awsdatacatalog
179179
schema: {{ schema }}
180-
aws_access_key_id: {{ athena_aws_access_key_id | toyaml }}
181-
aws_secret_access_key: {{ athena_aws_secret_access_key | toyaml }}
180+
work_group: oss_tests
182181
threads: 4
183182
{%- endmacro %}
184183

0 commit comments

Comments
 (0)