diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index e76512ad2..a65d4d3f9 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -38,7 +38,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} - aws-region: us-east-1 + aws-region: us-east-1 - name: Checkout aws-otel-java-instrumentation uses: actions/checkout@v4 @@ -83,6 +83,13 @@ jobs: terraform init terraform apply -auto-approve -var "adot_layer_arn=${{ env.LAYER_VERSION_ARN }}" + # Re-authenticate to refresh credentials (important!) + - name: Refresh AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + aws-region: us-east-1 + - name: Checkout current repository uses: actions/checkout@v4 with: @@ -131,6 +138,14 @@ jobs: layer_results.txt retention-days: 90 + # Always re-authenticate to refresh credentials before cleanup + - name: Refresh AWS Credentials before cleanup + if: success() || failure() || cancelled() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + aws-region: us-east-1 + - name: Cleanup Terraform Resources if: success() || failure() || cancelled() run: |