Skip to content

Commit 73c852a

Browse files
authored
Fix: Refresh AWS Token During Lambda Java Performance Test (#450)
Problem: The Lambda Java performance test can take longer than one hour, but the AWS token is only valid for one hour. If the token expires, the performance test will fail. Additionally, Terraform will fail to delete the AWS resources it created. When this happens, subsequent performance tests are blocked because the AWS resources cannot be manually deleted (attempts to delete them in the AWS Console result in "Access Denied," even with admin permissions). Fix: In the performance test workflow, we explicitly renew the AWS token twice: Before running the performance tests. Before tearing down the Terraform-created resources.
1 parent 81f92f9 commit 73c852a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/java-lambda-layer-perf-test.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: aws-actions/configure-aws-credentials@v4
3939
with:
4040
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
41-
aws-region: us-east-1
41+
aws-region: us-east-1
4242

4343
- name: Checkout aws-otel-java-instrumentation
4444
uses: actions/checkout@v4
@@ -83,6 +83,13 @@ jobs:
8383
terraform init
8484
terraform apply -auto-approve -var "adot_layer_arn=${{ env.LAYER_VERSION_ARN }}"
8585
86+
# Re-authenticate to refresh credentials (important!)
87+
- name: Refresh AWS Credentials
88+
uses: aws-actions/configure-aws-credentials@v4
89+
with:
90+
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
91+
aws-region: us-east-1
92+
8693
- name: Checkout current repository
8794
uses: actions/checkout@v4
8895
with:
@@ -131,6 +138,14 @@ jobs:
131138
layer_results.txt
132139
retention-days: 90
133140

141+
# Always re-authenticate to refresh credentials before cleanup
142+
- name: Refresh AWS Credentials before cleanup
143+
if: success() || failure() || cancelled()
144+
uses: aws-actions/configure-aws-credentials@v4
145+
with:
146+
role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
147+
aws-region: us-east-1
148+
134149
- name: Cleanup Terraform Resources
135150
if: success() || failure() || cancelled()
136151
run: |

0 commit comments

Comments
 (0)