|
| 1 | +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | +## SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +name: App Signals Enablement - S3 Django Sample App Deployment |
| 5 | +on: |
| 6 | + workflow_dispatch: # be able to run the workflow on demand |
| 7 | + |
| 8 | +permissions: |
| 9 | + id-token: write |
| 10 | + contents: read |
| 11 | + |
| 12 | +jobs: |
| 13 | + upload-sample-app-zip: |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + 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', |
| 18 | + 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', |
| 19 | + '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', |
| 20 | + 'us-east-1','us-east-2', 'us-west-1', 'us-west-2' ] |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + fetch-depth: 0 |
| 26 | + |
| 27 | + - name: Configure AWS Credentials |
| 28 | + uses: aws-actions/configure-aws-credentials@v4 |
| 29 | + with: |
| 30 | + role-to-assume: ${{ secrets.E2E_SECRET_TEST_ROLE_ARN }} |
| 31 | + aws-region: us-east-1 |
| 32 | + |
| 33 | + - name: Retrieve account |
| 34 | + uses: aws-actions/aws-secretsmanager-get-secrets@v1 |
| 35 | + with: |
| 36 | + secret-ids: |
| 37 | + ACCOUNT_ID, region-account/${{ matrix.aws-region }} |
| 38 | + |
| 39 | + - name: Configure AWS Credentials |
| 40 | + uses: aws-actions/configure-aws-credentials@v4 |
| 41 | + with: |
| 42 | + role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }} |
| 43 | + aws-region: ${{ matrix.aws-region }} |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + - name: Build Sample App Zip |
| 48 | + working-directory: sample-apps/python |
| 49 | + run: zip -r python-sample-app.zip . |
| 50 | + |
| 51 | + - name: Upload to S3 |
| 52 | + working-directory: sample-apps/python |
| 53 | + run: aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body ./python-sample-app.zip --key python-sample-app.zip |
| 54 | + |
0 commit comments