Skip to content

Commit 7ce0d1d

Browse files
author
Travis Sheppard
authored
chore: use AWS secrets manager for CI integ secrets (#2247)
1 parent 640f894 commit 7ce0d1d

File tree

6 files changed

+16
-26
lines changed

6 files changed

+16
-26
lines changed

.github/composite_actions/fetch_backends/action.yaml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ inputs:
88
# scope for melos, e.g. "amplify_api_example"
99
scope:
1010
required: true
11-
# Amplify app IDs for specific categories
12-
api-app-id:
13-
required: true
14-
auth-app-id:
15-
required: true
16-
datastore-app-id:
17-
required: true
18-
storage-app-id:
11+
# ARN of secret from AWS Secrets Manger which is a JSON object of app IDs / s3 bucket ARNs
12+
secret-identifier:
1913
required: true
2014

2115
runs:
@@ -32,13 +26,15 @@ runs:
3226
run: ./build-support/create_integration_test_profile.sh
3327
shell: bash
3428

29+
- name: Get Amplify App IDs / bucket ARNs from Secrets Manager
30+
uses: aws-actions/aws-secretsmanager-get-secrets@bafac38d78b5f679d35ef3f36f9842a63de59564 # 1.0.0
31+
with:
32+
secret-ids: |
33+
${{ inputs.secret-identifier }}
34+
parse-json-secrets: true
35+
3536
- name: Pull Amplify Configurations
36-
run: |
37-
API_APP_ID=${{ inputs.api-app-id }} \
38-
AUTH_APP_ID=${{ inputs.auth-app-id }} \
39-
DATASTORE_APP_ID=${{ inputs.datastore-app-id }} \
40-
STORAGE_APP_ID=${{ inputs.storage-app-id }} \
41-
melos exec --scope=${{ inputs.scope }} ./tool/pull_test_backend.sh
37+
run: melos exec --scope=${{ inputs.scope }} ./tool/pull_test_backend.sh
4238
shell: bash
4339

4440
- name: Undo any codegen changes from amplify pull

.github/workflows/amplify_integration_tests.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ jobs:
4545
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
4646
aws-region: ${{ secrets.AWS_REGION }}
4747
scope: ${{ matrix.scope }}
48-
api-app-id: ${{ secrets.API_APP_ID }}
49-
auth-app-id: ${{ secrets.AUTH_APP_ID }}
50-
datastore-app-id: ${{ secrets.DATASTORE_APP_ID }}
51-
storage-app-id: ${{ secrets.STORAGE_APP_ID }}
48+
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
5249

5350
- name: Build example app with integration tests
5451
run: |
@@ -94,10 +91,7 @@ jobs:
9491
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
9592
aws-region: ${{ secrets.AWS_REGION }}
9693
scope: ${{ matrix.scope }}
97-
api-app-id: ${{ secrets.API_APP_ID }}
98-
auth-app-id: ${{ secrets.AUTH_APP_ID }}
99-
datastore-app-id: ${{ secrets.DATASTORE_APP_ID }}
100-
storage-app-id: ${{ secrets.STORAGE_APP_ID }}
94+
secret-identifier: ${{ secrets.AWS_SECRET_IDENTIFIER }}
10195

10296
- name: Build example app with integration tests
10397
run: |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
APP_ID=$DATASTORE_APP_ID ../../../build-support/pull_backend_by_app_id.sh
4+
APP_ID=$AFS_DATASTORE_APP_ID ../../../build-support/pull_backend_by_app_id.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
APP_ID=$API_APP_ID ../../../../build-support/pull_backend_by_app_id.sh
4+
APP_ID=$AFS_API_APP_ID ../../../../build-support/pull_backend_by_app_id.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
APP_ID=$AUTH_APP_ID ../../../../build-support/pull_backend_by_app_id.sh
4+
APP_ID=$AFS_AUTH_APP_ID ../../../../build-support/pull_backend_by_app_id.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
APP_ID=$STORAGE_APP_ID ../../../../build-support/pull_backend_by_app_id.sh
4+
APP_ID=$AFS_STORAGE_APP_ID ../../../../build-support/pull_backend_by_app_id.sh

0 commit comments

Comments
 (0)