Skip to content

Commit 97ad93f

Browse files
author
Travis Sheppard
authored
chore: update integ provision scripts to use AWS profile (#1429)
1 parent b7796fb commit 97ad93f

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

packages/amplify_api/example/tool/provision_integration_test_resources.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
set -e
33
IFS='|'
44

5+
profileName=${AWS_PROFILE:-default}
6+
57
FLUTTERCONFIG="{\
68
\"ResDir\":\"./lib/\",\
79
}"
@@ -17,6 +19,17 @@ FRONTEND="{\
1719
\"config\":$FLUTTERCONFIG\
1820
}"
1921

22+
AWSCLOUDFORMATIONCONFIG="{\
23+
\"configLevel\":\"project\",\
24+
\"useProfile\":\"true\",\
25+
\"profileName\":\"$profileName\",\
26+
\"region\":\"us-west-2\"\
27+
}"
28+
29+
PROVIDERS="{\
30+
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
31+
}"
32+
2033
# read the request template and the schema
2134
requestTemplate=`cat tool/add_api_request.json`
2235
schema=`cat tool/schema.graphql`
@@ -31,6 +44,7 @@ request="${requestTemplate/<SCHEMA_PLACEHOLDER>/$schema}"
3144
amplify init \
3245
--amplify $AMPLIFY \
3346
--frontend $FRONTEND \
47+
--providers $PROVIDERS \
3448
--yes
3549
echo "$request" | jq -c | amplify add api --headless
3650
amplify push --yes

packages/amplify_datastore/example/tool/provision_integration_test_resources.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
set -e
33
IFS='|'
44

5+
profileName=${AWS_PROFILE:-default}
6+
57
FLUTTERCONFIG="{\
68
\"ResDir\":\"./lib/\",\
79
}"
@@ -17,6 +19,17 @@ FRONTEND="{\
1719
\"config\":$FLUTTERCONFIG\
1820
}"
1921

22+
AWSCLOUDFORMATIONCONFIG="{\
23+
\"configLevel\":\"project\",\
24+
\"useProfile\":\"true\",\
25+
\"profileName\":\"$profileName\",\
26+
\"region\":\"us-west-2\"\
27+
}"
28+
29+
PROVIDERS="{\
30+
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
31+
}"
32+
2033
# read the request template and the schema
2134
requestTemplate=`cat tool/add_api_request.json`
2235
schema=`cat tool/schema.graphql`
@@ -31,6 +44,7 @@ request="${requestTemplate/<SCHEMA_PLACEHOLDER>/$schema}"
3144
amplify init \
3245
--amplify $AMPLIFY \
3346
--frontend $FRONTEND \
47+
--providers $PROVIDERS \
3448
--yes
3549
echo "$request" | jq -c | amplify add api --headless
3650
amplify push --yes

packages/auth/amplify_auth_cognito/example/tool/provision_integration_test_resources.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33
IFS='|'
44

5-
[ "$AWS_PROFILE" ] && profileName="$AWS_PROFILE" || profileName="default";
5+
profileName=${AWS_PROFILE:-default}
66

77
FLUTTERCONFIG="{\
88
\"ResDir\":\"./lib/\",\
@@ -21,7 +21,7 @@ FRONTEND="{\
2121

2222
AWSCLOUDFORMATIONCONFIG="{\
2323
\"configLevel\":\"project\",\
24-
\"useProfile\":"true",\
24+
\"useProfile\":\"true\",\
2525
\"profileName\":\"$profileName\",\
2626
\"region\":\"us-west-2\"\
2727
}"

0 commit comments

Comments
 (0)