Skip to content

Commit

Permalink
Fixed lambda sample app upload workflow (#337)
Browse files Browse the repository at this point in the history
*Description of changes:*
While doing some tests, found out that the lambda sample app workflow
upload wasn't working as expected. I fixed it in this PR and tested it
here:
https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/12398929067/job/34612754042

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
  • Loading branch information
AsakerMohd authored Dec 18, 2024
1 parent e444e6e commit 75d9bca
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/dotnet-sample-app-s3-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,54 @@ jobs:
aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./dotnet-ec2-win-remote-setup.ps1 --key dotnet-ec2-win-remote-setup.ps1
aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./amazon-cloudwatch-agent.json --key amazon-cloudwatch-agent.json
- name: Build Lambda Sample App
build-and-upload-lambda-sample-app:
strategy:
fail-fast: false
matrix:
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',
'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
'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',
'us-east-1','us-east-2', 'us-west-1', 'us-west-2' ]
runs-on: ubuntu-latest
steps:
- name: Checkout sample app repo
uses: actions/checkout@v4
with:
repository: 'aws-observability/aws-otel-dotnet-instrumentation'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }}
aws-region: us-east-1

- name: Retrieve account
uses: aws-actions/aws-secretsmanager-get-secrets@v1
with:
secret-ids:
ACCOUNT_ID, region-account/${{ matrix.aws-region }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }}
aws-region: ${{ matrix.aws-region }}

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'

- name: Setup .NET Lambda Tools
shell: bash
run: dotnet tool install -g Amazon.Lambda.Tools
working-directory: sample-applications/lambda-test-apps/SimpleLambdaFunction

- name: Build Lambda Sample App
shell: bash
run: dotnet lambda package -pl ./src/SimpleLambdaFunction
working-directory: sample-applications/lambda-test-apps/SimpleLambdaFunction

- name: Upload to Lambda Sample App to S3
- name: Upload Lambda Sample App to S3
working-directory: sample-applications/lambda-test-apps/SimpleLambdaFunction
run: aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./src/SimpleLambdaFunction/bin/Release/net8.0/SimpleLambdaFunction.zip --key dotnet-function.zip


run: aws s3api put-object --bucket aws-appsignals-sample-app-prod-${{ matrix.aws-region }} --body ./src/SimpleLambdaFunction/bin/Release/net8.0/SimpleLambdaFunction.zip --key dotnet-function.zip

0 comments on commit 75d9bca

Please sign in to comment.