Sample App Deployment - Dotnet S3 #54
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| ## SPDX-License-Identifier: Apache-2.0 | |
| name: Sample App Deployment - Dotnet S3 | |
| on: | |
| workflow_dispatch: # be able to run the workflow on demand | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| build-and-upload-lambda-sample-app: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| aws-region: [ 'us-east-1' ] | |
| 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 | |
| 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 |