Skip to content

Commit 82ab58c

Browse files
authored
Workflow to upload Java Lambda sample app for testing (#352)
1 parent d844c45 commit 82ab58c

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/java-sample-app-s3-deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,49 @@ jobs:
160160
gradle build -P javaVersion=${{ matrix.java-version }}
161161
aws s3api put-object --bucket aws-appsignals-sample-app-prod-us-east-1 --body ./build/libs/springboot-remote-service-*-SNAPSHOT.jar --key java-remote-service-v${{ matrix.java-version }}.jar
162162
163+
java-lambda:
164+
strategy:
165+
fail-fast: false
166+
matrix:
167+
aws-region: [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
168+
'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
169+
'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
170+
'us-east-1','us-east-2','us-west-1','us-west-2' ]
171+
runs-on: ubuntu-latest
172+
steps:
173+
- name: Check out ADOT Java repo
174+
uses: actions/checkout@v4
175+
with:
176+
repository: 'aws-observability/aws-otel-java-instrumentation'
177+
178+
- name: Setup Java
179+
uses: actions/setup-java@v4
180+
with:
181+
distribution: 'temurin'
182+
java-version: '17'
183+
184+
- name: Configure AWS Credentials
185+
uses: aws-actions/configure-aws-credentials@v4
186+
with:
187+
role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
188+
aws-region: us-east-1
189+
190+
- name: Retrieve account
191+
uses: aws-actions/aws-secretsmanager-get-secrets@v1
192+
with:
193+
secret-ids:
194+
ACCOUNT_ID, region-account/${{ matrix.aws-region }}
195+
196+
- name: Configure AWS Credentials
197+
uses: aws-actions/configure-aws-credentials@v4
198+
with:
199+
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }}
200+
aws-region: ${{ matrix.aws-region }}
163201

202+
- name: Build, zip, and upload the sample app to S3
203+
working-directory: sample-apps/apigateway-lambda
204+
shell: bash
205+
run: |
206+
gradle build
207+
gradle createLambdaZip
208+
aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./build/distributions/lambda-function.zip --key java-lambda-function.zip

0 commit comments

Comments
 (0)