Skip to content

Commit 81f92f9

Browse files
authored
Add a workflow to clean up Lambda java perf test environment (#448)
In case the previous test failed and the clanup action did not have a chance to run, that will break the following runs. This new workflow provides a quick fix to clean up the resources created by the previous run and unblock the perf test.
1 parent 39a33d3 commit 81f92f9

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
## SPDX-License-Identifier: Apache-2.0
3+
4+
name: Java Lambda Layer Performance Test Cleanup
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
test_runs:
9+
description: 'Number of test runs to perform'
10+
required: true
11+
default: 20
12+
type: number
13+
14+
java_version:
15+
description: 'The Java version to run the test'
16+
required: true
17+
default: '17'
18+
type: string
19+
20+
ADOT-Java-Branch:
21+
description: 'ADOT Java branch to use'
22+
required: true
23+
default: 'release/v2.11.x'
24+
type: string
25+
26+
jobs:
27+
java-lambda-layer-performance-test:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
id-token: write
31+
contents: read
32+
33+
env:
34+
NUM_TEST_RUNS: ${{ github.event.inputs.test_runs }}
35+
36+
steps:
37+
- name: Configure AWS Credentials
38+
uses: aws-actions/configure-aws-credentials@v4
39+
with:
40+
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
42+
43+
- name: Setup Terraform
44+
uses: hashicorp/setup-terraform@v2
45+
46+
- name: Cleanup Terraform Resources
47+
if: success() || failure() || cancelled()
48+
run: |
49+
cd aws-otel-java-instrumentation/sample-apps/apigateway-lambda/terraform
50+
echo "Starting Terraform cleanup..."
51+
terraform init
52+
terraform destroy -auto-approve
53+

0 commit comments

Comments
 (0)